Skip to content

Commit babba9e

Browse files
committedFeb 9, 2017
- Dist folder had been compiled
- Version info had been fixed
1 parent e390f82 commit babba9e

19 files changed

+78
-27
lines changed
 

‎.csslintrc

100644100755
File mode changed.

‎.gitignore

100644100755
File mode changed.

‎.jshintignore

100644100755
File mode changed.

‎.jshintrc

100644100755
File mode changed.

‎LICENSE

100644100755
File mode changed.

‎README.md

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $(".dialog").dialog({
1717
confirm: {
1818
text: "OK",
1919
className: "confirm-button"
20-
}
20+
},
2121
onConfirm: function(){
2222
form.submit();
2323
}
@@ -32,7 +32,7 @@ $.uxrdialog({
3232
confirm: {
3333
text: "OK",
3434
className: "confirm-button"
35-
}
35+
},
3636
onConfirm: function(){
3737
form.submit();
3838
}

‎bower.json

100644100755
File mode changed.

‎dist/uxrocket.dialog.css

100644100755
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*! UX Rocket Dialog
22
* jQuery based Dialog plugin
33
* @author Bilal Cinarli <bcinarli@gmail.com>
4-
* @version 0.3.0
5-
* @build Fri Sep 04 2015 10:29:12 GMT+0300 (EEST)
4+
* @version 0.4.0
5+
* @build Thu Feb 09 2017 15:42:03 GMT+0300 (+03)
66
*/
77
/* @author Bilal Cinarli */
88
/** -------------------------------------------
@@ -14,6 +14,7 @@
1414
left: 0;
1515
width: 100%;
1616
height: 100%;
17+
z-index: 1;
1718
}
1819

1920
#uxr-dialog-cover {
@@ -32,9 +33,8 @@
3233
padding: 15px;
3334
border-radius: 3px;
3435
background-color: #fff;
35-
-webkit-transform: translateX(-50%) translateY(-50%);
36-
-ms-transform: translateX(-50%) translateY(-50%);
37-
transform: translateX(-50%) translateY(-50%);
36+
-ms-transform: translateX(-50%) translateY(-50%);
37+
transform: translateX(-50%) translateY(-50%);
3838
text-align: center;
3939
}
4040

‎dist/uxrocket.dialog.js

100644100755
+62-10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
defaults = {
1111
title : '',
1212
message : '',
13+
confirmText : null,
14+
cancelText : null,
15+
confirmClass : null,
16+
cancelClass : null,
17+
1318
type : 'warning',
1419
confirm : {
1520
show : true,
@@ -21,6 +26,8 @@
2126
className: 'button',
2227
text : 'Vazgeç'
2328
},
29+
30+
test : this.type,
2431
// other buttons
2532
buttons : {},
2633
// close icon
@@ -49,6 +56,7 @@
4956
}
5057
};
5158

59+
5260
var Dialog = function(el, options, selector) {
5361
this._name = rocketName;
5462
this._defaults = defaults;
@@ -80,6 +88,7 @@
8088
this.bindUIActions();
8189

8290
this.$el.addClass(utils.getClassname('ready'));
91+
8392
this.prepare();
8493

8594
this.emitEvent('ready');
@@ -101,7 +110,11 @@
101110
ux.close();
102111
}
103112

104-
ux.open(_this);
113+
if(typeof $(this).attr('href') === 'undefined' || $(this).attr('href') === '' || $(this).attr('href').charAt(0) === '#'){
114+
ux.open(_this);
115+
}else{
116+
ux.open(_this,this.href);
117+
}
105118
});
106119

107120
$body.on(events.click, '#uxr-dialog-' + _this._instance + ' .uxr-dialog-confirm-button', function(e) {
@@ -122,17 +135,22 @@
122135
});
123136
};
124137

125-
Dialog.prototype.prepare = function() {
138+
Dialog.prototype.prepare = function(content) {
126139
var html = '' +
127-
'<div id="uxr-dialog-' + this._instance + '" class="uxr-dialog uxr-dialog-' + this.options.type + ' ' + this.options.className + '">';
140+
'<div id="uxr-dialog-' + this._instance + '" class="uxr-dialog uxr-dialog-' + this.options.type + ' ' + this.options.className + '">';
141+
142+
143+
if(typeof this.options.confirm === 'string'){
144+
145+
}
128146

129147
if(this.options.blockUI === true && this.options.allowMultiple === false) {
130148
html += '\n' +
131-
'<div id="uxr-dialog-cover"></div>';
149+
'<div id="uxr-dialog-cover"></div>';
132150
}
133151

134152
html += '\n' +
135-
'<div id="uxr-dialog-content" class="note dialog-note note-' + this.options.type + '">';
153+
'<div id="uxr-dialog-content" class="note dialog-note note-' + this.options.type + '">';
136154

137155
if(this.options.title !== '') {
138156
html += '<h3 class="uxr-dialog-title note-title">' + this.options.title + '</h3>';
@@ -142,19 +160,43 @@
142160
html += '<div class="uxr-dialog-content note-content">' + this.options.message + '</div>';
143161
}
144162

163+
if(typeof this.$el.attr('href') !== 'undefined') {
164+
if(this.$el.attr('href').charAt(0) === '#'){
165+
var content = $(this.$el.attr('href')).html();
166+
167+
html += '<div class="uxr-dialog-content note-content">'+content+'</div>';
168+
}else{
169+
html += '<div class="uxr-dialog-content note-content"></div>';
170+
}
171+
172+
}
173+
145174
if(this.options.confirm.show || this.options.cancel.show || this.options.buttons.length > 0) {
175+
176+
var buttons = {
177+
confirm: {
178+
text: this.options.confirmText || this.options.confirm.text,
179+
class:this.options.confirmClass || this.options.confirm.className
180+
},
181+
cancel: {
182+
text:this.options.cancelText || this.options.cancel.text,
183+
class:this.options.cancelClass || this.options.cancel.className
184+
}
185+
};
186+
187+
146188
html += '<div class="uxr-dialog-buttons note-buttons">';
147189

148190
if(this.options.cancel.show) {
149-
html += '<a href="#" class="uxr-dialog-button uxr-dialog-cancel-button ' + this.options.cancel.className + '">' + this.options.cancel.text + '</a>';
191+
html += '<a href="#" class="uxr-dialog-button uxr-dialog-cancel-button ' + buttons.cancel.class + '">' + buttons.cancel.text+ '</a>';
150192
}
151193

152194
$.each(this.options.buttons, function(item) {
153195
html += '<a href="#" class="uxr-dialog-button ' + item.className + '">' + item.text + '</a>';
154196
});
155197

156198
if(this.options.confirm.show) {
157-
html += '<a href="#" class="uxr-dialog-button uxr-dialog-confirm-button ' + this.options.confirm.className + '">' + this.options.confirm.text + '</a>';
199+
html += '<a href="#" class="uxr-dialog-button uxr-dialog-confirm-button ' + buttons.confirm.class + '">' + buttons.confirm.text + '</a>';
158200
}
159201

160202

@@ -166,7 +208,7 @@
166208
}
167209

168210
html += ' </div>' + // end of dialog content
169-
'</div>';
211+
'</div>';
170212

171213
this.dialog = html;
172214
};
@@ -221,6 +263,13 @@
221263

222264
getClassname: function(which) {
223265
return ns.prefix + ns.name + '-' + ns.classes[which];
266+
},
267+
268+
getAjaxContent: function(url,instance){
269+
$.get(url,function(data){
270+
$(instance).find('.uxr-dialog-content').html(data);
271+
}
272+
);
224273
}
225274
};
226275

@@ -260,13 +309,16 @@
260309
}
261310
};
262311

263-
ux.open = function(dialog) {
312+
ux.open = function(dialog,href) {
264313
$('body').append(dialog.dialog);
265314
utils.callback(dialog.options.onOpen);
315+
if(href){
316+
utils.getAjaxContent(href,'#uxr-dialog-'+dialog._instance);
317+
}
266318
};
267319

268320
// version
269-
ux.version = '0.3.0';
321+
ux.version = '0.4.0';
270322

271323
// settings
272324
ux.settings = defaults;

‎dist/uxrocket.dialog.min.css

100644100755
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*! UX Rocket Dialog
22
* jQuery based Dialog plugin
33
* @author Bilal Cinarli <bcinarli@gmail.com>
4-
* @version 0.3.0
5-
* @build Fri Sep 04 2015 10:29:12 GMT+0300 (EEST)
4+
* @version 0.4.0
5+
* @build Thu Feb 09 2017 15:42:03 GMT+0300 (+03)
66
*/
77
/*! UX Rocket Dialog
88
* jQuery based Dialog plugin
99
* @author Bilal Cinarli <bcinarli@gmail.com>
10-
* @version 0.3.0
11-
* @build Fri Sep 04 2015 10:29:12 GMT+0300 (EEST)
12-
*/.uxr-dialog,#uxr-dialog-cover{top:0;left:0;width:100%;height:100%}#uxr-dialog-cover{position:absolute;z-index:1;background-color:rgba(0,0,0,0.3)}#uxr-dialog-content{position:absolute;top:50%;left:50%;z-index:2;max-width:500px;min-width:320px;padding:15px;border-radius:3px;background-color:#fff;-webkit-transform:translateX(-50%) translateY(-50%);-ms-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);text-align:center}.uxr-dialog{position:fixed}.uxr-dialog-title{margin-top:0}.uxr-dialog-content{margin-bottom:1em}.uxr-dialog-buttons{text-align:right}.uxr-dialog-button{display:inline-block;padding:8px 16px;margin-left:10px;border-radius:3px;background-color:#c6c6c6;text-decoration:none}.uxr-dialog-confirm-button{background-color:#009bdc;color:#fff}.uxr-dialog-cancel-button{background-color:#e87352;color:#fff}.uxr-dialog-close{position:absolute;top:5px;right:5px;width:20px;height:20px;border-radius:50%;background-color:#c6c6c6;color:#fff;text-decoration:none;text-align:center}.uxr-dialog-close-icon:before{content:"x";font-style:normal}
10+
* @version 0.4.0
11+
* @build Thu Feb 09 2017 15:42:03 GMT+0300 (+03)
12+
*/.uxr-dialog,#uxr-dialog-cover{top:0;left:0;width:100%;height:100%;z-index:1}#uxr-dialog-cover{position:absolute;z-index:1;background-color:rgba(0,0,0,0.3)}#uxr-dialog-content{position:absolute;top:50%;left:50%;z-index:2;max-width:500px;min-width:320px;padding:15px;border-radius:3px;background-color:#fff;-ms-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);text-align:center}.uxr-dialog{position:fixed}.uxr-dialog-title{margin-top:0}.uxr-dialog-content{margin-bottom:1em}.uxr-dialog-buttons{text-align:right}.uxr-dialog-button{display:inline-block;padding:8px 16px;margin-left:10px;border-radius:3px;background-color:#c6c6c6;text-decoration:none}.uxr-dialog-confirm-button{background-color:#009bdc;color:#fff}.uxr-dialog-cancel-button{background-color:#e87352;color:#fff}.uxr-dialog-close{position:absolute;top:5px;right:5px;width:20px;height:20px;border-radius:50%;background-color:#c6c6c6;color:#fff;text-decoration:none;text-align:center}.uxr-dialog-close-icon:before{content:"x";font-style:normal}

‎dist/uxrocket.dialog.min.js

100644100755
+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎example/index.html

100644100755
File mode changed.

‎gulpfile.js

100644100755
File mode changed.

‎lib/_uxrocket-dialog.scss

100644100755
File mode changed.

‎lib/uxrocket-dialog.scss

100644100755
File mode changed.

‎lib/uxrocket.dialog.js

100644100755
-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@
267267

268268
getAjaxContent: function(url,instance){
269269
$.get(url,function(data){
270-
console.log(instance);
271270
$(instance).find('.uxr-dialog-content').html(data);
272271
}
273272
);

‎package.json

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uxrocket.dialog",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "jQuery based Dialog plugin",
55
"main": "lib/uxrocket.dialog.js",
66
"directories": {

‎test/index.html

100644100755
File mode changed.

‎test/tests.js

100644100755
File mode changed.

0 commit comments

Comments
 (0)