WPF Scheduler control

Working in a personal WPF MVVM project, I needed a scheduler to manage some appointments. I was looking for something similar to google calendar, which one I think is quite good.

After some hours searching and trying everything I found on internet, I didn’t find anything good. I didn’t like them or were comercial products so… why not do it myself? Some hours later I had implemented something which I was very happy, therefore here it is available for everyone. It is a scheduler similar to Google calendar, with three views: Month, Week and Day.

Some screenshots:

day view
Sigue leyendo

Paint board with canvas (jQuery plugin)

On the occasion of a possible project I started researching on how to make a kind of “paint” in the web. I knew the existence of canvas but it wasn’t very clear what could it do and compatibility issues of browsers that could have.

In the end I developed a jQuery plugin which everyone can could use. And here’s a DEMO.

More information and download HERE

DEMO de canvasPaint

CKEditor Media Embed with multiples instances

To embed videos from YouTube, Vimeo, etc. .., there is a plugin called MediaEmbeb which performs its tasks perfectly.

When used in my project I realized that if on the same page we have more of an HTML editor, going to embed a video in one of the first editors, it actually inserts the last of them.

I have been reviewing the code and the solution is very simple.

  1. Look for the plugin folder in «.. / CKEditor / plugins / mediaembed /»
  2. In that folder locate and open the file «plugin.js»
  3. Locate the line:
    CKEDITOR.dialog.add( 'MediaEmbedDialog', function ()
  4. And replace it:
    CKEDITOR.dialog.add( 'MediaEmbedDialog', function (editor)

With this simple change everything will work correctly.

Open a popup from the «href» of a link

Today I found a problem that seemed silly but ultimately cost me a while to find the solution.

The problem is I was using a javascript component that «paints» a menu. This component receives a N dimensional matrix representing the menus and submenus.

Simplifying, this array receives for each menu item text to display and the URL where it has that option menu. Finally, the component generates something like this:

TEXT

The problem has come when I need has arisen that one of those links would open a popup, instead of redirecting to an URL.

In a normal environment it would be easy enough to do something like this:

TEXT

But the component does not allow me to put code in the «onclick» so the choice was to play with the parameter «URL» was wrong for opening the popup.

I tried several options:

1. TEXT

2. TEXT

3. TEXT

...

And managed to open the popup but then the page is reloaded and showed simply «[OBJECT], so it was not worth the solution. Much» return false; «that poking.

In the end the solution has been to write this:

TEXTOpen a popup from the "href" of a link

How to avoid triggering IE compatibility mode

Since the Internet Explorer version 8 there is the possibility that pages renderize emulating version 7. For version 9 can emulate the two previous versions.

This can come in handy for old sites, is a headache sometimes.

I have a couple of days going crazy with the following problem:

I’m using a jQuery plugin that I’ve created. This plugin looks a kind of menu elements positioned absolutely. This position is dynamically calculated.

For this calculation IE7 I do differently so I have a piece of code that detects the browser version and depending on if it’s 7 or greater, for one thing or another.

The problem comes because to deploy this plugin on the web, which is an intranet, the browser automatically (Internet Explorer 9) is configured to process the document as if the 7, but still identifying themselves as 9.

In this way from the receipt code is version 9 and acted accordingly, but as is treating the document as version 7, it looks all wrong. If I’m not mistaken behaves well to be opening an intranet web.

We can see this giving F12 in Internet Explorer.

There are directives to force IE to emulate a previous version, but what I want is the opposite, to run with version 9, which is really what it is.

And after much searching, this is the policy that you have to put into the HEAD of the page.

<meta http-equiv="X-UA-Compatible" content="IE=7,8,9" />