Page 1 of 1

[Manialink] Version 2

Posted: 16 Oct 2014, 22:24
by noyranea
Hi everyone,

at long last, I can share the changes we made to the Manialink language !

First of all, Manialinks beginning with the version="1" attribute aren't changed at all. If they are, you found a bug and are welcome to report it. The following information apply to version="2" Manialinks.
  • You can now use stylesheets : you just have to add the <stylesheet> </stylesheet> tags to your manialink. Within those tags, you can add styles like

    Code: Select all

    <style id="myid1 myid2" class="myclass1 myclass2" style="mystyle" posn="20 20" sizen="30 30" />
    And every manialink control having the id myid1, myid2 or the class myclass1 or myclass2 will receive the style, posn and sizen attributes you set in the style if they have not already those attributes

    Good to know :
    - if different styles apply to the same id / to the same class, only the last declared one will be applied
    - if a control can receive attributes from both and id-linked style and a class-linked style, only the id-linked style ones will be applied

    A sample manialink using stylesheet has been added (as well as a sample titlepack menu). You can load them using the Interface Designer. They're placed in file://Media/Manialinks/Common/Samples/
  • The format tag has been removed from the language, since it's no longer useful with stylesheets.
  • New "textedit" tag, in order to replace multiple lines entries. This control looks like the script editor. For more information about it's attributes, you can add one in the Interface Designer and see what happens.
  • Entries can now use only one line : autonewline and maxline attributes have been removed. A "selecttext" attribute has been added : if you set it to "1", the text of the entry will be automatically selected when it's focused. A "textformat" attribute has been added as well, allowing you to set the text as a password for instance.
  • Data attributes have been added. In any tag, you can add attributes beginning with "data-".

    Code: Select all

    <quad id="myquad" data-foo="bar" data-link="url" />
    They will be available in the script by using the "DataAttributeExists", "DataAttributeGet" and "DataAttributeSet" functions.

    Code: Select all

     Quad.DataAttributeExists("foo"); //returns True
    Quad.DataAttributeGet("foo"); //returns "bar"
    Quad.DataAttributeSet("foo", "bob");
    Quad.DataAttributeGet("foo"); //returns "bob"
    
That's all ;) Changes have been made to the Interface Designer as well. I'll make a post about it later on.

Have a nice evening,

-- noyranea

Re: [Manialink] Version 2

Posted: 16 Oct 2014, 22:44
by Chris92
Thanks a bunch for this informing post!
Stylesheets make things so much easier if you have a lot elements that have the same style :yes: - really great addition!

Re: [Manialink] Version 2

Posted: 16 Oct 2014, 22:49
by djhubertus
:1010

Re: [Manialink] Version 2

Posted: 16 Oct 2014, 23:58
by spaii
:thumbsup:

Re: [Manialink] Version 2

Posted: 17 Oct 2014, 10:58
by novationx
impressive :thumbsup:
Now I can use my html & css skills :p

Re: [Manialink] Version 2

Posted: 17 Oct 2014, 13:53
by Dommy
Would be cool to have more attributes like author="" and <desc> like meta info in html :)

Re: [Manialink] Version 2

Posted: 20 Oct 2014, 10:36
by noyranea
Hello !

One of you made a quite relevant remark on the update a few days ago : you cannot access some of the new attributes from the script.

It has been corrected and after the next update, you'll be able to access and set :
  • Entry attribute TextFormat (ETextFormat:: basic, password, newpassword)
  • TextEdit (CMlTextEdit) attribute TextFormat (ETextFormat:: basic, script, password, newpassword)
  • TextEdit attributes ShowLineNumbers (Bool), AutoNewLine (Bool) and MaxLine (Integer)
@domino54 : your request has been noted, but I can't say when it'll be done.

Thanks for waiting,

-- noyranea

Re: [Manialink] Version 2

Posted: 30 Oct 2014, 21:01
by spaii
Hi all,

today i converted some manialinks to version 2 and added data attributes in some.
All seems to work nice :thumbsup:

I've got a suggestion concerning data attributes :
Could be nice to have GetDataAttribute and SetDataAttribute in place of DataAttributeGet and DataAttributeSet to correspond with other functions name ;)

Re: [Manialink] Version 2

Posted: 22 Nov 2014, 19:08
by Nerpson
It seems that the background attribute does not work well in version 2. :?

Re: [Manialink] Version 2

Posted: 25 Nov 2014, 09:25
by noyranea
Hello everyone !

Some answers :
  • @Spai : the functions are named DataAttributeGet/Set/Has so they can be found on consecutive lines in the script documentation
  • @Nerpson : the background attribute for manialink didn't work very well in version 1 either. We know we have to make it work, but since it's not absolutely necessary, it has not been fixed yet.
Have a nice day,

-- noyranea