reverted FML update

This commit is contained in:
Jocy 2017-05-12 20:04:50 +02:00
parent e816961d28
commit 640d285c78
9 changed files with 18 additions and 28 deletions

View File

@ -52,7 +52,7 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
/* /*
* Constants * Constants
*/ */
const VERSION = '0.211'; const VERSION = '0.212';
const API_VERSION = '2013-04-16'; const API_VERSION = '2013-04-16';
const MIN_DEDIVERSION = '2017-05-03_21_00'; const MIN_DEDIVERSION = '2017-05-03_21_00';
const SCRIPT_TIMEOUT = 40; const SCRIPT_TIMEOUT = 40;

View File

@ -146,14 +146,14 @@ class SidebarMenuManager implements UsageInformationAble, CallbackListener {
public function deleteMenuEntry(SidebarMenuEntryRenderable $render, $id, $unregisterClass = false) { public function deleteMenuEntry(SidebarMenuEntryRenderable $render, $id, $unregisterClass = false) {
foreach ($this->menuEntries as $k => $entry) { foreach ($this->menuEntries as $k => $entry) {
if ($entry == $id) { if ($entry == $id) {
array_splice($this->menuEntries, $k, 1); unset($this->menuEntries[$k]);
$this->yPositions = array(); $this->yPositions = array();
} }
} }
foreach ($this->registeredClasses as $k => $class) { foreach ($this->registeredClasses as $k => $class) {
if ($class == $render && $unregisterClass) { if ($class == $render && $unregisterClass) {
array_splice($this->registeredClasses, $k, 1); unset($this->registeredClasses[$k]);
}else{ }else{
$class->renderMenuEntry(); $class->renderMenuEntry();
} }

View File

@ -13,6 +13,7 @@ use FML\Types\ScriptFeatureable;
/** /**
* CheckBox Component * CheckBox Component
* *
* @uses Quad
* @author steeffeen <mail@steeffeen.com> * @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder * @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
@ -73,8 +74,6 @@ class CheckBox implements Renderable, ScriptFeatureable
public function setName($name) public function setName($name)
{ {
$this->name = (string)$name; $this->name = (string)$name;
$this->getEntry()
->setName($this->name);
return $this; return $this;
} }
@ -222,7 +221,6 @@ class CheckBox implements Renderable, ScriptFeatureable
* *
* @param Entry $entry Hidden Entry * @param Entry $entry Hidden Entry
* @return static * @return static
* @deprecated
*/ */
public function setEntry(Entry $entry) public function setEntry(Entry $entry)
{ {
@ -238,11 +236,9 @@ class CheckBox implements Renderable, ScriptFeatureable
protected function createEntry() protected function createEntry()
{ {
$entry = new Entry(); $entry = new Entry();
$entry->setVisible(false); $entry->setVisible(false)
if ($this->name) { ->setName($this->name);
$entry->setName($this->name); $this->setEntry($entry);
}
$this->feature->setEntry($entry);
return $entry; return $entry;
} }
@ -251,7 +247,7 @@ class CheckBox implements Renderable, ScriptFeatureable
*/ */
public function getScriptFeatures() public function getScriptFeatures()
{ {
return ScriptFeature::collect($this->feature, $this->getQuad(), $this->getEntry()); return ScriptFeature::collect($this->feature, $this->getQuad(), $this->feature->getEntry());
} }
/** /**

View File

@ -13,6 +13,7 @@ use FML\Types\ScriptFeatureable;
/** /**
* ValuePicker Component * ValuePicker Component
* *
* @uses Entry
* @author steeffeen <mail@steeffeen.com> * @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder * @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3

View File

@ -65,7 +65,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
/** /**
* @var int $actionKey Action key * @var int $actionKey Action key
*/ */
protected $actionKey = null; protected $actionKey = -1;
/** /**
* @var string $url Url * @var string $url Url
@ -651,7 +651,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
if ($this->action) { if ($this->action) {
$domElement->setAttribute("action", $this->action); $domElement->setAttribute("action", $this->action);
} }
if ($this->actionKey) { if ($this->actionKey >= 0) {
$domElement->setAttribute("actionkey", $this->actionKey); $domElement->setAttribute("actionkey", $this->actionKey);
} }
if ($this->url) { if ($this->url) {

View File

@ -98,7 +98,7 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab
/** /**
* @var int $actionKey Action key * @var int $actionKey Action key
*/ */
protected $actionKey = null; protected $actionKey = -1;
/** /**
* @var string $url Link url * @var string $url Link url
@ -676,8 +676,6 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab
* @api * @api
* @param CheckBoxDesign $checkBoxDesign CheckBox Design * @param CheckBoxDesign $checkBoxDesign CheckBox Design
* @return static * @return static
* @deprecated Use CheckBoxDesign::applyToQuad()
* @see CheckBoxDesign::applyToQuad()
*/ */
public function applyCheckBoxDesign(CheckBoxDesign $checkBoxDesign) public function applyCheckBoxDesign(CheckBoxDesign $checkBoxDesign)
{ {

View File

@ -146,7 +146,7 @@ abstract class Builder
* @param bool $associative (optional) Whether the array should be associative * @param bool $associative (optional) Whether the array should be associative
* @return string * @return string
*/ */
public static function getArray(array $array, $associative = true) public static function getArray(array $array, $associative = false)
{ {
$arrayText = "["; $arrayText = "[";
$index = 0; $index = 0;
@ -180,9 +180,6 @@ abstract class Builder
if (is_bool($value)) { if (is_bool($value)) {
return static::getBoolean($value); return static::getBoolean($value);
} }
if (is_array($value)) {
return static::getArray($value);
}
return $value; return $value;
} }

View File

@ -265,14 +265,14 @@ class Script
*/ */
protected function getHeaderComment() protected function getHeaderComment()
{ {
$headerComment = '/************************************************** $headerComment = '/****************************************************
* FancyManiaLinks'; * FancyManiaLinks';
if (defined('FML_VERSION')) { if (defined('FML_VERSION')) {
$headerComment .= ' v' . FML_VERSION; $headerComment .= ' v' . FML_VERSION;
} }
$headerComment .= ' by steeffeen * $headerComment .= ' by steeffeen *
* http://github.com/steeffeen/FancyManiaLinks * * http://github.com/steeffeen/FancyManiaLinks *
**************************************************/ ****************************************************/
'; ';
return $headerComment; return $headerComment;
@ -349,7 +349,6 @@ main() {
} }
case CMlEvent::Type::MouseClick: { case CMlEvent::Type::MouseClick: {
+++' . ScriptLabel::MOUSECLICK . '+++ +++' . ScriptLabel::MOUSECLICK . '+++
+++' . ScriptLabel::MOUSECLICK2 . '+++
} }
case CMlEvent::Type::MouseOut: { case CMlEvent::Type::MouseOut: {
+++' . ScriptLabel::MOUSEOUT . '+++ +++' . ScriptLabel::MOUSEOUT . '+++

View File

@ -21,7 +21,6 @@ class ScriptLabel
const ENTRYSUBMIT = 'FML_EntrySubmit'; const ENTRYSUBMIT = 'FML_EntrySubmit';
const KEYPRESS = 'FML_KeyPress'; const KEYPRESS = 'FML_KeyPress';
const MOUSECLICK = 'FML_MouseClick'; const MOUSECLICK = 'FML_MouseClick';
const MOUSECLICK2 = 'FML_MouseClick2';
const MOUSEOUT = 'FML_MouseOut'; const MOUSEOUT = 'FML_MouseOut';
const MOUSEOVER = 'FML_MouseOver'; const MOUSEOVER = 'FML_MouseOver';