Code - Custom Function

webviewer_button ( content; textCol; bgCol )

BrianDunning.com, Brian Dunning http://www.briandunning.com/filemaker-custom-functions/list.php


webviewer_button ( content; textCol; bgCol )
Rate this function: Average rating: 4.0 (1 vote) Discuss this Custom FunctionNicolas Bourré, Évaluation Mauricie
http://www.evaluationmauricie.com
This function returns an HTML content formatted for a webview.
==================== SAMPLE INPUT AND OUTPUT ====================
INPUT
webviewer_button ("Test"; "#000000"; "RGB(0,0,0)")
OUTPUT
"data:text/html,¶
.s {
color: #000000;
font-family : \"Arial\";
font-size : 75%;
}
body
{
background-color: rgb(0,0,0);
margin : 0px 0px 0px 0px;
border : 0;
}
¶
¶Test¶
¶
"
==================== DESCRIPTION ====================
This function returns an HTML content formatted for a webview. I use it to create simple buttons with calculated content. This function can also be use to display calculation on a layout such as a current record index display.
==================== CUSTOM FUNCTION ====================

/*

Name :

webviewer_button

Description :

This function returns an HTML content formatted for a webview. I use it to create simple buttons with calculated content. This function can also be use to display calculation on a layout such as a current record index display.



Syntax :

webviewer_button (content; textCol; bgCol)



Parameters :

content <-- Content to display. Eg : Text

textCol <-- Text colour in CSS format. Eg : #ffeedd, abcdef or rgb(255,234,123);

bgCol <-- Background colour. See textCol examples.



Constraints :

Usefull only for a webviewer content.



Examples :

webviewer_button ("Test"; "#000000"; "RGB(0,0,0)")

webviewer_button (Get (RecordNumber) & " of " & get (foundcount); ""; "")



Creator :

Nicolas Bourré 20100303

*/

Let (

[

ltc = Length (textCol);

tc = Substitute (Case (ltc = 6; "#" & textCol; ltc = 7; textCol; ltc = 0; "#000000"; textCol); " "; "");

lbc = Length (bgCol);

bc = Substitute (Case (lbc = 6; "#" & bgCol; lbc = 7; bgCol; lbc = 0; "#ffffff"; bgCol); " "; "")

];



"data:text/html,¶







¶

¶"

& content &

"
¶

¶

"

)


Referring URL: 'http://www.briandunning.com/cf/1131'

Attached File:    

Screenshot:    


Keywords: ''

ClipManager: