Skip to content

Commit

Permalink
Migration commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bcinarli committed Nov 6, 2014
1 parent 04a67e2 commit fd302fd
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "uxrocket.popup",
"version": "0.2.0",
"homepage": "https://github.com/uxrocket/uxrocket.popup",
"authors": [
"Bilal Çınarlı <[email protected]>"
],
"description": "jQuery based popup",
"main": "lib/uxrocket.popup.js",
"dependencies": {
"jquery": ">=1.11.1"
},
"keywords": [
"jQuery",
"javascript",
"popup",
"uxrocket"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
Empty file added docs/install.md
Empty file.
86 changes: 86 additions & 0 deletions lib/uxrocket.popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* UX Rocket
* jQuery based popup
* @author Bilal Cinarli
*/

;(function($){
var ux, // local shorthand
index = 1,

defaults = {
resizable : 'no',
scrollbars : 'yes',
width : 1100,
height : 700,
top : 0,
left : 0
};

// constructor method
var Popup = function(el, options){
var $el = $(el),
opts = $.extend({}, defaults, options, $el.data()),

// cached variables
url = $el.attr('href'),
windowName = 'uxrocketApp_' + index,
params;

sizeToDims(opts);

if(typeof opts.window !== 'undefined' && opts.window !== '')
{
windowName = opts.window;

delete opts.window;
}

params = $.param(opts).split('&').join(', ');

$el.on('click', function(e){
e.preventDefault();

window.open(url, windowName, params);
});

index++;
};

var sizeToDims = function(opts){
var str, slice;

if(typeof opts.size === 'string' && opts.size !== ''){
str = opts.size;
slice = str.split(",");
opts.width = $.trim(slice[0]);
opts.height = $.trim(slice[1]);
delete opts.size;
}

return opts;
};

// jquery bindings
ux = $.fn.popup = $.uxpopup = function(options){
return this.each(function(){
var $el = $(this),
popup;

if($el.hasClass('uxitd-popup-ready')){
return;
}

$el.addClass('uxitd-popup-ready');

popup = new Popup(this, options);
});
};

// Version
ux.version = "0.2.0";

// settings
ux.settings = defaults;

})(jQuery);
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "uxrocket.popup",
"version": "0.2.0",
"description": "jQuery based popup",
"repository": {
"type": "git",
"url": "https://github.com/uxrocket/uxrocket.popup.git"
},
"dependencies": {
"jquery": "latest"
},
"keywords": [
"jQuery",
"javascript",
"input",
"textarea",
"uxrocket"
],
"author": "Bilal Cinarli <[email protected]> (http://bcinarli.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/uxrocket/uxrocket.popup/issues"
},
"homepage": "https://github.com/uxrocket/uxrocket.popup"
}
Empty file added tests/tests.md
Empty file.

0 comments on commit fd302fd

Please sign in to comment.