Permalink
Browse files

Add support for default input text "buttonInputDefault"

  • Loading branch information...
1 parent fd2807b commit 274d5ab0f0cf702a7643ed8c682285ee8a3e17c2 @jtsage committed Jun 11, 2012
Showing with 9 additions and 1 deletion.
  1. +6 −0 demos2/options.html
  2. +2 −1 js/jquery.mobile.simpledialog2.js
  3. +1 −0 tests/2dev.html
View
@@ -216,6 +216,12 @@
<dl data-role="none" class="option"><dt>Modes:</dt><dd>button</dd></dl>
<p class="desc">Show an input box in the dialog.</p>
</li>
+ <li><h3>buttonInputDefault</h3>
+ <dl data-role="none" class="option"><dt>Type:</dt><dd>String</dd></dl>
+ <dl data-role="none" class="option"><dt>Default:</dt><dd>false</dd></dl>
+ <dl data-role="none" class="option"><dt>Modes:</dt><dd>button</dd></dl>
+ <p class="desc">Default text for the input box.</p>
+ </li>
<li><h3>buttonPassword</h3>
<dl data-role="none" class="option"><dt>Type:</dt><dd>Boolean</dd></dl>
<dl data-role="none" class="option"><dt>Default:</dt><dd>false</dd></dl>
@@ -24,6 +24,7 @@
headerClose: false,
buttonPrompt: false,
buttonInput: false,
+ buttonInputDefault: false,
buttonPassword: false,
blankContent: false,
@@ -125,7 +126,7 @@
var self = this,
o = self.options,
buttonHTML = $('<div></div>'),
- pickerInput = $("<div class='ui-simpledialog-controls'><input class='ui-simpledialog-input ui-input-text ui-shadow-inset ui-corner-all ui-body-"+o.themeInput+"' type='"+((o.buttonPassword===true)?"password":"text")+"' name='pickin' /></div>"),
+ pickerInput = $("<div class='ui-simpledialog-controls'><input class='ui-simpledialog-input ui-input-text ui-shadow-inset ui-corner-all ui-body-"+o.themeInput+"' type='"+((o.buttonPassword===true)?"password":"text")+"' value='"+((o.buttonInputDefault!==false)?o.buttonInputDefault.replace( '"', "&#34;" ).replace( "'", "&#39;" ):"")+"' name='pickin' /></div>"),
pickerChoice = $("<div>", { "class":'ui-simpledialog-controls' });
View
@@ -53,6 +53,7 @@ <h1 id="jqm-logo"><img src="/jQM-SimpleDialog/demos/jquery-logo-sd.png" alt="jQu
headerClose: true,
buttonInput: true,
+ buttonInputDefault: "blah'\"blah",
//buttonPassword: true,
buttonPrompt : "Some Other Bullshit",

0 comments on commit 274d5ab

Please sign in to comment.