Skip to content

Commit

Permalink
Added min version, modified documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rudmanmrrod committed Jul 4, 2017
1 parent ef0eedb commit 38380ad
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 22 deletions.
55 changes: 39 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link href="src/materialize/css/materialize.css" rel="stylesheet" type="text/css">
<script src="src/jquery.min.js" type="text/javascript"></script>
<script src="src/materialize/js/materialize.js" type="text/javascript"></script>
<script src="src/material-dialog.js" type="text/javascript"></script>
<script src="src/material-dialog.min.js" type="text/javascript"></script>
<style>
pre,xmp{
background-color:#f2f2f2;
Expand All @@ -22,26 +22,46 @@
<div class="container">
<h1 class="center">Materialize Dialog</h1><hr>
<p>A simple library tinked to easy Materialize JavaScript Modals</p>

<h4>This</h4>
<pre class="language-markup">

&lt;div id="modal1" class="modal"&gt;
&lt;div class="modal-content"&gt;
&lt;h4&gt;Alert&lt;/h4&gt;
&lt;p&gt;Hello&lt;/p&gt;
&lt;/div&gt;
&lt;div class="modal-footer"&gt;
&lt;a href="#!" class="btn modal-close"&gt;Close&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
</pre>
<h4>Can be simplified to </h4>
<pre>

MaterialDialog.alert("Hello");
</pre>

<h4>Installation</h4>
<p>Download the source <a href="#">here</a></p>

<p>Include materialize css and js in head, materialize.js require jQuery.</p>
<xmp>
<head>
<link href="src/materialize/css/materialize.css" rel="stylesheet" type="text/css">
<script src="src/jquery.min.js" type="text/javascript"></script>
<script src="src/materialize/js/materialize.js" type="text/javascript"></script>
<script src="src/material-dialog.js" type="text/javascript"></script>
</head>
</xmp>
<pre class="language-markup">

&lt;head&gt;
&lt;link href="src/materialize/css/materialize.css" rel="stylesheet" type="text/css"&gt;
&lt;script src="src/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="src/materialize/js/materialize.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="src/material-dialog.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>

<p>Material Dialog need jQuery and materialize.js</p>

<h4>Alert</h4>
<p>Usage Example</p>

<pre>

<pre class="language-markup">

MaterialDialog.alert(
'Message', // Alert Body (Acepts html tags)
{
Expand All @@ -58,12 +78,13 @@ <h4>Alert</h4>
}
);
</pre>

<div class="center">
<h5>Example</h5>
<button class="btn" onclick="alert_example();">Click Here</button>
</div>
<p>Options</p>
<table class="responsive-table bordered">
<table class="bordered">
<thead>
<tr>
<th>Method</th>
Expand Down Expand Up @@ -103,7 +124,8 @@ <h5>Example</h5>
</table>
<h4>Dialog</h4>
<p>Usage Example</p>
<pre>
<pre class="language-markup">

MaterialDialog.dialog(
"Text here",
{
Expand Down Expand Up @@ -136,7 +158,7 @@ <h5>Example</h5>
</div>

<p>Options</p>
<table class="responsive-table bordered">
<table class="bordered">
<thead>
<tr>
<th>Method</th>
Expand Down Expand Up @@ -191,7 +213,8 @@ <h5>Example</h5>
</table>
<h4>Extra</h4>
<p>In options part, you can pass any materialize modal property's</p>
<pre>
<pre class="language-markup">

MaterialDialog.alert(
'Message', // Alert Body (Acepts html tags)
{
Expand Down
12 changes: 6 additions & 6 deletions src/material-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ MaterialDialog.templates = {
* @param text Receive modal text body
* @param options Receive objects with options
*/
MaterialDialog.alert = function(text = '', options = {}){
MaterialDialog.alert = function(text, options){
text = typeof text !== 'undefined' ? text : '';
options = typeof options !== 'undefined' ? options : {};
var button_close = '<button class="btn modal-close button_class close">button_text</button>';
var callback = null;
var other_options = options;
Expand Down Expand Up @@ -108,7 +110,9 @@ MaterialDialog.replace_confirm_button = function(body){
* @param text Receive modal text body
* @param options Receive objects with options
*/
MaterialDialog.dialog = function(text = '', options = {}){
MaterialDialog.dialog = function(text, options){
text = typeof text !== 'undefined' ? text : '';
options = typeof options !== 'undefined' ? options : {};
var button_close = '';
var callback_close = null;
var button_confirm = '';
Expand Down Expand Up @@ -172,7 +176,3 @@ MaterialDialog.dialog = function(text = '', options = {}){
});
}
};




1 change: 1 addition & 0 deletions src/material-dialog.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 38380ad

Please sign in to comment.