Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Assis committed Mar 28, 2016
1 parent ed9413a commit b9c168d
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 1 deletion.
84 changes: 84 additions & 0 deletions .tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 0 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.9~svn20110310 //
createDiv /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ createDiv: function (attr, name, parent) {$/;" function line:14
customKit.createDiv /var/www/html/gits/custom-alert/dist/js/customAlert.js /^var customKit = {$/;" method line:13
mergeObjects /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ mergeObjects: function (obj1, obj2) {$/;" function line:25
customKit.mergeObjects /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ },$/;" method line:24
customAlert /var/www/html/gits/custom-alert/dist/js/customAlert.js /^function customAlert(options) {$/;" function line:37
customAlert.defaultOptions.ok /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.defaultOptions = {$/;" property line:39
customAlert.defaultOptions.title /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ 'ok': 'OK',$/;" property line:40
render /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.render = function (dialog) {$/;" function line:64
customAlert.render /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.render = function (dialog) {$/;" method line:64
ok /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.ok = function () {$/;" function line:74
customAlert.ok /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.ok = function () {$/;" method line:74
customAlert /var/www/html/gits/custom-alert/dist/js/customAlert.js /^function customAlert(options) {$/;" class line:37
customConfirm /var/www/html/gits/custom-alert/dist/js/customAlert.js /^function customConfirm(options) {$/;" function line:82
customConfirm.defaultOptions.yes /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.defaultOptions = {$/;" property line:84
customConfirm.defaultOptions.no /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ 'yes': 'YES',$/;" property line:85
customConfirm.defaultOptions.title /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ 'no': 'NO',$/;" property line:86
customConfirm.defaultOptions.return /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ 'title': 'Confirm it:',$/;" property line:87
callback /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.callback = function (data) {$/;" function line:111
customConfirm.callback /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.callback = function (data) {$/;" method line:111
render /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.render = function (dialog, callback) {$/;" function line:115
customConfirm.render /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.render = function (dialog, callback) {$/;" method line:115
ok /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.ok = function () {$/;" function line:126
customConfirm.ok /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.ok = function () {$/;" method line:126
cancel /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.cancel = function () {$/;" function line:138
customConfirm.cancel /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.cancel = function () {$/;" method line:138
end /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.end = function () {$/;" function line:148
customConfirm.end /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.end = function () {$/;" method line:148
clear /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.clear = function () {$/;" function line:154
customConfirm.clear /var/www/html/gits/custom-alert/dist/js/customAlert.js /^ this.clear = function () {$/;" method line:154
customConfirm /var/www/html/gits/custom-alert/dist/js/customAlert.js /^function customConfirm(options) {$/;" class line:82
* window.customAlert e window.customConfirm devem permanecer com esses nomes /var/www/html/gits/custom-alert/dist/css/customAlert.css /^ * window.customAlert e window.customConfirm devem permanecer com esses nomes,$/;" function line:10
#customAlert-overlay /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert-overlay {$/;" function line:14
#customConfirm-overlay /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm-overlay {$/;" function line:26
#customAlert /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert {$/;" function line:38
#customAlert button /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert button {$/;" function line:42
#customAlert button:hover /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert button:hover {$/;" function line:47
#customConfirm /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm {$/;" function line:52
#customConfirm button.confirm /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm button.confirm {$/;" function line:56
#customConfirm button.confirm:hover /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm button.confirm:hover {$/;" function line:62
#customConfirm button.cancel /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm button.cancel {$/;" function line:67
#customConfirm button.cancel:hover /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm button.cancel:hover {$/;" function line:72
#customAlert /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert,$/;" function line:77
#customConfirm /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm {$/;" function line:78
@media (min-width: 321px) /var/www/html/gits/custom-alert/dist/css/customAlert.css /^@media (min-width: 321px) {$/;" function line:96
#customAlert /var/www/html/gits/custom-alert/dist/css/customAlert.css /^ #customAlert,$/;" function line:97
#customConfirm /var/www/html/gits/custom-alert/dist/css/customAlert.css /^ #customConfirm {$/;" function line:98
@media (max-width: 550px) /var/www/html/gits/custom-alert/dist/css/customAlert.css /^@media (max-width: 550px) {$/;" function line:103
#customAlert /var/www/html/gits/custom-alert/dist/css/customAlert.css /^ #customAlert,$/;" function line:104
#customConfirm /var/www/html/gits/custom-alert/dist/css/customAlert.css /^ #customConfirm {$/;" function line:105
#customAlert .header /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert .header,$/;" function line:110
#customConfirm .header /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm .header {$/;" function line:111
#customAlert .body /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert .body,$/;" function line:118
#customConfirm .body /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm .body {$/;" function line:119
#customAlert .footer /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert .footer,$/;" function line:127
#customConfirm .footer /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm .footer {$/;" function line:128
#customAlert button /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customAlert button,$/;" function line:133
#customConfirm button /var/www/html/gits/custom-alert/dist/css/customAlert.css /^#customConfirm button {$/;" function line:134
html /var/www/html/gits/custom-alert/example.html /^<html>$/;" function line:2
head /var/www/html/gits/custom-alert/example.html /^<head>$/;" function line:3
meta /var/www/html/gits/custom-alert/example.html /^ <meta charset="UTF-8">$/;" function line:4
title /var/www/html/gits/custom-alert/example.html /^ <title>Example Custom Alert<\/title>$/;" function line:5
link /var/www/html/gits/custom-alert/example.html /^ <link href="dist\/css\/customAlert.css" rel="stylesheet">$/;" function line:6
body /var/www/html/gits/custom-alert/example.html /^<body>$/;" function line:8
h /var/www/html/gits/custom-alert/example.html /^<h1>Custom Alert<\/h1>$/;" function line:9
h /var/www/html/gits/custom-alert/example.html /^<h2>Por: Philippe Assis<\/h2>$/;" function line:11
a /var/www/html/gits/custom-alert/example.html /^<a href="https:\/\/github.com\/PhilippeAssis\/custom-alert">github.com\/PhilippeAssis\/custom-alert<\/a>$/;" function line:12
script /var/www/html/gits/custom-alert/example.html /^<script src="dist\/js\/customAlert.js" language="javascript"><\/script>$/;" function line:13
script /var/www/html/gits/custom-alert/example.html /^<script>$/;" function line:14
Custom Alert /var/www/html/gits/custom-alert/README.md /^#Custom Alert$/;" function line:1
Documentação e exemplos: /var/www/html/gits/custom-alert/README.md /^##Documentação e exemplos:$/;" function line:4
name /var/www/html/gits/custom-alert/bower.json /^ "name": "custom-alert",$/;" function line:2
homepage /var/www/html/gits/custom-alert/bower.json /^ "homepage": "https:\/\/github.com\/PhilippeAssis\/custom-alert",$/;" function line:3
authors /var/www/html/gits/custom-alert/bower.json /^ "authors": [$/;" function line:4
description /var/www/html/gits/custom-alert/bower.json /^ "description": "Function alert () and confirm () customizable. Replace the functions alert () and confirm () JavaScript function, allowing customizes them. This application does not use jQuery or another framework, only JavaScript and CSS. It works perfect mind in mobile devices, adapting automatically to the screen size.",$/;" function line:7
main /var/www/html/gits/custom-alert/bower.json /^ "main": "customAlert.js",$/;" function line:8
moduleType /var/www/html/gits/custom-alert/bower.json /^ "moduleType": [],$/;" function line:9
license /var/www/html/gits/custom-alert/bower.json /^ "license": "MIT",$/;" function line:10
ignore /var/www/html/gits/custom-alert/bower.json /^ "ignore": [$/;" function line:11
47 changes: 46 additions & 1 deletion dist/js/customAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ function customAlert(options) {
customKit.createDiv("class", "footer", "customAlert");

//Os nomes podem ser alterados, window.alert e window.Alert, ao seu gosto!
window.alert = window.Alert = function (dialog, options) {
window.alert = window.Alert = function (dialog, options, callback) {
if (typeof options == 'function')
options = {'callback': options};
else if(options && typeof options.callback == 'function')
options.callback = callback;


if (options)
window.customAlert.options = customKit.mergeObjects(window.customAlert.options, options);

window.customAlert.render(dialog);
};
}
Expand All @@ -72,6 +79,10 @@ function customAlert(options) {
};

this.ok = function () {
if(typeof this.options.callback == 'function')
if(this.options.callback() === false)
return;

document.getElementById("customAlert").style.display = "none";
document.getElementById("customAlert-overlay").style.display = "none";
document.getElementsByTagName("html")[0].style.overflow = "auto";
Expand All @@ -80,6 +91,13 @@ function customAlert(options) {
}

function customConfirm(options) {
var confirmIt, cancelIt;

confirmIt = new Event('confirmIt');
cancelIt = new Event('cancelIt');

window.dispatchEvent(confirmIt);
window.dispatchEvent(cancelIt);

this.defaultOptions = {
'yes': 'YES',
Expand Down Expand Up @@ -124,7 +142,12 @@ function customConfirm(options) {
};

this.ok = function () {
if(typeof this.options.confirm == "function")
if(!this.options.confirm())
return;

this.end();

if (this.options.return) {
this.clear();
this.callback(true);
Expand All @@ -136,12 +159,18 @@ function customConfirm(options) {
}

this.cancel = function () {
if(typeof this.options.cancel == "function")
if(!this.options.cancel())
return;

this.end();

if (this.options.return) {
this.clear();
this.callback(false);
return;
}

this.clear();
}

Expand All @@ -156,6 +185,22 @@ function customConfirm(options) {
}
}

window.addEventListener('keydown', function (e) {
var keynum;

keynum = e.keyCode ? e.keyCode : e.which;

if (keynum == 13) {
if (document.getElementById("customConfirm").style.display == "block")
window.customConfirm.ok();
else if (document.getElementById("customAlert").style.display == "block")
window.customAlert.ok();
}
else if (keynum == 27 && document.getElementById("customConfirm").style.display == "block")
window.customConfirm.cancel();

}, false);

/*
* window.customAlert e window.customConfirm devem permanecer com esses nomes, a não se que vc saiba o que esta fazendo.
* Vocẽ pode adicionar configuraçãos na declaração de ambos, ex: new customConfirm({execute:false});
Expand Down

0 comments on commit b9c168d

Please sign in to comment.