@ 2015-05-04T16:02:11Z <?PHP
/*
LookingGlass dgs-bootstraphtml.php
*/
define('dgs_void_tags', '<area><base><br><col><command><embed><hr><img><input><link><meta><param><source>');
define('dgs_CG_OPEN', '<div class="control-group">');
define('dgs_CG_CLOSE', '</div>');
define('dgs_HELP_OPEN', '<p class="help-block">');
define('dgs_HELP_CLOSE', '</p>');
$dgs_regNames = array();
function dgs_isVoidTag( $tagName ) {
return (stripos(dgs_void_tags,'<'.$element.'>')!==false);
}
function dgs_nextRegNameID( $regName ) {
global $dgs_regNames;
if(isset($dgs_regNames[$regName])) {
$dgs_regNames[$regName]++;
} else {
$dgs_regNames[$regName] = 0;
}
return $regName.$dgs_regNames[$regName];
}
function dgs_attributes($OPTIONS) {
$out = '';
foreach($OPTIONS as $parm => $val) {
if(($parm[0]!='_')&&(strtolower($parm)!='class')&&(!empty($val))) $out .= ' '.$parm.'="'.$val.'"';
}
return $out;
}
function dgs_element($type, $text, $OPTIONS=array(), $print=true) {
// create an element
// $OPTIONS = array of option settings {including but not limited to:}
// '_style' => {blank} | primary | success | info | warning | danger | inverse | link (string)
// '_size' => large | {blank} | small | mini (string)
// '_disabled' => true | false (boolean)
// '_element' => a | button | input (string)
// 'href' => {target URL} | #
// 'type' => {blank} | button | input | submit
// 'name' => {element name}
// 'id' => {element id}
// 'value' => {element value}
if ($text) {
$o = $OPTIONS;
if(!isset($o['_element'])) return false;
$element = strtolower($o['_element']);
$class = (($type!='icon')?$type:'');
$class .= ((!empty($o['_style']))?" $type-".$o['_style']:'');
$class .= ((!empty($o['_size']))?" $type-".$o['_size']:'');
$class .= (($o['_disabled']==true)?' disabled':'');
$class .= ((isset($o['class']))?' '.$o['class']:'');
$class = trim($class);
if($o['_disabled']==true)$o['disabled']='disabled';
$attr = dgs_attributes($o);
$out = vsprintf('<%1$s class="%2$s"%3$s>%4$s'.((!dgs_isVoidTag($element))?'</%1$s>':''), array(
$element,
$class,
$attr,
$text,
));
if(!empty($o['_help'])) $out.=dgs_HELP_OPEN.$o['_help'].dgs_HELP_CLOSE;
if ($print==true) {
echo $out;
return true;
} else {
return $out;
}
} else {
return false;
}
}
function dgs_button($text, $OPTIONS=array(), $print=true) {
// create a button
// $OPTIONS = array of option settings {including but not limited to:}
// '_style' => {blank} | primary | info | success | warning | danger | inverse | link
// '_size' => large | {blank} | small | mini
$o = array(
'_element' => 'button',
'type' => (empty($OPTIONS['type'])?'button':$OPTIONS['type']),
);
return dgs_element('btn', $text, array_merge($OPTIONS, $o), $print);
}
function dgs_buttonA($text, $OPTIONS=array(), $print=true) {
// create a button
// $OPTIONS = array of option settings {including but not limited to:}
// '_style' => {blank} | primary | info | success | warning | danger | inverse | link
// '_size' => large | {blank} | small | mini
$o = array(
'_element' => 'a',
'href' => (empty($OPTIONS['href'])?'#':$OPTIONS['href']),
);
return dgs_element('btn', $text, array_merge($OPTIONS, $o), $print);
}
function dgs_buttonI($text, $OPTIONS=array(), $print=true) {
// create a button
// $OPTIONS = array of option settings {including but not limited to:}
// '_style' => {blank} | primary | info | success | warning | danger | inverse | link
// '_size' => large | {blank} | small | mini
$o = array(
'_element' => 'input',
'type' => (empty($OPTIONS['type'])?'button':$OPTIONS['type']),
'value' => (empty($OPTIONS['value'])?((!empty($text))?$text:'Submit'):$OPTIONS['value']),
);
return dgs_element('btn', '', array_merge($OPTIONS, $o), $print);
}
function dgs_checkbox($name, $label, $value="1", $checked=false, $OPTIONS=array(), $print=true) {
// create a checkbox input
// wrapped in CLASS GROUP unless _inline option is true.
// $OPTIONS = array of option settings {including but not limited to:}
// _inline = false | true (boolean)
// _disabled = false | true (boolean)
// _help = {help block text, shown after element}
// id = {automatically assigned if left blank}
if(empty($name)) return false;
$o = array(
'checked' => (($checked)?'checked':''),
'value' => $value,
'id' => ((empty($OPTIONS['id']))?dgs_nextRegNameID($name):$OPTIONS['id']),
'_element' => 'input',
'type' => 'checkbox',
'name' => $name,
'class' => '',
'_help' => '',
);
$class = "checkbox".((!empty($OPTIONS['class']))?' '.$OPTIONS['class']:'').((!empty($OPTIONS['_inline'])&&($OPTIONS['_inline']==true)?' inline':'');
$out = '<label class="'.$class.'">'.dgs_element('','', array_merge($OPTIONS, $o), false).'</label>';
if(!empty($OPTIONS['_help'])) $out.=dgs_HELP_OPEN.$OPTIONS['_help'].dgs_HELP_CLOSE;
if ((!empty($OPTIONS['_inline']))&&($OPTIONS['_inline']!=true)) $out = dgs_CG_OPEN.$out.dgs_CG_CLOSE;
if ($print) {
echo $out;
return true;
}
return $out;
}
function dgs_alert($text, $OPTIONS=array(), $print=true) {
// create a dismissable alert box
// $OPTIONS = array of option settings {including but not limited to:}
// '_style' => {blank} | "error" | "success" | "info"
$o = $OPTIONS;
$o['_size'] = ((strlen($text) > 80)?'block':'');
$o['_element'] = 'div';
$b = array(
'_element' => 'button',
'type' => 'button',
'data-dismiss' => 'alert'
);
$btn = dgs_element('close', '×', $b, false);
return dgs_element('alert', $btn.$text, $o, $print );
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.6.8 0.007 0.060 20.44 5.5.24 0.033 0.077 20.29 5.4.40 0.083 0.073 18.68 5.4.39 0.073 0.073 18.62 5.4.38 0.093 0.063 18.84 5.4.37 0.093 0.070 18.51 5.4.36 0.087 0.063 18.61 5.4.35 0.133 0.063 18.79 5.4.34 0.103 0.070 18.79 5.4.32 0.133 0.060 18.50 5.4.31 0.117 0.057 18.61 5.4.30 0.103 0.057 18.74 5.4.29 0.113 0.053 18.80 5.4.28 0.117 0.060 18.63 5.4.27 0.117 0.047 18.56 5.4.26 0.070 0.060 18.76 5.4.25 0.087 0.070 18.61 5.4.24 0.120 0.057 18.84 5.4.23 0.090 0.053 18.59 5.4.22 0.080 0.063 18.62 5.4.21 0.090 0.060 18.61 5.4.20 0.080 0.060 16.63 5.4.19 0.080 0.060 18.71 5.4.18 0.123 0.063 18.75 5.4.17 0.147 0.050 18.79 5.4.16 0.087 0.067 18.61 5.4.15 0.097 0.057 18.57 5.4.14 0.107 0.040 16.30 5.4.13 0.087 0.067 16.27 5.4.12 0.117 0.060 16.32 5.4.11 0.103 0.063 16.36 5.4.10 0.107 0.060 16.46 5.4.9 0.107 0.067 16.21 5.4.8 0.093 0.053 16.32 5.4.7 0.053 0.063 16.15 5.4.6 0.077 0.063 16.17 5.4.5 0.103 0.050 16.27 5.4.4 0.077 0.053 16.33 5.4.3 0.087 0.053 16.20 5.4.2 0.073 0.057 16.21 5.4.1 0.063 0.067 16.29 5.4.0 0.063 0.053 15.77 5.3.29 0.087 0.053 14.73 5.3.28 0.117 0.053 14.64 5.3.27 0.090 0.060 14.69 5.3.26 0.090 0.073 14.68 5.3.25 0.090 0.060 14.83 5.3.24 0.093 0.070 14.70 5.3.23 0.083 0.057 14.86 5.3.22 0.100 0.067 14.66 5.3.21 0.063 0.073 14.61 5.3.20 0.097 0.067 14.76 5.3.19 0.020 0.047 14.67 5.3.18 0.077 0.060 14.75 5.3.17 0.097 0.050 14.83 5.3.16 0.090 0.060 14.83 5.3.15 0.077 0.063 14.68 5.3.14 0.093 0.050 14.59 5.3.13 0.080 0.057 14.76 5.3.12 0.090 0.057 14.61 5.3.11 0.080 0.070 14.81 5.3.10 0.080 0.057 14.10 5.3.9 0.083 0.063 14.16 5.3.8 0.100 0.053 14.10 5.3.7 0.090 0.053 14.09 5.3.6 0.097 0.063 14.10 5.3.5 0.097 0.067 14.01 5.3.4 0.117 0.063 14.07 5.3.3 0.107 0.047 14.03 5.3.2 0.093 0.053 13.84 5.3.1 0.103 0.067 13.82 5.3.0 0.093 0.050 13.70 5.2.17 0.110 0.040 11.30 5.2.16 0.090 0.037 11.30 5.2.15 0.093 0.053 11.24 5.2.14 0.100 0.037 11.19 5.2.13 0.140 0.053 11.21 5.2.12 0.087 0.040 11.20 5.2.11 0.057 0.047 11.25 5.2.10 0.010 0.043 11.19 5.2.9 0.030 0.050 11.38 5.2.8 0.073 0.070 11.22 5.2.7 0.087 0.050 11.25 5.2.6 0.077 0.050 11.33 5.2.5 0.103 0.043 11.18 5.2.4 0.090 0.033 11.18 5.2.3 0.050 0.043 11.06 5.2.2 0.073 0.037 11.03 5.2.1 0.083 0.043 10.97 5.2.0 0.067 0.037 10.82 5.1.6 0.060 0.033 10.04 5.1.5 0.057 0.043 10.09 5.1.4 0.047 0.040 10.07 5.1.3 0.083 0.037 10.57 5.1.2 0.070 0.030 10.53 5.1.1 0.060 0.040 10.26 5.1.0 0.067 0.043 10.16 5.0.5 0.033 0.047 8.74 5.0.4 0.040 0.030 8.53 5.0.3 0.017 0.037 8.42 5.0.2 0.003 0.040 8.31 5.0.1 0.040 0.020 8.29 5.0.0 0.030 0.053 8.34 4.4.9 0.033 0.027 5.97 4.4.8 0.017 0.030 5.99 4.4.7 0.037 0.023 5.96 4.4.6 0.037 0.017 5.98 4.4.5 0.023 0.023 6.02 4.4.4 0.040 0.037 5.96 4.4.3 0.027 0.020 5.98 4.4.2 0.043 0.027 6.14 4.4.1 0.023 0.023 6.00 4.4.0 0.030 0.033 6.00 4.3.11 0.023 0.023 5.94 4.3.10 0.027 0.023 5.90 4.3.9 0.033 0.027 6.00 4.3.8 0.030 0.040 5.91 4.3.7 0.040 0.030 5.90 4.3.6 0.030 0.030 6.00 4.3.5 0.033 0.030 5.98 4.3.4 0.037 0.037 5.86 4.3.3 0.017 0.030 4.64 4.3.2 0.020 0.027 4.74 4.3.1 0.007 0.030 4.70 4.3.0 0.013 0.020 6.80
preferences:dark mode live preview
137.16 ms | 941 KiB | 8 Q