This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package code { | |
package snippet { | |
import code.model.{AutomatedTests} | |
import _root_.scala.xml.{NodeSeq, Text} | |
import _root_.net.liftweb._ | |
import util._ | |
import common.Logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object PutCometOnPage { | |
def render(xhtml: NodeSeq): NodeSeq = { | |
val id= "browser" + versionString | |
debug("Using CometActor with name: %s".format(id)) | |
for (sess <- S.session) sess.sendCometActorMessage( | |
"BrowserDetails", Full(id), versionString | |
) | |
<lift:comet type="BrowserDetails" name={id}>{xhtml}</lift:comet> | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object MyListeners extends Logger{ | |
private var listeners: Map[String, LiftActor] = Map() | |
def listenerFor(str: String): LiftActor = synchronized { | |
listeners.get(str) match { | |
case Some(a) => info("Our map is %s".format(listeners)); a | |
case None => { | |
val ret = new DispatcherActor(str) | |
listeners += str -> ret | |
info("Our map is %s".format(listeners)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* listenerFor(srvmgrVersion) returns a DispatcherActor that in turn | |
* will send the CellToUpdate clas class to the comet actors that are | |
* displaying info about the version we got json data for | |
*/ | |
listenerFor(srvmgrVersion) match { | |
case a: LiftActor => a ! CellToUpdate( | |
testName, browser, srvmgrVersion, testResult, cellNotes | |
) | |
case _ => info("No actor to send an update") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override def lowPriority: PartialFunction[Any,Unit] = { | |
case CellToUpdate(index, rowName, version, cssClass, cellNotes) => { | |
info("Comet Actor %s will do a partial update".format(this)) | |
info("[API]: Updating BrowserTestResults for version: %s".format(version)) | |
showingVersion = version | |
/** | |
* each td in the html grid has an id that is | |
* [0-9] + browser name | |
* I use this to uniquely identify which cell to update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fmpwizard.weyesowl.code.snippet | |
import com.fmpwizard.weyesowl.code.model.{Inventory, InventoryDescription, | |
InventoryImages, InventoryOptionFields, InventoryPrice, InventoryStock, | |
InventoryXCategory, Categories} | |
import scala.xml.{NodeSeq, Text, Elem} | |
import java.io.{File,FileOutputStream} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class ReplaceOrAppend(replacementId: String, replacement: NodeSeq, | |
appendingId: String, appending: NodeSeq) extends JsCmd with HtmlFixer { | |
override val toJsCmd = { | |
val (replacementHtml, replacementJs) = fixHtmlAndJs("inline", replacement) | |
val (appendHtml, appendJs) = fixHtmlAndJs("inline", appending) | |
var ret = | |
""" | |
try { | |
var parent1 = document.getElementById(""" + replacementId.encJs + """); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="lift:Upload?form=post” multipart=”true"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="lift:Upload?form=post;multipart=true"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bind the view to the dynamic HTML | |
def show(xhtml: Group): NodeSeq = { | |
val (name, js) = ajaxCall(JE.JsRaw("this.value"), | |
s => After(200, replace(s))) | |
bind("select", xhtml, | |
"state" -> select(AjaxForm.states.map(s => (s,s)), | |
Full(state), s => state = s, "onchange" -> js.toJsCmd) % | |
(new PrefixedAttribute("lift", "gc", name, Null)), | |
"city" -> cityChoice(state) % ("id" -> "city_select"), | |
"submit" -> submit(?("Save"), |
OlderNewer