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
*/
const VERSION = '0.211';
const VERSION = '0.212';
const API_VERSION = '2013-04-16';
const MIN_DEDIVERSION = '2017-05-03_21_00';
const SCRIPT_TIMEOUT = 40;

View File

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

View File

@ -13,6 +13,7 @@ use FML\Types\ScriptFeatureable;
/**
* CheckBox Component
*
* @uses Quad
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @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)
{
$this->name = (string)$name;
$this->getEntry()
->setName($this->name);
return $this;
}
@ -222,7 +221,6 @@ class CheckBox implements Renderable, ScriptFeatureable
*
* @param Entry $entry Hidden Entry
* @return static
* @deprecated
*/
public function setEntry(Entry $entry)
{
@ -238,11 +236,9 @@ class CheckBox implements Renderable, ScriptFeatureable
protected function createEntry()
{
$entry = new Entry();
$entry->setVisible(false);
if ($this->name) {
$entry->setName($this->name);
}
$this->feature->setEntry($entry);
$entry->setVisible(false)
->setName($this->name);
$this->setEntry($entry);
return $entry;
}
@ -251,7 +247,7 @@ class CheckBox implements Renderable, ScriptFeatureable
*/
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
*
* @uses Entry
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @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
*/
protected $actionKey = null;
protected $actionKey = -1;
/**
* @var string $url Url
@ -651,7 +651,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
if ($this->action) {
$domElement->setAttribute("action", $this->action);
}
if ($this->actionKey) {
if ($this->actionKey >= 0) {
$domElement->setAttribute("actionkey", $this->actionKey);
}
if ($this->url) {

View File

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

View File

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

View File

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

View File

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