jQuery Litelighter - Test Languages

Languages provided separately are tested and demonstrated here. Only Generic, Js, Css, and Html are provided by default. Others may be located within the Languages directory.

Back to Blog | Fork on Github

Donation

Car BounceTry my new app to keep you informed of your car's financing status and value.

Has this Litelighter been helpful to you?

Tests

Toggle On/Off | Toggle Light/Dark

Generic - "generic" (default)

/*
	here is some script
*/
if(myvar == "foobar"){
	for(i=1; i < myarr.length; i++){
		// some output
		$('#myEl').removeClass('highlight');
		return true;
	}
}

Javascript - "js"

/*
	here is some script
*/
if(myvar == "foobar"){
	for(i=1; i < myarr.length; i++){
		// some output
		$('#myEl').removeClass('highlight');
		return "2012-06-23".match( /^(\d{4})\-(\d{2})\-(\d{2})$/ );
	}
}

CSS - "css"

/* pt specific styles: ptfixed, ptdragover, ptdraghandle, ptshowhide */
table tr th.ptfixed{ font-size: 12%; /* a fixed table header cell */ }

table tr td.ptfixed{ color: #8F9657; }

table .ptdragover{ height: 100px; width: 100%; }

table .ptdraghandle{ font-family: "Sans Serif"; }

table .ptshowhide:hover{ /* class given to a generated show/hide link */ }

Html - "html"

<!--
	This is a comment
-->
<table>
	<tr>
		<th data-ptcolumn="description">Description</th>
		<th data-ptcolumn="type">Type</th>
		<th data-ptcolumn="purchased">Purchased</th>
		<th data-ptcolumn="condition">Condition</th>
		<th data-ptcolumn="modelnum">Model #</th>
		<th data-ptcolumn="serialnum">Serial #</th>
		<th data-ptcolumn="assignedto">Assigned To</th>
		<th data-ptcolumn="lang">Language</th>
	</tr>
</table>
<style type="text/css">
	body{ font-size: 12px; background-color: #005500; }
	#myelement{
		line-height: 22px;
		font-size: 2em;
	}
</style>

<script type="text/javascript">
	/*
		here is some script
	*/
	if(myvar == "foobar"){
		for(i=1; i < myarr.length; i++){
			// some output
			$('#myEl').removeClass('highlight');
			return "2012-06-23".match( /^(\d{4})\-(\d{2})\-(\d{2})$/ );
		}
	}
</script>

ColdFusion - "cfml"

<!---
	This standard html, js, css
--->
<div class="myclass">This is some html<div>
<style type="text/css">
	body{ font-size: 12px; background-color: #005500; }
	#myelement{
		line-height: 22px;
		font-size: 2em;
	}
</style>

<script type="text/javascript">
	/*
		here is some script
	*/
	if(myvar == "foobar"){
		for(i=1; i < myarr.length; i++){
			// some output
			$('#myEl').removeClass('highlight');
			return true;
		}
	}
</script>

<!---
	test an sql query
--->
<cfset myvar=null>
<cfquery datasource="mydsn" name="myname">
	-- test some sql
	select * from myTable where 1=1 and firstName=<cfqueryparam cfsqltype="cf_sql_varchar" value="#myName#">;

	-- do an insert
	<--- insert into myTable (firstName, lastName) values ('John','Doe'); --->

	-- an update
	update myTable set firstName='Johnny' where firstName='John';
</cfquery>

<!---
	test some java
--->
<cfscript>
	/*
		here is some cfm script
	*/
	if(myvar == "foobar"){
		for(i=1; i lt ArrayLen(myarr); i++){
			// some output
			cdc = CreateObject('component', 'caldav').init();
			return cdc.get('myurl.ics');
		}
	}
</cfscript>

PHP - "php"

/*
	here is some php
*/
if($myvar == "foobar"){
	for($i=1; $i < sizeof($myarr); $i++){
		// some output
		$myField = $myclass->getModel->getField('myField');
	}
}

Html with php - "htmlphp"

<!--
	This is a comment
-->
<table>
	<tr>
		<th data-ptcolumn="description">Description</th>
		<th data-ptcolumn="type">Type</th>
		<th data-ptcolumn="purchased">Purchased</th>
		<th data-ptcolumn="condition">Condition</th>
		<th data-ptcolumn="modelnum">Model #</th>
		<th data-ptcolumn="serialnum">Serial #</th>
		<th data-ptcolumn="assignedto">Assigned To</th>
		<th data-ptcolumn="lang">Language</th>
	</tr>
</table>
<style type="text/css">
	body{ font-size: 12px; background-color: #005500; }
	#myelement{
		line-height: 22px;
		font-size: 2em;
	}
</style>

<script type="text/javascript">
	/*
		here is some script
	*/
	if(myvar == "foobar"){
		for(i=1; i < myarr.length; i++){
			// some output
			$('#myEl').removeClass('highlight');
			return "2012-06-23".match( /^(\d{4})\-(\d{2})\-(\d{2})$/ );
		}
	}
</script>

<?php
foreach($myarr as $k=>$v){
	$mycounter += 2;
	/*
	... do some more logic
	*/
}
?>

SQL

-- lets get started
select * from myTable where 1=1 and firstName='John';

-- do an insert
insert into myTable (firstName, lastName) values ('John','Doe');

-- an update
update myTable set firstName='Johnny' where firstName='John';

-- do a delete
delete from myTable where firstName='Johnny';

-- create a stored procedure
CREATE PROCEDURE [dbo].[spGetSomethingById] 
	@Id int,
	@myemail varchar(50) output
AS
BEGIN
	insert into myTable (developerName, email, activated, about) values ('the name', 'asdf@fdsa.com', 1, 'this is about')
	
	select @myemail=rtrim(email) from myTable where id=1

	select id, developerName, email, activated, about from myTable
	
	select id, developerName, email, activated, about from myTable where id=@Id

	return 5
END