This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var box = bootbox.alert("This dialog will disappear in three seconds."); | |
setTimeout(function() { | |
// be careful not to call box.hide() here, which will invoke jQuery's hide method | |
box.modal('hide'); | |
}, 3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("form :input").each(function(index, elem) { | |
var eId = $(elem).attr("id"); | |
var label = null; | |
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) { | |
$(elem).attr("placeholder", $(label).html()); | |
$(label).remove(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// assume $text is our article's full content | |
$text = preg_replace_callback("@\[gist id=(\d+)\]@s", function($matches) { | |
// we know that the match at offset 1 will be our target gist ID | |
$id = $matches[1]; | |
// Go fetch the raw JS from GitHub... | |
// @todo - you'd want to handle errors here! | |
$js = file_get_contents("https://gist.github.com/".$id.".js"); | |
// get rid of any superfluous whitespace off either end of the string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootbox.alert("Hello"); | |
bootbox.confirm("Can you take it?"); | |
bootbox.alert("Boo!"); | |
setTimeout(function() { | |
// that's enough of that | |
bootbox.hideAll(); | |
}, 3000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* alert | |
*/ | |
bootbox.alert("Hello world"); | |
bootbox.alert("Hello world", function() { | |
console.log("dialog dismissed with OK or escape button"); | |
}); | |
bootbox.alert({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- set up the modal to start hidden and fade in and out --> | |
<div id="myModal" class="modal fade"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<!-- dialog body --> | |
<div class="modal-body"> | |
<button type="button" class="close" data-dismiss="modal">×</button> | |
Hello world! | |
</div> | |
<!-- dialog buttons --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootbox.setDefaults({ | |
/** | |
* @optional String | |
* @default: en | |
* which locale settings to use to translate the three | |
* standard button labels: OK, CONFIRM, CANCEL | |
*/ | |
locale: "fr", | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootbox.dialog({ | |
/** | |
* @required String|Element | |
*/ | |
message: "I am a custom dialog", | |
/** | |
* @optional String|Element | |
* adds a header to the dialog and places this text in an h4 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{if !$_pjax} | |
{* everything as normal *} | |
<html> | |
<head> | |
<title>{block name="title"}{/block}</title> | |
</head> | |
<body> | |
<!-- header --> | |
<!-- nav etc --> |
NewerOlder