diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9d6bd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,215 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg diff --git a/README.md b/README.md index cbdae1f..a3f01f5 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,30 @@ -jQuery MsgBox -============= +# jQuery MsgBox -0.3.7 BETA +0.8.1 BETA -What is it? ------------ +## What is it? Firefox style simplist dialog form. -How to use this? ----------------- +## How to install? + +before install, you must have [jQuery](http://jquery.com/download/) >= 1.5.0, I strongly recommand you have a lastest version. + +That's very simple. just download below lastest version, + + - [Minified (for production)](https://raw.github.com/composite/jQuery.MsgBox/master/jquery.msgbox.min.js) + - [Unminified (for development)](https://raw.github.com/composite/jQuery.MsgBox/master/jquery.msgbox.js) + +If you have bower? just type in your console. + +``` +bower install msgbox +``` + +Still not easy? OH PLZ... + +## How to use this? It's quiet simple. @@ -19,17 +33,16 @@ It's quiet simple. ``` -alert("i'm alert"); --> $.alert("i'm alert"); + alert("i'm alert"); + -> $.alert("i'm alert"); -confirm("Are you sure?"); --> $.confirm("Are you sure?"); + confirm("Are you sure?"); + -> $.confirm("Are you sure?"); -prompt("please text me."); --> $.prompt("please text me."); + prompt("please text me."); + -> $.prompt("please text me."); -Wait! YOU MUST SEE BEFORE USE THIS PLUGIN, ------------------------------------------- +## Wait! YOU MUST SEE BEFORE USE THIS PLUGIN, this plugin is can't replace as javascript standard function (alert, etc.) because, this plugin cannot wait user action while showing dialog. If you want get user's action, put a callback function in next of message param. @@ -46,6 +59,7 @@ form.submit=function(){ } ``` **So, what can I do?** + ```js form.submit=function(){ if(!form.confirm){//Use variables or DOM objects or whatever you want. @@ -59,20 +73,19 @@ form.submit=function(){ ``` * You can use another solution to solve this. -OK. so, How to use with callback function? ------------------------------------------- +## OK. so, How to use with callback function? jQuery.MsgBox can add your callback function for provide next action after user clicked. It's Very simple. ```js $.alert("click me.",function(){ - $.alert('you clicked'); + $.alert('you are clicked!'); }); ``` ```js $.confirm("press OK or Cancel.",function(bool){ - $.alert('you clicked'+(bool?'OK':'cancel')); + $.alert('you are clicked '+(bool?'OK':'cancel')); }); ``` ```js @@ -81,34 +94,97 @@ $.prompt("what's your name?",function(string){ }); ``` -I want view live example. -------------------------- +## I want view live example. -OK. [here's an example](http://jsfiddle.net/preFy/ "live example"). +Sure. [here's an example](http://jsfiddle.net/preFy/ "live example"). -What browser can run with this plugin? --------------------------------------- -first, jQuery 1.4 or later needed. +## What browser can run with this plugin? + +first, jQuery 1.5 or later needed. and, You can run with most popular major browser, Internet Explorer 8 or above, Firefox 3 or above, Safari 4 or above, Chrome 10 or above, Opera 9 or above. NOTE : Old school browser, such as IE 7 or lower is have a problem with CSS issue. that's all. this plugin have NO images or other resources. -Wow! It's simple and cool! can I join with you for make better this plugin? ---------------------------------------------------------------------------- +## I want use as own style, is it possible? + +Yes. check out [Wiki](https://github.com/composite/jQuery.MsgBox/wiki) for detailed usage. + +## Wow! It's simple and cool! can I join with you for make better this plugin? Sure. contributes are welcome! just fork this plugin and get involved to make a better place for you and for me. -Goals ------ +## Hey, I'm using IE version under 9, Msgbox flicking when showing MsgBox. What's happening? + +Sorry. that is prevent changing width dynamically after center align on IE. I don't know it is bug, but I'll figure out it. + +## Goals - More Simplify and Optimization. - Less Size and Unresolved Issues. - - **All Methods will returns Deferred Object instead of DOM Container** + - **All Methods will returns Deferred Object instead of DOM Container** ??? Well, I'll think about it. + +## What's new? + +### 0.8.1 + + - Some code optimization. + - Use UglifyJS for minification, instead of YUI compressor. + +### 0.8.0 + + - Major UI changes: more compatibility to view, Wrapped more a div to centering layer using only CSS (but still vertical centering using JS). + - NEW property: onopen event property and $.msgbox.onopen static property; Fires after msgbox opened. + - NEW property: onclose event property and $.msgbox.onclose static property; Fires before msgbox closing. + - 2 new property for your own CSS or JS animation effect. onclose event also support jQuery Deferred Object. See [Wiki](https://github.com/composite/jQuery.MsgBox/wiki) for details. + +### 0.7.5 + + - console.log() for test will not fired in production mode. + +### 0.7.4 + + - Container add for prompt bug fixed. + - fixed prompt UI. + +### 0.7.3 (internal) + + - onresize event callback changed; this keyword will point to msgbox container. plain DOM, not jQuery. + +### 0.7.2 (internal) + + - remove static property **customStyle**. just add style `````` or ``` ``` instead. + - Fixed minor UI bugs. + +### 0.7.1 (Internal) + + - Fixed some bug. + - console.log() for test is will not fired in production mode. + +### 0.7.0 (Internal) + + - Replaced inline style to inline CSS for more performance. + - Removed css property in $.msgbox() use $.msgbox.css or own standard CSS instead. + - input property of $.msgbox changed. You can set any human-view type (string, number, etc). if not want prompt, just set false or undefined or null. + - Fixed ENTER or ESC press event bug in input box + - new property: onresize; available on $.msgbox() or $.msgbox.onresize static property. You can prepare when window size changes. see wiki for details. + - new static property: customStyle; You want set own style instead of default style, just add your code : ```$.msgbox.customStyle = true;``` + +### 0.6.1 + + - Fixed forced true callback after press ENTER key. focused button will fired event if you press ENTER key. + +### 0.6.0 + + - Auto resizing added. Msgbox will show full size when window size less than alert size, If not, revert to original size. + +### 0.5.0 + - Use <div> with white-space: pre; instead of <pre> for more better view of MsgBox with CSS Framework such as Bootstrap. + - Remove Browser compatibility for position:fixed is buggy under IE 7, so this will support jQuery over 1.8! I'll never test freaking old browsers. + - Remove jQuery in my repository, Use any available jQuery CDN in demo instead. -License -------- +## License (The MIT License) @@ -118,4 +194,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..a2797da --- /dev/null +++ b/bower.json @@ -0,0 +1,13 @@ +{ + "name": "msgbox", + "version": "0.8.1", + "description": "The Message box for web, Firefox style, User notification made simple.", + "keywords": ["alert","confirm","prompt","msgbox","dialog","notification","ui","simple"], + "authors": ["Composite"], + "license": "MIT", + "homepage": "https://github.com/composite/jQuery.MsgBox", + "main": ["jquery.msgbox.min.js"], + "ignore": ["*.json"], + "dependencies": {"jquery": ">= 1.5.0"}, + "devDependencies": {} +} diff --git a/demo.html b/demo.html index 51b685b..5d004bc 100644 --- a/demo.html +++ b/demo.html @@ -7,12 +7,12 @@
- + - + '); + + + +