Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ref #873, #817 More deprecation fixes, import organize and package cl…

…eanups
  • Loading branch information...
commit 7d8e9f83d04041f91a845ab78ff72b10cc475ae5 1 parent 675bac9
@indrajitr indrajitr authored
View
22 facebook/src/main/scala/net/liftweb/ext_api/facebook/FacebookRestApi.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,14 +18,14 @@ package net.liftweb {
package ext_api {
package facebook {
-import _root_.java.net.{HttpURLConnection, URL, URLEncoder}
-import _root_.java.io.DataOutputStream
-import _root_.java.io.InputStream
-import _root_.java.util.Date
+import java.net.{HttpURLConnection, URL, URLEncoder}
+import java.io.DataOutputStream
+import java.io.InputStream
+import java.util.Date
-import _root_.scala.xml.{Node, XML, NodeSeq}
+import xml.{Node, XML, NodeSeq}
-import _root_.net.liftweb.util.Helpers._
+import util.Helpers._
object FacebookRestApi {
def apiKey = System.getProperty("com.facebook.api_key")
@@ -61,7 +61,7 @@ object FacebookClient {
def genSignature(allParams: List[(String, Any)], secret: String): String = {
val md = _root_.java.security.MessageDigest.getInstance("MD5")
- val theStr = convert(allParams).sort(_ < _).mkString("") + secret
+ val theStr = convert(allParams).sortWith(_ < _).mkString("") + secret
md.digest((theStr).getBytes).map(byteToHex(_)).mkString("")
}
@@ -201,7 +201,7 @@ class FacebookClient[T](val apiKey: String, val secret: String, val session: Fac
FacebookClient.buildParams(meth.name, allParams: _*)
}
- def getInfo(users: Collection[Long], fields: FacebookField*): T = {
+ def getInfo(users: Iterable[Long], fields: FacebookField*): T = {
callMethod(GetInfo(users, fields: _*))
}
}
@@ -249,8 +249,8 @@ case class GetEvents(filters: GetEventsParam*) extends FacebookMethod("facebook.
case class GetEventsMembers(eventId: Long) extends FacebookMethod("facebook.events.getMembers", EventId(eventId))
case object GetAppUsers extends FacebookMethod("facebook.friends.getAppUsers")
//case object GetRequests extends FacebookMethod("facebook.friends.getRequests") /*This method is not listed in the current facebook api. deprecated?*/
-case class AreFriends(friends1: Collection[Long], friends2: Collection[Long]) extends FacebookMethod("facebook.friends.areFriends", FacebookParam("uids1", friends1.mkString(",")), FacebookParam("uids2", friends2.mkString(",")))
-case class GetInfo(users: Collection[Long], fields: FacebookField*) extends FacebookMethod("facebook.users.getInfo", UserIds(users.toList: _*), FacebookFields(fields: _*))
+case class AreFriends(friends1: Iterable[Long], friends2: Iterable[Long]) extends FacebookMethod("facebook.friends.areFriends", FacebookParam("uids1", friends1.mkString(",")), FacebookParam("uids2", friends2.mkString(",")))
+case class GetInfo(users: Iterable[Long], fields: FacebookField*) extends FacebookMethod("facebook.users.getInfo", UserIds(users.toList: _*), FacebookFields(fields: _*))
case object GetUser extends FacebookMethod("facebook.users.getLoggedInUser")
case class GetPhotos(primaryFilter: GetPhotosParam, otherFilters: GetPhotosParam*) extends FacebookMethod("facebook.photos.get", (primaryFilter :: otherFilters.toList): _*)
case class GetAlbums(primaryFilter: GetAlbumsParam, otherFilters: GetAlbumsParam*) extends FacebookMethod("facebook.photos.getAlbums", (primaryFilter :: otherFilters.toList): _*)
View
34 imaging/src/main/scala/net/liftweb/imaging/ImageResizer.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,31 +14,23 @@
* limitations under the License.
*/
-package net.liftweb {
-package imaging {
+package net.liftweb
+package imaging
-import java.awt.{Graphics2D, Graphics, Transparency, AlphaComposite, RenderingHints}
-import java.awt.geom.AffineTransform
-import java.awt.image.{AffineTransformOp, BufferedImage, ColorModel, IndexColorModel}
+import java.io.{InputStream,ByteArrayOutputStream,ByteArrayInputStream}
+import java.awt.{Graphics2D, Transparency, RenderingHints}
+import java.awt.image.BufferedImage
import javax.imageio.{IIOImage, ImageIO, ImageWriteParam}
-import org.apache.sanselan.ImageReadException
import org.apache.sanselan.Sanselan
import org.apache.sanselan.ImageFormat
-import org.apache.sanselan.common.IImageMetadata
-import org.apache.sanselan.common.RationalNumber
import org.apache.sanselan.formats.jpeg.JpegImageMetadata
-import org.apache.sanselan.formats.tiff.TiffField
-import org.apache.sanselan.formats.tiff.TiffImageMetadata
-import org.apache.sanselan.formats.tiff.constants.TagInfo
-import org.apache.sanselan.formats.tiff.constants.TiffConstants
import org.apache.sanselan.formats.tiff.constants.TiffTagConstants
-import java.io.{InputStream,ByteArrayOutputStream,ByteArrayInputStream}
+import common.{Box, Full, Empty}
+import util.Helpers
-import net.liftweb.common.{Box, Full, Empty}
-import net.liftweb.util.Helpers
object ImageOutFormat extends Enumeration("png", "jpg", "gif", "bmp"){
val png,jpeg,gif,bmp = Value
@@ -227,17 +219,17 @@ class ImageResizer(renderingHintsMap:Map[java.awt.RenderingHints.Key,Any], multi
val (tW, tH, rotFunc) = orientation match {
case Full(ImageOrientation.rotate180) =>
(targetWidth, targetHeight, (g2:Graphics2D) => {
- g2.rotate(Math.Pi)
+ g2.rotate(math.Pi)
g2.translate(-targetWidth, -targetHeight)
})
case Full(ImageOrientation.rotate270) =>
(targetHeight, targetWidth, (g2:Graphics2D) => {
- g2.rotate(Math.Pi/2)
+ g2.rotate(math.Pi/2)
g2.translate(0, -targetHeight)
})
case Full(ImageOrientation.rotate90) =>
(targetHeight, targetWidth, (g2:Graphics2D) => {
- g2.rotate(-Math.Pi/2)
+ g2.rotate(-math.Pi/2)
g2.translate(-targetWidth, 0)
})
case _ => (targetWidth, targetHeight, (g2:Graphics2D) => {})
@@ -253,6 +245,4 @@ class ImageResizer(renderingHintsMap:Map[java.awt.RenderingHints.Key,Any], multi
ret
}
-} //ImageResizer
-} //imaging
-} //net.liftweb
+}
View
27 machine/src/main/scala/net/liftweb/machine/ProtoStateMachine.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2010 WorldWide Conferencing, LLC
+ * Copyright 2006-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,15 +14,17 @@
* limitations under the License.
*/
-package net.liftweb {
-package machine {
+package net.liftweb
+package machine
+
+import collection.mutable.{Queue, HashMap}
+
+import common._
+import actor._
+import util._
+import Helpers._
+import mapper._
-import _root_.net.liftweb.mapper._
-import _root_.net.liftweb.util.Helpers._
-import _root_.scala.collection.mutable.{Queue, HashMap}
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.common._
-import _root_.net.liftweb.actor._
/**
* This trait manages state/workflow transition
@@ -319,7 +321,7 @@ trait MetaProtoStateMachine [MyType <: ProtoStateMachine[MyType, StateType],
def timedEventPeriodicWait = 10000L
private class TimedEventManager(val metaOwner: Meta) extends LiftActor with Loggable {
- ActorPing.schedule(this, Ping, TimeSpan(timedEventInitialWait)) // give the system 2 minutes to "warm up" then start pinging
+ Schedule.schedule(this, Ping, TimeSpan(timedEventInitialWait)) // give the system 2 minutes to "warm up" then start pinging
protected def messageHandler =
{
@@ -339,7 +341,7 @@ trait MetaProtoStateMachine [MyType <: ProtoStateMachine[MyType, StateType],
} catch {
case e => logger.error("State machine loop", e)
}
- ActorPing.schedule(this, Ping, TimeSpan(timedEventPeriodicWait))
+ Schedule.schedule(this, Ping, TimeSpan(timedEventPeriodicWait))
}
case object Ping
@@ -369,6 +371,3 @@ trait MetaProtoStateMachine [MyType <: ProtoStateMachine[MyType, StateType],
ret
}
}
-
-}
-}
View
18 oauth/src/main/scala/net/liftweb/oauth/OAuthSignatureMethod.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 WorldWide Conferencing, LLC
+ * Copyright 2010-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,16 +14,17 @@
* limitations under the License.
*/
-package net.liftweb {
-package oauth {
+package net.liftweb
+package oauth
import java.net.URI
import javax.crypto.Mac
-import javax.crypto.SecretKey
import javax.crypto.spec.SecretKeySpec
+
+import common._
+import util.Helpers
import net.liftweb.http._
-import net.liftweb.common._
-import net.liftweb.util.Helpers
+
abstract class OAuthSignatureMethod(accessor: OAuthAccessor) {
def validate(message: OAuthMessage): Box[OAuthMessage] =
@@ -66,7 +67,7 @@ abstract class OAuthSignatureMethod(accessor: OAuthAccessor) {
private def normalizeParameters(parameters: List[OAuthUtil.Parameter]) = {
val filteredParameters = parameters.filter(_.name != OAuthUtil.OAUTH_SIGNATURE)
- val sortedParameters = filteredParameters.sort((p1, p2) => {
+ val sortedParameters = filteredParameters.sortWith((p1, p2) => {
val k1 = OAuthUtil.percentEncode(p1.name) + ' ' + OAuthUtil.percentEncode(p1.value)
val k2 = OAuthUtil.percentEncode(p2.name) + ' ' + OAuthUtil.percentEncode(p2.value)
k1.compareTo(k2) <= 0
@@ -151,6 +152,3 @@ class PLAINTEXT(accessor: OAuthAccessor) extends OAuthSignatureMethod(accessor)
object PLAINTEXT extends OAuthSignatureMethodBuilder {
def apply(accessor: OAuthAccessor): OAuthSignatureMethod = new PLAINTEXT(accessor)
}
-
-}
-}
View
34 paypal/src/main/scala/net/liftweb/paypal/Paypal.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,21 +14,22 @@
* limitations under the License.
*/
-package net.liftweb {
-package paypal {
+package net.liftweb
+package paypal
-import _root_.net.liftweb.util.Helpers
+import java.io._
+
+import collection.mutable.ListBuffer
+
+import org.apache.commons.httpclient.{HttpClient, NameValuePair}
+import org.apache.commons.httpclient.methods._
+
+import common._
+import actor._
+import util._
import Helpers._
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.common._
-import _root_.net.liftweb.actor._
-import _root_.net.liftweb.http._
-import _root_.org.apache.commons.httpclient._
-import _root_.org.apache.commons.httpclient.methods._
-import _root_.java.io._
-import _root_.scala.collection.mutable.ListBuffer
+import http._
-import _root_.scala.xml.{NodeSeq}
/**
* sealed abstract type PaypalMode so we can cast to the super
@@ -91,7 +92,7 @@ object PaypalTransactionStatus extends Enumeration {
def find(name: String): Box[Value] = {
val n = name.trim.toLowerCase
- this.iterator.filter(v => v.toString.toLowerCase == n).toList.firstOption
+ this.values.filter(_.toString.toLowerCase == n).headOption
}
}
@@ -538,7 +539,7 @@ trait PaypalIPN extends BasePaypalTrait {
protected object requestQueue extends LiftActor {
protected def messageHandler =
{
- case PingMe => ActorPing.schedule(this, PingMe, 10 seconds)
+ case PingMe => Schedule.schedule(this, PingMe, 10 seconds)
case IPNRequest(r, cnt, _) if cnt > MaxRetry => // discard the transaction
@@ -562,6 +563,3 @@ trait PaypalIPN extends BasePaypalTrait {
}
requestQueue ! PingMe
}
-
-}
-}
View
39 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarDayView.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,22 +14,25 @@
* limitations under the License.
*/
-package net.liftweb {
-package widgets {
-package calendars {
-
-import _root_.scala.xml._
-import _root_.java.util.{Calendar, Locale}
-import _root_.java.util.Calendar._
-import _root_.java.text.SimpleDateFormat
-import _root_.net.liftweb.util.Helpers._
-import _root_.net.liftweb.common.{Box, Full, Empty}
-import _root_.net.liftweb.http.{LiftRules}
-import _root_.net.liftweb.http.js._
-import _root_.net.liftweb.http.SHtml._
+package net.liftweb
+package widgets
+package calendars
+
+import java.util.{Calendar, Locale}
+import java.util.Calendar._
+
+import xml._
+
+import common.Box
+import util.Helpers._
+
+import http.LiftRules
+import http.js._
+import http.SHtml._
import JsCmds._
import JE._
+
object CalendarDayView {
/**
@@ -94,7 +97,7 @@ class CalendarDayView(val when: Calendar, val meta: DayViewMeta) {
<div class="dayHead">
<table cellspacing="0" cellpading="0" style="width: 100%;">
<tr>
- <td class="dayHour"><div></div></td>
+ <td class="dayHour"><div></div></td>
<td class="dayHeadCell">{
val time = cal.getTime
meta.weekDaysFormatter.format(time) + " " + dateFormatter.format(time)
@@ -108,7 +111,7 @@ class CalendarDayView(val when: Calendar, val meta: DayViewMeta) {
val cal = Calendar getInstance;
cal set(HOUR_OF_DAY, 0)
cal set(MINUTE, 0)
- for (val i <- 0 to 23) yield
+ for (i <- 0 to 23) yield
try{
<tr>
<td class="dayHour"><div>{(meta.timeFormatter format(cal getTime)).toString}</div></td>
@@ -130,7 +133,3 @@ class CalendarDayView(val when: Calendar, val meta: DayViewMeta) {
</div>
}
}
-
-}
-}
-}
View
34 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarUtils.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,32 +14,30 @@
* limitations under the License.
*/
-package net.liftweb {
-package widgets {
-package calendars {
+package net.liftweb
+package widgets
+package calendars
-import _root_.net.liftweb.http.js._
-import _root_.net.liftweb.common._
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.http.js.JE._
-import _root_.net.liftweb.http.js.JsCmds._
-import _root_.java.text.SimpleDateFormat
-import _root_.java.util.Calendar
-import _root_.java.util.Calendar._
+import java.text.SimpleDateFormat
+import java.util.Calendar
+import java.util.Calendar._
+
+import common._
+import util._
+import http.js._
+import JE._
+import JsCmds._
object CalendarUtils {
private lazy val timeFormatter = new SimpleDateFormat("h:m")
- import JE._
- import JsCmds._
-
/**
* Returns the JSON representation of the list of CalendrItem sorted by start time.
*/
def toJSON(items: List[CalendarItem]): JsExp = {
- JsObj(("items", JsArray(items.sort((e1, e2) => e1.start before(e2 start)) map(c => {
+ JsObj(("items", JsArray(items.sortWith((e1, e2) => e1.start before(e2 start)) map(c => {
val (sh, sm) = (c.start.get(HOUR_OF_DAY), c.start.get(MINUTE));
val (eh, em) = c.end map (c => (c.get(HOUR_OF_DAY), c.get(MINUTE))) openOr (48, 0)
@@ -81,7 +79,3 @@ object CalendarUtils {
(c1.get(YEAR) == c2.get(YEAR))
}
-
-}
-}
-}
View
41 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarWeekView.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,22 +14,23 @@
* limitations under the License.
*/
-package net.liftweb {
-package widgets {
-package calendars {
-
-import _root_.scala.xml._
-import _root_.java.util.{Calendar, Locale}
-import _root_.java.util.Calendar._
-import _root_.java.text.SimpleDateFormat
-import _root_.net.liftweb.util.Helpers._
-import _root_.net.liftweb.common.{Box, Full, Empty}
-import _root_.net.liftweb.http.{LiftRules}
-import _root_.net.liftweb.http.js._
-import _root_.net.liftweb.http.SHtml._
+package net.liftweb
+package widgets
+package calendars
+
+import java.util.{Calendar, Locale}
+import Calendar._
+
+import xml._
+
+import common.Box
+import util.Helpers._
+import http.LiftRules
+import http.js._
import JsCmds._
import JE._
+
object CalendarWeekView {
/**
@@ -120,7 +121,7 @@ class CalendarWeekView(val when: Calendar, val meta: WeekViewMeta) {
<tr>
<td class="wkHour"><div></div></td>
{
- (for (val day <- 0 to 6) yield
+ (for (day <- 0 to 6) yield
<td class="wkHeadCell">{
try{
val time = headCal.getTime
@@ -140,13 +141,13 @@ class CalendarWeekView(val when: Calendar, val meta: WeekViewMeta) {
val cal = Calendar getInstance;
cal set(HOUR_OF_DAY, 0)
cal set(MINUTE, 0)
- for (val i <- 0 to 23) yield
+ for (i <- 0 to 23) yield
try{
<tr>
<td class="wkHour"><div>{(meta.timeFormatter format(cal getTime)).toString}</div></td>
{
<td id={("wkhidx_" + startIndex + "_" + (i*2 toString))} class="wkCell borderDashed"></td> ++
- (for (val day <- 1 to 6) yield {
+ (for (day <- 1 to 6) yield {
<td id={("wkhidx_" + (f(day, startIndex)) + "_" + (i*2 toString))} class="wkCell borderDashed borderLeft"></td>
}
)
@@ -156,7 +157,7 @@ class CalendarWeekView(val when: Calendar, val meta: WeekViewMeta) {
<td class="wkHour borderSolid"></td>
{
<td id={("wkhidx_" + startIndex + "_" + ((i*2+1) toString))} class="wkCell borderSolid"></td> ++
- (for (val day <- 1 to 6) yield
+ (for (day <- 1 to 6) yield
<td id={("wkhidx_" + (f(day, startIndex)) + "_" + ((i*2+1) toString))} class="wkCell borderSolid borderLeft"></td>
)
}
@@ -169,7 +170,3 @@ class CalendarWeekView(val when: Calendar, val meta: WeekViewMeta) {
</div>
}
}
-
-}
-}
-}
View
35 widgets/src/main/scala/net/liftweb/widgets/flot/Flot.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,32 +14,29 @@
* limitations under the License.
*/
-package net.liftweb {
-package widgets {
-package flot {
+package net.liftweb
+package widgets
+package flot
-import scala.xml.{NodeSeq, Node, PCData, Text, Unparsed}
-import _root_.net.liftweb.http.{LiftRules}
-import _root_.net.liftweb.http.js._
-import JsCmds._
-import JE._
-// jQuery specific
-import _root_.net.liftweb.http.js.jquery._
+import xml.{NodeSeq, Unparsed}
+
+import common._
+import util._
+import Helpers._
+import http.LiftRules
+import http.js._
+import jquery._
import JsCmds._
import JE._
import JqJE._
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.common._
-import Helpers._
+
/**
* renders a flot graph using http://code.google.com/p/flot/ jQuery widget
* <br />
* See the sites/flotDemo webapp for examples.
*/
-
-object Flot
-{
+object Flot {
/**
* register the resources with lift (typically in boot)
*/
@@ -418,7 +415,3 @@ object Flot
}
*/
}
-
-}
-}
-}
View
20 widgets/src/main/scala/net/liftweb/widgets/logchanger/LogLevelChanger.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,12 +14,15 @@
* limitations under the License.
*/
-package net.liftweb {
-package widgets {
-package logchanger {
+package net.liftweb
+package widgets
+package logchanger
+
+import xml._
+import xml.transform._
+
+import org.slf4j.LoggerFactory
-import scala.xml._
-import scala.xml.transform._
import common._
import http._
import js._
@@ -28,7 +31,6 @@ import util.Helpers._
import sitemap._
import Loc._
-import org.slf4j.{Logger => SLF4JLogger, LoggerFactory}
/**
* Abstraction of a logging backend where the loglevel can be set
@@ -226,7 +228,7 @@ trait LogLevelChanger {
def changeLogLevel: NodeSeq = {
def doRows(in: NodeSeq): NodeSeq = {
- val ls = loggers.toList sort {getName(_) < getName(_)}
+ val ls = loggers.toList sortWith {getName(_) < getName(_)}
ls flatMap {l =>
def loggerChoices(logger: LoggerType): NodeSeq = {
val levelTexts:List[(String, Boolean, LoggerType => Unit)] = List(
@@ -257,5 +259,3 @@ trait LogLevelChanger {
bind("logLevels", xhtml, "rows" -> doRows _)
}
}
-
-}}}
View
17 widgets/src/main/scala/net/liftweb/widgets/uploadprogress/UploadProgress.scala
@@ -18,14 +18,13 @@ package net.liftweb
package widgets
package uploadprogress
-import scala.xml.{NodeSeq,Text}
-import net.liftweb.http.{SessionVar,Req,GetRequest,PlainTextResponse,JsonResponse,
- LiftRules,OnDiskFileParamHolder,S,ResourceServer,LiftResponse}
-import net.liftweb.http.js.JsCmds._
-import net.liftweb.http.js.JE._
-import net.liftweb.common.{Box,Empty,Failure,Full}
-import net.liftweb.util.{Log}
-import net.liftweb.common.ParseDouble
+import xml.NodeSeq
+
+import common.{Box,Empty,Full}
+import http._
+import js.JsCmds._
+import js.JE._
+
/**
* A helper widget that makes it easy to do upload
@@ -84,7 +83,7 @@ object UploadProgress {
Full(JsonResponse(
JsObj(
"state" -> state,
- "percentage" -> Str(Math.floor(((recived) / (size))*100).toString)
+ "percentage" -> Str(math.floor(((recived) / (size))*100).toString)
)
))
}
View
44 xmpp/src/main/scala/net/liftweb/xmpp/XMPPDispatcher.scala
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
+ * Copyright 2007-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,27 +14,20 @@
* limitations under the License.
*/
-package net.liftweb {
-package xmpp {
-
-import _root_.java.util.Collection
-import _root_.java.io.IOException
-import _root_.org.jivesoftware.smack.Chat
-import _root_.org.jivesoftware.smack.ChatManager
-import _root_.org.jivesoftware.smack.ConnectionConfiguration
-import _root_.org.jivesoftware.smack.MessageListener
-import _root_.org.jivesoftware.smack.ChatManagerListener
-import _root_.org.jivesoftware.smack.Roster
-import _root_.org.jivesoftware.smack.RosterEntry
-import _root_.org.jivesoftware.smack.RosterListener
-import _root_.org.jivesoftware.smack.XMPPConnection
-import _root_.org.jivesoftware.smack.XMPPException
-import _root_.org.jivesoftware.smack.packet.Message
-import _root_.org.jivesoftware.smack.packet.Presence
-import _root_.org.jivesoftware.smack.util.StringUtils
-import _root_.net.liftweb.actor._
-import _root_.scala.collection.mutable.HashMap
-import _root_.scala.collection.mutable.Map
+package net.liftweb
+package xmpp
+
+import java.util.Collection
+
+import collection.mutable.HashMap
+import collection.mutable.Map
+
+import org.jivesoftware.smack._
+import packet.{Message, Presence}
+import util.StringUtils
+
+import actor._
+
/** These messages are sent to the XMPPDispatcher Actor. */
// Send the Presence to the XMPP server
@@ -112,10 +105,10 @@ class XMPPDispatcher(val connf: () => ConnectionConfiguration, val login: XMPPCo
/* These are all messages we process from the client Actors. */
case AddListener(actor: LiftActor) =>
actor ! NewRoster(roster)
- clients ::= actor
+ clients ::= actor
case RemoveListener(actor: LiftActor) =>
- clients -= actor
+ clients filterNot(_ == actor)
case SetPresence(presence) => conn.sendPacket(presence)
@@ -270,6 +263,3 @@ object ConsoleChatHelper {
ex
}
}
-
-}
-}
Please sign in to comment.
Something went wrong with that request. Please try again.