Compare commits

..

No commits in common. "master" and "1.1.4" have entirely different histories.

17 changed files with 1867 additions and 1937 deletions

View File

@ -10,4 +10,4 @@ docs.helpers=${docs.themedir}/path.js
git=git
git.docs=gh-pages
git.master=master
version=1.1.5
version=1.1.4

View File

@ -1,48 +1,32 @@
{
"name": "mibew/html5",
"name": "canteen/html5",
"description" : "Create dynamic, valid HTML5 markup with a simple an intuitive PHP API",
"version" : "1.1.5",
"version" : "1.1.4",
"type": "library",
"keywords": [
"html5",
"markup",
"document",
"html",
"tags"
],
"keywords": ["html5", "markup", "document", "html", "tags"],
"license": "MIT",
"homepage" : "http://github.com/Mibew/CanteenHTML5",
"time": "2021-07-09",
"homepage" : "http://github.com/Canteen/CanteenHTML5",
"time": "2014-10-31",
"authors": [
{
"name": "Matt Karl",
"email": "matt@mattkarl.com",
"homepage": "http://github.com/bigtimebuddy"
},
{
"name": "Mibew Messenger project",
"homepage": "https://mibew.org/"
"homepage": "http://github.com/bigtimebuddy",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Canteen\\HTML5\\": "src/"
},
"files": [
"src/HTML5.php"
]
"psr-4": {"Canteen\\HTML5\\": "src/"},
"files": ["src/HTML5.php"]
},
"require": {
"php": ">=5.3.0"
},
"replace": {
"canteen/html5": "~1.1.4"
},
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Mibew/CanteenHTML5"
"url": "https://github.com/Canteen/CanteenHTML5"
}
]
}

View File

@ -53,3 +53,5 @@
// Output the result formatted nice with indents
echo $doc;
?>

View File

@ -135,14 +135,10 @@ namespace Canteen\HTML5
public function __get($name)
{
if (method_exists($this , $method =('get' . ucfirst($name))))
{
return $this->$method();
}
else
{
throw new HTML5Error(HTML5Error::INVALID_GETTER, $name);
}
}
/**
* General purpose setter for setting attribute->name and attribute->value
@ -153,14 +149,10 @@ namespace Canteen\HTML5
public function __set($name, $value)
{
if (method_exists($this , $method =('set' . ucfirst($name))))
{
return $this->$method($value);
}
else
{
throw new HTML5Error(HTML5Error::INVALID_SETTER, $name);
}
}
/**
* See if a property exists
@ -174,3 +166,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -34,3 +34,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -86,9 +86,7 @@ namespace Canteen\HTML5
{
$result = $this->docType . parent::__toString();
if ($this->beautify)
{
$result = self::beautify($result);
}
return $result;
}
@ -115,3 +113,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -39,3 +39,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -22,10 +22,7 @@ namespace Canteen\HTML5
spl_autoload_register(function($name)
{
// Ignore class names not in the HTML5 namespace
if (!preg_match('/^Canteen\\\HTML5\\\/', $name))
{
return;
}
if (!preg_match('/^Canteen\\\HTML5\\\/', $name)) return;
// Remove the HTML5 namespace
$name = preg_replace('/^Canteen\\\HTML5\\\/', '', $name);
@ -163,9 +160,7 @@ namespace Canteen\HTML5
$node->id = substr($selector, 1);
break;
case '.' :
if ($node->class) {
$node->class .= ' ';
}
if ($node->class) $node->class .= ' ';
$node->class .= substr($selector, 1);
break;
}

View File

@ -140,3 +140,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -12,12 +12,11 @@ namespace Canteen\HTML5
* echo html('br');
*
* @class Node
* @extends Proto
* @constructor
* @param {String} [tag=null] The name of the tag
* @param {Array|String} [attributes=null] The collection of tag attributes
*/
class Node extends Proto
class Node
{
/**
* The string name of the tag
@ -139,13 +138,9 @@ namespace Canteen\HTML5
if ($attribute->name === $name)
{
if (!$this->isEmpty($value))
{
$attribute->value = $value;
}
else
{
unset($this->_attributes[$i]);
}
return $this;
}
}
@ -341,3 +336,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -233,3 +233,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -1,37 +0,0 @@
<?php
/**
* @module Canteen\HTML5
*/
namespace Canteen\HTML5
{
/**
* Prototype class for all Canteen\HTML5 entities
*
* @class Proto
* @constructor
* @param {String} text the plain text string
*/
class Proto
{
/**
* General purpose getter to get attribute values
* @method __get
* @param {String} name The name of the property to set
*/
public function __get($name)
{
return null;
}
/**
* See if a property exists
* @method __isset
* @param {String} name The name of the attribute
*/
public function __isset($name)
{
return null;
}
}
}

View File

@ -68,3 +68,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -58,9 +58,7 @@ namespace Canteen\HTML5
'target'
),
'bdo' => array(),
'blockquote' => array(
'cite'
),
'blockquote' => array('cite'),
'body' => array(),
'br' => array(),
'button' => array(
@ -84,9 +82,7 @@ namespace Canteen\HTML5
'cite' => array(),
'code' => array(),
'col' => null,
'colgroup' => array(
'span'
),
'colgroup' => array('span'),
'command' => array(
'checked',
'disabled',
@ -141,9 +137,7 @@ namespace Canteen\HTML5
'header' => array(),
'hgroup' => array(),
'hr' => array(),
'html' => array(
'manifest'
),
'html' => array('manifest'),
'img' => array(
'alt',
'crossorigin',
@ -213,9 +207,7 @@ namespace Canteen\HTML5
'sizes',
'type'
),
'map' => array(
'name'
),
'map' => array('name'),
'mark' => array(),
'menu' => array(),
'meta' => array(
@ -274,9 +266,7 @@ namespace Canteen\HTML5
'max',
'value'
),
'q' => array(
'cite'
),
'q' => array('cite'),
'rp' => array(),
'rt' => array(),
'ruby' => array(),
@ -300,22 +290,18 @@ namespace Canteen\HTML5
'size'
),
'small' => array(),
'source' => array(
'media',
'source' => array('media',
'src',
'type'
),
'span' => array(),
'strong' => array(),
'style' => array(
'media',
'style' => array('media',
'scoped',
'type'
),
'sub' => array(),
'table' => array(
'border'
),
'table' => array('border'),
'tbody' => array(),
'td' => array(
'colspan',
@ -343,9 +329,7 @@ namespace Canteen\HTML5
'scope'
),
'thead' => array(),
'time' => array(
'datetime'
),
'time' => array('datetime'),
'title' => array(),
'tr' => array(),
'track' => array(

View File

@ -72,10 +72,7 @@ namespace Canteen\HTML5
}
foreach($d as $name=>$value)
{
if ($name == $checkbox)
{
continue;
}
if ($name == $checkbox) continue;
$td = html('td', $value, 'class='.$name);
$row->addChild($td);
}
@ -85,3 +82,5 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -35,3 +35,5 @@ namespace Canteen\HTML5
}
}
}
?>