Category: Plugin

WordPress Plugin Boilerplate Code Generator from Tom Mcfarlin's Plugin Boilerplate

Tom Mcfarlin has written an excellent boilerplate for plugin developers. It is very easy to start writing your own plugins using his boilerplate. But if you want to personalize it to YourPluginName, you will have to modify all these files and replace hardcoded variables and class names which is a real pain in the ass.

So I have created a code generator which takes Tom Mcfarlin’s repository and replace everything (wherever necessary) by your plugin name, author name etc and personalize it so that you can download and start using it right away.

Check out this code generator at http://codegen.kickapz.com

You can download the source code of this code generator at https://github.com/hasinhayder/plugin-boilerplate-code-generator

Writing a new plugin is now painless 🙂

Utopia – our new admin panel theme is ready to grab

Last week, we have released a new admin panel theme from themio. This new theme, “Utopia” comes packed with lots of beautifully crafted UI elements and it is built on top of popular twitter bootstrap framework. So you will be getting all the features of twitter bootstrap plus the extras.

Check Utopia in Themeforest: Click here

Utopia comes with two themes white and dark which will suit your need in different situations. The collapsible sidebar and widgets, data tables, conversations tables, pricing tables and numbers of galleries with image effect will make it a perfect choice for the backend of your web applications

Screenshots

Dashoboard comes with a glimpse of beautifully crafted UI elements that comes with Utopia. The collapsible and
responsive
sidebar, data tables, legends, weather controls, data tables, news feed ticker and many more

Dashboard

(more…)

jQuery Mouse Direction Plugin

jQuery provides support for standard JS mouse events as well as some custom ones. In jQuery it’s easy to capture whether mouse point has entered in the boundary of an object or left from (mouseenter, mouseleave) or something else happened (like click, dblclick etc). But you are in trouble if you need to capture the direction of your mouse. And it would be fantastic if there was a plugin which can fire custom mouse-direction event on any elements which you can then listen to and bind a listener routine.

I wrote this small plugin (jQuery MouseDirection Plugin) this afternoon to trigger eight custom event for any visible element in the DOM structure. Here is the source code. This plugin registers eight custom directional event like up,down,left,right,top-left,top-right,bottom-left, bottom-right and one more generic event called “mousedirection” where you can capture the direction of the mouse using event object’s “direction” parameters (like event.direction)

[sourcecode language=”javascript”]
/**
* jQuery Mouse Direction Plugin
* @version: 1.1
* @author Hasin Hayder [[email protected] | http://hasin.me]
*/
(function ($) {
var options = {};
var oldx = 0;
var oldy = 0;
var direction="";
$.mousedirection = function (opts) {
var defaults = {
};
options = $.extend(defaults, opts);
$(document).bind("mousemove", function (e) {
var activeElement = e.target || e.srcElement;
if (e.pageX > oldx && e.pageY > oldy) {
direction="bottom-right";
}
else if (e.pageX > oldx && e.pageY < oldy) {
direction="top-right";
}
else if (e.pageX < oldx && e.pageY < oldy) {
direction="top-left";
}
else if (e.pageX < oldx && e.pageY > oldy) {
direction="bottom-left";
}
else if (e.pageX > oldx && e.pageY == oldy) {
direction="right";
}
else if (e.pageX == oldx && e.pageY > oldy) {
direction="down";
}
else if (e.pageX == oldx && e.pageY < oldy) {
direction="up";
}
else if (e.pageX < oldx && e.pageY == oldy) {
direction="left";
}
$(activeElement).trigger(direction);
$(activeElement).trigger({type:"mousedirection",direction:direction});
oldx=e.pageX;
oldy=e.pageY;
});
}
})(jQuery)
[/sourcecode]

An here is how you can use it

[sourcecode language=”html”]
<head>
<title>jQuery Mouse Direction Plugin Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.mousedirection.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css">
.container {
height: 150px;
margin: 20px;
padding: 20px;
width: 300px;
border: 1px solid #888;
}
</style>
<body>
<div class="container">
Move your mouse over this box
</div>
<script type=’text/javascript’>
$(function () {
$.mousedirection();
$(".container").bind("mousedirection", function (e) {
$(this).html("Mouse Direction: <b>"+e.direction+"</b>");
});
});
</script>
</body>
[/sourcecode]

To save from the overwork of running a check whether the mouse has entered on the supplied DOM elements (via selectors) I have located the active element under the mouse pointer and triggered the event only on that object – this was a huge performance boost 🙂

Download the complete plugin with the example.html from the link below

Download jQuery Mouse Direction Plugin

🙂 Enjoy!

My slide from SQABD LightningTalks4

As like before, LightningTalks4 arranged by SQABD was really great this time. This time it was sponsored by bGlobal Sourcing and I really enjoyed a nice evening with all the techy geeks after a long time 🙂

I presented my session on “BanglaInput Manager, jQuery Plugin” and you can download the slides from the following two links

1. http://www.box.net/shared/2tigrtdh1p
or
2. http://dl.dropbox.com/u/5396928/SQABD-LT4-BanglaInputManager.pptx

You can visit the demo plugin at http://scripts.ofhas.in/bim/

Thanks for being there. It was nice to meet you all.

WordPress Bangla Date Plugin

Yesterday I developed a plug in for wordpress users. Using this plug in you can display all the dates for your posts and comments in Bengali. So download the plug in from the following link, place it in plugins folder and enable it from “plugins” menu in wordpress administration panel. You are done.

I have released under Ekushey. Thanks to Omi Azad for the work.
http://www.ekushey.org/?page/Bangla_Date_Plugin_for_Wordpress

The project was inspired by Humayun bhai from e-Kobi

WordPress Plugin for Bengali WordPressians (?)

Ah ya, let me call you WordPressian if you are a wordpress fan. Last night I developed a small plugin for bengali wordpress users. If you install this plugin you will be able to write in Unijoy, Phonetic and Plain English mode. You will get three buttons as shown here
editor.gif

Then you can type Unicode on se,ecting either UniJoy or Phonetic
editor2.gif

And you can write english anytime by clicking English button or pressing Control+C

editor3.gif

Thats it. I will release this plugin under Ekushey.org by Tomorrow