├── .github └── workflows │ └── scala.yml ├── .gitignore ├── Dockerfile ├── Dockerfile_k8s ├── README.md ├── README_CN.md ├── README_JENKINS.md ├── VERSION ├── build.sbt ├── conf └── application.conf ├── docker-compose.yml ├── docs ├── CookIM-ChatStream.png ├── CookIM-Flow.png ├── cookim.png ├── doc.md ├── screen.png └── screen2.png ├── kubernetes └── cookim.yaml ├── pom.xml ├── project ├── assembly.sbt ├── build.properties └── plugins.sbt ├── src └── main │ ├── resources │ └── mykeystore.jks │ └── scala │ └── com │ └── cookeem │ └── chat │ ├── CookIM.scala │ ├── common │ └── CommonUtils.scala │ ├── demo │ └── TestObj.scala │ ├── event │ └── ChatEventPackage.scala │ ├── jwt │ └── JwtOps.scala │ ├── mongo │ ├── MongoLogic.scala │ ├── MongoOps.scala │ └── package.scala │ ├── restful │ ├── Controller.scala │ ├── Route.scala │ └── RouteOps.scala │ └── websocket │ ├── ChatSession.scala │ ├── ChatSessionActor.scala │ ├── NotificationActor.scala │ ├── PushSession.scala │ ├── PushSessionActor.scala │ └── TraitPubSubActor.scala └── www ├── changeinfo.html ├── changepwd.html ├── chatlist.html ├── chatsession.html ├── css └── index.css ├── error.html ├── fonts ├── Material_Icon │ ├── MaterialIcons-Regular.eot │ ├── MaterialIcons-Regular.ijmap │ ├── MaterialIcons-Regular.svg │ ├── MaterialIcons-Regular.ttf │ ├── MaterialIcons-Regular.woff │ ├── MaterialIcons-Regular.woff2 │ ├── codepoints │ └── material-icons.css ├── baloo-bhai-v1-latin-regular.eot ├── baloo-bhai-v1-latin-regular.svg ├── baloo-bhai-v1-latin-regular.ttf ├── baloo-bhai-v1-latin-regular.woff ├── baloo-bhai-v1-latin-regular.woff2 ├── fonts.css ├── indie-flower-v8-latin-regular.eot ├── indie-flower-v8-latin-regular.svg ├── indie-flower-v8-latin-regular.ttf ├── indie-flower-v8-latin-regular.woff ├── indie-flower-v8-latin-regular.woff2 ├── open-sans-v13-latin-regular.eot ├── open-sans-v13-latin-regular.svg ├── open-sans-v13-latin-regular.ttf ├── open-sans-v13-latin-regular.woff ├── open-sans-v13-latin-regular.woff2 ├── roboto-v15-latin-regular.eot ├── roboto-v15-latin-regular.svg ├── roboto-v15-latin-regular.ttf ├── roboto-v15-latin-regular.woff ├── roboto-v15-latin-regular.woff2 └── roboto │ ├── Roboto-Bold.eot │ ├── Roboto-Bold.ttf │ ├── Roboto-Bold.woff │ ├── Roboto-Bold.woff2 │ ├── Roboto-Light.eot │ ├── Roboto-Light.ttf │ ├── Roboto-Light.woff │ ├── Roboto-Light.woff2 │ ├── Roboto-Medium.eot │ ├── Roboto-Medium.ttf │ ├── Roboto-Medium.woff │ ├── Roboto-Medium.woff2 │ ├── Roboto-Regular.eot │ ├── Roboto-Regular.ttf │ ├── Roboto-Regular.woff │ ├── Roboto-Regular.woff2 │ ├── Roboto-Thin.eot │ ├── Roboto-Thin.ttf │ ├── Roboto-Thin.woff │ └── Roboto-Thin.woff2 ├── friends.html ├── images ├── Thumbs.db ├── avatar │ ├── boy.jpg │ ├── girl.jpg │ └── unknown.jpg ├── cookim.ai ├── cookim.png ├── cookim.svg ├── favicon.ico ├── favicon_bak.ico ├── file.png ├── sample.jpg └── yuna.jpg ├── index.html ├── js ├── changeinfo.js ├── changepwd.js ├── chatlist.js ├── chatsession.js ├── error.js ├── friends.js ├── index.js ├── login.js ├── logout.js ├── notifications.js └── register.js ├── jslib ├── MediaStreamRecorder │ └── MediaStreamRecorder.js ├── angular-animate │ ├── LICENSE.md │ ├── README.md │ ├── angular-animate.js │ ├── angular-animate.min.js │ ├── angular-animate.min.js.map │ ├── bower.json │ ├── index.js │ └── package.json ├── angular-cookies │ ├── LICENSE.md │ ├── README.md │ ├── angular-cookies.js │ ├── angular-cookies.min.js │ ├── angular-cookies.min.js.map │ ├── bower.json │ ├── index.js │ └── package.json ├── angular-route │ ├── LICENSE.md │ ├── README.md │ ├── angular-route.js │ ├── angular-route.min.js │ ├── angular-route.min.js.map │ ├── bower.json │ ├── index.js │ └── package.json ├── angular │ ├── LICENSE.md │ ├── README.md │ ├── angular-csp.css │ ├── angular.js │ ├── angular.min.js │ ├── angular.min.js.gzip │ ├── angular.min.js.map │ ├── bower.json │ ├── index.js │ └── package.json ├── jquery │ ├── AUTHORS.txt │ ├── LICENSE.txt │ ├── README.md │ ├── bower.json │ ├── dist │ │ ├── core.js │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ ├── jquery.slim.js │ │ ├── jquery.slim.min.js │ │ └── jquery.slim.min.map │ ├── external │ │ └── sizzle │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── sizzle.js │ │ │ ├── sizzle.min.js │ │ │ └── sizzle.min.map │ ├── package.json │ └── src │ │ ├── .eslintrc │ │ ├── ajax.js │ │ ├── ajax │ │ ├── jsonp.js │ │ ├── load.js │ │ ├── parseXML.js │ │ ├── script.js │ │ ├── var │ │ │ ├── location.js │ │ │ ├── nonce.js │ │ │ └── rquery.js │ │ └── xhr.js │ │ ├── attributes.js │ │ ├── attributes │ │ ├── attr.js │ │ ├── classes.js │ │ ├── prop.js │ │ ├── support.js │ │ └── val.js │ │ ├── callbacks.js │ │ ├── core.js │ │ ├── core │ │ ├── DOMEval.js │ │ ├── access.js │ │ ├── init.js │ │ ├── parseHTML.js │ │ ├── ready-no-deferred.js │ │ ├── ready.js │ │ ├── readyException.js │ │ ├── support.js │ │ └── var │ │ │ └── rsingleTag.js │ │ ├── css.js │ │ ├── css │ │ ├── addGetHookIf.js │ │ ├── adjustCSS.js │ │ ├── curCSS.js │ │ ├── hiddenVisibleSelectors.js │ │ ├── showHide.js │ │ ├── support.js │ │ └── var │ │ │ ├── cssExpand.js │ │ │ ├── getStyles.js │ │ │ ├── isHiddenWithinTree.js │ │ │ ├── rmargin.js │ │ │ ├── rnumnonpx.js │ │ │ └── swap.js │ │ ├── data.js │ │ ├── data │ │ ├── Data.js │ │ └── var │ │ │ ├── acceptData.js │ │ │ ├── dataPriv.js │ │ │ └── dataUser.js │ │ ├── deferred.js │ │ ├── deferred │ │ └── exceptionHook.js │ │ ├── deprecated.js │ │ ├── dimensions.js │ │ ├── effects.js │ │ ├── effects │ │ ├── Tween.js │ │ └── animatedSelector.js │ │ ├── event.js │ │ ├── event │ │ ├── ajax.js │ │ ├── alias.js │ │ ├── focusin.js │ │ ├── support.js │ │ └── trigger.js │ │ ├── exports │ │ ├── amd.js │ │ └── global.js │ │ ├── jquery.js │ │ ├── manipulation.js │ │ ├── manipulation │ │ ├── _evalUrl.js │ │ ├── buildFragment.js │ │ ├── getAll.js │ │ ├── setGlobalEval.js │ │ ├── support.js │ │ ├── var │ │ │ ├── rcheckableType.js │ │ │ ├── rscriptType.js │ │ │ └── rtagName.js │ │ └── wrapMap.js │ │ ├── offset.js │ │ ├── queue.js │ │ ├── queue │ │ └── delay.js │ │ ├── selector-native.js │ │ ├── selector-sizzle.js │ │ ├── selector.js │ │ ├── serialize.js │ │ ├── traversing.js │ │ ├── traversing │ │ ├── findFilter.js │ │ └── var │ │ │ ├── dir.js │ │ │ ├── rneedsContext.js │ │ │ └── siblings.js │ │ ├── var │ │ ├── ObjectFunctionString.js │ │ ├── arr.js │ │ ├── class2type.js │ │ ├── concat.js │ │ ├── document.js │ │ ├── documentElement.js │ │ ├── fnToString.js │ │ ├── getProto.js │ │ ├── hasOwn.js │ │ ├── indexOf.js │ │ ├── pnum.js │ │ ├── push.js │ │ ├── rcssNum.js │ │ ├── rnotwhite.js │ │ ├── slice.js │ │ ├── support.js │ │ └── toString.js │ │ └── wrap.js └── materialize │ ├── angular-materialize.min.js │ ├── materialize.min.css │ └── materialize.min.js ├── login.html ├── logout.html ├── notifications.html ├── register.html └── websocket.html /.github/workflows/scala.yml: -------------------------------------------------------------------------------- 1 | name: Scala CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Set up JDK 1.8 17 | uses: actions/setup-java@v1 18 | with: 19 | java-version: 1.8 20 | - name: Run tests 21 | run: sbt test 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | /www/node_modules/ 3 | .DS_Store 4 | /.idea/ 5 | /project/project/ 6 | /project/target/ 7 | /target/ 8 | /upload/ 9 | /docker 10 | /mongo 11 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Notice! Don't use openjdk:latest docker image, it's too big and will build fail in docker:DinD 2 | 3 | FROM openjdk:alpine 4 | 5 | MAINTAINER cookeem@qq.com 6 | 7 | RUN mkdir -p /root/cookim/ 8 | 9 | ADD target/scala-2.11/CookIM-assembly-0.2.4-SNAPSHOT.jar /root/cookim/cookim.jar 10 | ADD conf /root/cookim/conf 11 | ADD www /root/cookim/www 12 | 13 | WORKDIR /root/cookim 14 | 15 | RUN echo '#!/bin/ash' >> /root/cookim/run.sh 16 | RUN echo 'java -classpath "/root/cookim/cookim.jar" com.cookeem.chat.CookIM -n -h $(hostname -f) -w $WEB_PORT -a $AKKA_PORT -s $SEED_NODES -m $MONGO_URI' >> /root/cookim/run.sh 17 | RUN chmod a+x /root/cookim/run.sh 18 | 19 | CMD [ "/root/cookim/run.sh" ] 20 | 21 | # sbt clean assembly 22 | # docker build -t cookeem/cookim . 23 | # docker push cookeem/cookim -------------------------------------------------------------------------------- /Dockerfile_k8s: -------------------------------------------------------------------------------- 1 | # Notice! Don't use openjdk:latest docker image, it's too big and will build fail in docker:DinD 2 | 3 | FROM k8s-registry:5000/openjdk:alpine 4 | 5 | MAINTAINER cookeem@qq.com 6 | 7 | RUN mkdir -p /root/cookim/ 8 | 9 | ADD cookim.jar /root/cookim/ 10 | ADD conf /root/cookim/conf 11 | ADD www /root/cookim/www 12 | 13 | WORKDIR /root/cookim 14 | 15 | RUN echo '#!/bin/ash' >> /root/cookim/run.sh 16 | RUN echo 'java -classpath "/root/cookim/cookim.jar" com.cookeem.chat.CookIM -n -h $(hostname -f) -w $WEB_PORT -a $AKKA_PORT -s $SEED_NODES' >> /root/cookim/run.sh 17 | RUN chmod a+x /root/cookim/run.sh 18 | 19 | CMD [ "/root/cookim/run.sh" ] 20 | 21 | # sbt clean assembly 22 | # docker build -t cookeem/cookim . 23 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.2.3-SNAPSHOT -------------------------------------------------------------------------------- /build.sbt: -------------------------------------------------------------------------------- 1 | name := "CookIM" 2 | 3 | version := "0.2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.8" 6 | 7 | scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8") 8 | 9 | libraryDependencies ++= { 10 | val akkaV = "2.5.2" 11 | val akkaHttpV = "10.0.7" 12 | val reactivemongoV = "0.12.3" 13 | Seq( 14 | "com.typesafe.akka" %% "akka-actor" % akkaV, 15 | // "com.typesafe.akka" %% "akka-remote" % akkaV, 16 | "com.typesafe.akka" %% "akka-cluster" % akkaV, 17 | "com.typesafe.akka" %% "akka-cluster-tools" % akkaV, 18 | "com.typesafe.akka" %% "akka-testkit" % akkaV % Test, 19 | "com.typesafe.akka" %% "akka-stream" % akkaV, 20 | "com.typesafe.akka" %% "akka-stream-testkit" % akkaV % Test, 21 | // "com.typesafe.akka" %% "akka-http-core" % akkaHttpV, 22 | "com.typesafe.akka" %% "akka-http" % akkaHttpV, 23 | "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpV % Test, 24 | // "org.scalactic" %% "scalactic" % "3.0.1", 25 | // "org.scalatest" %% "scalatest" % "3.0.1" % "test", 26 | "com.typesafe.play" %% "play-json" % "2.5.15", 27 | "org.slf4j" % "slf4j-simple" % "1.7.25", 28 | "com.sksamuel.scrimage" %% "scrimage-core" % "2.1.8", 29 | "com.sksamuel.scrimage" %% "scrimage-io-extra" % "2.1.8", 30 | "com.esotericsoftware" % "kryo" % "4.0.0", 31 | "com.github.romix.akka" %% "akka-kryo-serialization" % "0.5.0", 32 | "commons-cli" % "commons-cli" % "1.4", 33 | "io.jsonwebtoken" % "jjwt" % "0.7.0", 34 | "org.reactivemongo" %% "reactivemongo" % reactivemongoV, 35 | "org.reactivemongo" %% "reactivemongo-play-json" % reactivemongoV 36 | ) 37 | } 38 | 39 | ////sbt使用代理 40 | //javaOptions in console ++= Seq( 41 | // "-Dhttp.proxyHost=cmproxy-sgs.gmcc.net", 42 | // "-Dhttp.proxyPort=8081" 43 | //) 44 | //javaOptions in run ++= Seq( 45 | // "-Dhttp.proxyHost=cmproxy-sgs.gmcc.net", 46 | // "-Dhttp.proxyPort=8081" 47 | //) 48 | 49 | -------------------------------------------------------------------------------- /conf/application.conf: -------------------------------------------------------------------------------- 1 | #mongodb settings 2 | mongodb { 3 | dbname = "cookim" 4 | uri = "mongodb://mongo:27017/local" 5 | } 6 | //jwt secret settings 7 | jwt { 8 | secret = "5d7312635ca0a-d071-454d-be56216c9-8271-4500-9b13-a3e6c850e4-b1de4871a8700132fb96-0655-462a-b7c4-134579e8e06fdf9dbe65-cb5c-42a8-abaf-77ffcf17ec18" 9 | } 10 | 11 | //if storeSecret set non-empty, it will use HTTPS 12 | ssl { 13 | storeSecret = "" 14 | } 15 | 16 | #akka http settings, please do not change 17 | akka.http { 18 | server { 19 | remote-address-header = on 20 | raw-request-uri-header = on 21 | idle-timeout = 60 s 22 | } 23 | parsing { 24 | max-content-length = 8m 25 | } 26 | } 27 | 28 | #akka cluster settings 29 | akka { 30 | loglevel = "WARNING" 31 | cluster { 32 | #seed-nodes = ["akka.tcp://chat-cluster@localhost:2551"] 33 | #auto-down-unreachable-after = 10s 34 | metrics.enabled = off 35 | } 36 | # remote settings 37 | remote { 38 | log-remote-lifecycle-events = off 39 | netty.tcp { 40 | # Akka behind NAT or in a Docker container 41 | #hostname = "localhost" # external (logical) hostname 42 | #port = 2551 # external (logical) port 43 | 44 | #bind-hostname = "127.0.0.1" # internal (bind) hostname 45 | #bind-port = 0 # internal (bind) port 46 | } 47 | } 48 | # please do not change actor settings 49 | actor { 50 | provider = cluster 51 | serializers { 52 | #config available serializers 53 | java = "akka.serialization.JavaSerializer" 54 | kryo = "com.romix.akka.serialization.kryo.KryoSerializer" 55 | } 56 | kryo { #Kryo settings 57 | type = "graph" 58 | idstrategy = "explicit" #it must use explicit 59 | serializer-pool-size = 16 60 | buffer-size = 4096 61 | use-manifests = false 62 | implicit-registration-logging = true 63 | kryo-trace = false 64 | classes = [ 65 | "java.lang.String", 66 | "scala.Some", 67 | "scala.None$", 68 | "akka.util.ByteString$ByteString1C", 69 | "com.cookeem.chat.event.WsTextDown", 70 | "com.cookeem.chat.event.WsBinaryDown", 71 | "com.cookeem.chat.event.ClusterText", 72 | "com.cookeem.chat.event.ClusterBinary", 73 | "com.cookeem.chat.event.UserOnline", 74 | "com.cookeem.chat.event.UserOffline$" 75 | ] 76 | } 77 | serialization-bindings { 78 | "java.lang.String"=kryo 79 | "scala.Some"=kryo 80 | "scala.None$"=kryo 81 | "akka.util.ByteString$ByteString1C"=kryo 82 | "com.cookeem.chat.event.WsTextDown"=kryo 83 | "com.cookeem.chat.event.WsBinaryDown"=kryo 84 | "com.cookeem.chat.event.ClusterText"=kryo 85 | "com.cookeem.chat.event.ClusterBinary"=kryo 86 | "com.cookeem.chat.event.UserOnline"=kryo 87 | "com.cookeem.chat.event.UserOffline$"=kryo 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | mongo: 4 | image: mongo:3.4.4 5 | container_name: mongo 6 | hostname: mongo 7 | volumes: 8 | - ./mongo:/data/db 9 | ports: 10 | - "27017:27017" 11 | cookim1: 12 | image: cookeem/cookim 13 | container_name: cookim1 14 | hostname: cookim1 15 | environment: 16 | HOST_NAME: cookim1 17 | WEB_PORT: 8080 18 | AKKA_PORT: 2551 19 | SEED_NODES: cookim1:2551 20 | MONGO_URI: mongodb://mongo:27017/local 21 | ports: 22 | - "8080:8080" 23 | depends_on: 24 | - mongo 25 | cookim2: 26 | image: cookeem/cookim 27 | container_name: cookim2 28 | hostname: cookim2 29 | environment: 30 | HOST_NAME: cookim2 31 | WEB_PORT: 8080 32 | AKKA_PORT: 2551 33 | SEED_NODES: cookim1:2551 34 | MONGO_URI: mongodb://mongo:27017/local 35 | ports: 36 | - "8081:8080" 37 | depends_on: 38 | - mongo 39 | - cookim1 40 | -------------------------------------------------------------------------------- /docs/CookIM-ChatStream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/docs/CookIM-ChatStream.png -------------------------------------------------------------------------------- /docs/CookIM-Flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/docs/CookIM-Flow.png -------------------------------------------------------------------------------- /docs/cookim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/docs/cookim.png -------------------------------------------------------------------------------- /docs/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/docs/screen.png -------------------------------------------------------------------------------- /docs/screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/docs/screen2.png -------------------------------------------------------------------------------- /kubernetes/cookim.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: cookim 6 | labels: 7 | app: cookim 8 | spec: 9 | type: NodePort 10 | selector: 11 | app: cookim 12 | ports: 13 | - name: port-80 14 | port: 80 15 | targetPort: 80 16 | nodePort: 30205 17 | 18 | --- 19 | kind: Service 20 | apiVersion: v1 21 | metadata: 22 | name: cookim-headless 23 | labels: 24 | app: cookim-headless 25 | spec: 26 | clusterIP: None 27 | ports: 28 | - name: tcp-2551 29 | protocol: TCP 30 | port: 2551 31 | - name: tcp-80 32 | protocol: TCP 33 | port: 80 34 | selector: 35 | app: cookim 36 | 37 | --- 38 | apiVersion: policy/v1beta1 39 | kind: PodDisruptionBudget 40 | metadata: 41 | name: cookim-budget 42 | spec: 43 | selector: 44 | matchLabels: 45 | app: cookim 46 | minAvailable: 2 47 | 48 | --- 49 | apiVersion: apps/v1beta1 50 | kind: StatefulSet 51 | metadata: 52 | name: cookim 53 | spec: 54 | serviceName: cookim-headless 55 | replicas: 3 56 | template: 57 | metadata: 58 | labels: 59 | app: cookim 60 | annotations: 61 | pod.alpha.kubernetes.io/initialized: "true" 62 | scheduler.alpha.kubernetes.io/affinity: > 63 | { 64 | "podAntiAffinity": { 65 | "requiredDuringSchedulingRequiredDuringExecution": [{ 66 | "labelSelector": { 67 | "matchExpressions": [{ 68 | "key": "app", 69 | "operator": "In", 70 | "values": ["cookim-headless"] 71 | }] 72 | }, 73 | "topologyKey": "kubernetes.io/hostname" 74 | }] 75 | } 76 | } 77 | 78 | # pod.beta.kubernetes.io/init-containers: '[ 79 | # { 80 | # "name": "install", 81 | # "image": "k8s-registry:5000/centos:latest", 82 | # "command": ["bash", "-c", " 83 | # IFS=- read -r -a array <<< $(hostname) \n 84 | # ordinal=${array[-1]} \n 85 | # echo cookim-$ordinal >> /cookim-data/a.txt \n 86 | # "], 87 | # "volumeMounts": [ 88 | # { 89 | # "name": "esgv", 90 | # "mountPath": "/cookim-data" 91 | # } 92 | # ] 93 | # } 94 | # ]' 95 | 96 | spec: 97 | volumes: 98 | - name: localtime 99 | hostPath: 100 | path: /etc/localtime 101 | - name: timezone 102 | hostPath: 103 | path: /etc/timezone 104 | containers: 105 | - name: cookim 106 | imagePullPolicy: Always 107 | image: k8s-registry:5000/cookeem/cookim:0.2.3-SNAPSHOT 108 | ports: 109 | - containerPort: 2551 110 | protocol: TCP 111 | - containerPort: 80 112 | protocol: TCP 113 | env: 114 | - name: "WEB_PORT" 115 | value: "80" 116 | - name: "AKKA_PORT" 117 | value: "2551" 118 | - name: "SEED_NODES" 119 | value: "cookim-0.cookim-headless.default.svc.cluster.local:2551" 120 | volumeMounts: 121 | - name: localtime 122 | mountPath: "/etc/localtime" 123 | readOnly: true 124 | - name: timezone 125 | mountPath: "/etc/timezone" 126 | readOnly: true 127 | resources: 128 | requests: 129 | memory: "1Gi" 130 | limits: 131 | memory: "2Gi" 132 | 133 | -------------------------------------------------------------------------------- /project/assembly.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.0") -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.15 2 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | logLevel := Level.Debug 2 | -------------------------------------------------------------------------------- /src/main/resources/mykeystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/src/main/resources/mykeystore.jks -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/common/CommonUtils.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.common 2 | 3 | import java.io.File 4 | import java.security.MessageDigest 5 | import java.text.SimpleDateFormat 6 | 7 | import com.typesafe.config.ConfigFactory 8 | import org.joda.time.DateTime 9 | import play.api.libs.json.{JsArray, JsNumber, JsString, JsValue} 10 | 11 | /** 12 | * Created by cookeem on 16/9/25. 13 | */ 14 | object CommonUtils { 15 | val config = ConfigFactory.parseFile(new File("conf/application.conf")) 16 | 17 | val configMongo = config.getConfig("mongodb") 18 | val configMongoDbname = configMongo.getString("dbname") 19 | var configMongoUri = configMongo.getString("uri") 20 | 21 | val configJwt = config.getConfig("jwt") 22 | val configJwtSecret = configJwt.getString("secret") 23 | 24 | val configSsl = config.getConfig("ssl") 25 | val configSslSecret = configSsl.getString("storeSecret") 26 | 27 | case class CustomException(message: String = "", cause: Throwable = null) extends Exception(message, cause) 28 | 29 | def consoleLog(logType: String, msg: String) = { 30 | val timeStr = new DateTime().toString("yyyy-MM-dd HH:mm:ss") 31 | println(s"[$logType] $timeStr: $msg") 32 | } 33 | 34 | def md5(bytes: Array[Byte]) = { 35 | MessageDigest.getInstance("MD5").digest(bytes).map("%02x".format(_)).mkString 36 | } 37 | 38 | def getJsonString(json: JsValue, field: String, default: String = ""): String = { 39 | val ret = (json \ field).getOrElse(JsString(default)).as[String] 40 | ret 41 | } 42 | 43 | def getJsonInt(json: JsValue, field: String, default: Int = 0): Int = { 44 | val ret = (json \ field).getOrElse(JsNumber(default)).as[Int] 45 | ret 46 | } 47 | 48 | def getJsonLong(json: JsValue, field: String, default: Long = 0L): Long = { 49 | val ret = (json \ field).getOrElse(JsNumber(default)).as[Long] 50 | ret 51 | } 52 | 53 | def getJsonDouble(json: JsValue, field: String, default: Double = 0D): Double = { 54 | val ret = (json \ field).getOrElse(JsNumber(default)).as[Double] 55 | ret 56 | } 57 | 58 | def getJsonSeq(json: JsValue, field: String, default: Seq[JsValue] = Seq[JsValue]()): Seq[JsValue] = { 59 | val ret = (json \ field).getOrElse(JsArray(default)).as[Seq[JsValue]] 60 | ret 61 | } 62 | 63 | //从参数Map中获取Int 64 | def paramsGetInt(params: Map[String, String], key: String, default: Int): Int = { 65 | var ret = default 66 | if (params.contains(key)) { 67 | try { 68 | ret = params(key).toInt 69 | } catch { 70 | case e: Throwable => 71 | } 72 | } 73 | ret 74 | } 75 | 76 | //从参数Map中获取String 77 | def paramsGetString(params: Map[String, String], key: String, default: String): String = { 78 | var ret = default 79 | if (params.contains(key)) { 80 | ret = params(key) 81 | } 82 | ret 83 | } 84 | 85 | def sha1(str: String) = MessageDigest.getInstance("SHA-1").digest(str.getBytes).map("%02x".format(_)).mkString 86 | 87 | def md5(str: String) = MessageDigest.getInstance("MD5").digest(str.getBytes).map("%02x".format(_)).mkString 88 | 89 | def isEmail(email: String): Boolean = { 90 | """(?=[^\s]+)(?=(\w+)@([\w\.]+))""".r.findFirstIn(email).isDefined 91 | } 92 | 93 | def timeToStr(time: Long = System.currentTimeMillis()) = { 94 | val sdf = new SimpleDateFormat("MM-dd HH:mm:ss") 95 | sdf.format(time) 96 | } 97 | 98 | def classToMap(c: AnyRef): Map[String, String] = { 99 | c.getClass.getDeclaredFields.map{ f => 100 | f.setAccessible(true) 101 | f.getName -> f.get(c).toString 102 | }.toMap 103 | } 104 | 105 | def trimUtf8(str: String, len: Int) = { 106 | var i = 0 107 | var strNew = "" 108 | str.foreach { ch => 109 | if (i < len) { 110 | strNew = strNew + ch 111 | } 112 | var charLen = ch.toString.getBytes.length 113 | if (charLen > 2) { 114 | charLen = 2 115 | } 116 | i = i + charLen 117 | } 118 | strNew 119 | } 120 | 121 | } 122 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/demo/TestObj.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.demo 2 | 3 | import java.util.Date 4 | 5 | import io.jsonwebtoken.{Jwts, SignatureAlgorithm} 6 | import io.jsonwebtoken.impl.crypto.MacProvider 7 | 8 | import scala.collection.JavaConversions._ 9 | /** 10 | * Created by cookeem on 16/9/26. 11 | */ 12 | object TestObj extends App { 13 | val key = MacProvider.generateKey() 14 | val str = "Haijian" 15 | val map = Map( 16 | "username" -> "haijian", 17 | "uid" -> 1234, 18 | "lat" -> 12.34D, 19 | "lng" -> 56.78F, 20 | "long" -> System.currentTimeMillis(), 21 | "date" -> new Date(), 22 | "friends" -> Array(1, 2, 3, 4) 23 | ).asInstanceOf[Map[String, AnyRef]] 24 | val compactJws = Jwts 25 | .builder() 26 | .setExpiration(new Date(System.currentTimeMillis() + 120 * 1000)) 27 | .setSubject(str) 28 | .setHeaderParams(map) 29 | .signWith(SignatureAlgorithm.HS512, key) 30 | .compact() 31 | 32 | println(Jwts.parser().setSigningKey(key).parseClaimsJws(compactJws).getBody.getSubject) 33 | val header = Jwts.parser().setSigningKey(key).parse(compactJws).getHeader.entrySet().map { t => (t.getKey, t.getValue)}.toMap[String, Any] 34 | 35 | 36 | import akka.actor._ 37 | 38 | class TestActor extends Actor with ActorLogging { 39 | def receive = { 40 | case s: String => 41 | println(s"receive $s") 42 | case _ => 43 | log.error("Receive type error!") 44 | } 45 | } 46 | 47 | object TestActor { 48 | def props = Props[TestActor] 49 | } 50 | 51 | class TestClass { 52 | var name = "" 53 | 54 | def helloName() = { 55 | val system: ActorSystem = ActorSystem("system") 56 | val testActor = system.actorOf(TestActor.props, "test-actor") 57 | testActor ! name 58 | } 59 | } 60 | 61 | val c = new TestClass 62 | 63 | c.name = "haijian" 64 | 65 | c.helloName() 66 | } 67 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/event/ChatEventPackage.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.event 2 | 3 | import akka.actor.ActorRef 4 | import akka.util.ByteString 5 | import com.cookeem.chat.common.CommonUtils._ 6 | 7 | /** 8 | * Created by cookeem on 16/11/2. 9 | */ 10 | 11 | //akka stream message type 12 | sealed trait WsMessageUp { 13 | val uid: String 14 | } 15 | case class WsTextUp(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, content: String) extends WsMessageUp 16 | case class WsBinaryUp(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, bs: ByteString, fileName: String, fileSize: Long, fileType: String) extends WsMessageUp 17 | 18 | //akka stream message type 19 | sealed trait WsMessageDown 20 | case class WsTextDown(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, content: String, dateline: String = timeToStr(System.currentTimeMillis())) extends WsMessageDown 21 | case class WsBinaryDown(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, fileName: String, fileType: String, fileid: String, thumbid: String, dateline: String = timeToStr(System.currentTimeMillis())) extends WsMessageDown 22 | 23 | //akka stream message type 24 | case class UserOnline(actor: ActorRef) extends WsMessageDown 25 | case object UserOffline extends WsMessageDown 26 | 27 | //akka cluster message type 28 | case class ClusterText(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, content: String, dateline: String = timeToStr(System.currentTimeMillis())) extends WsMessageDown 29 | case class ClusterBinary(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, fileName: String, fileType: String, fileid: String, thumbid: String, dateline: String = timeToStr(System.currentTimeMillis())) extends WsMessageDown 30 | 31 | //client message type 32 | case class ChatMessage(uid: String, nickname: String, avatar: String, msgType: String, content: String, fileName: String, fileType: String, fileid: String, thumbid: String, dateline: String = timeToStr(System.currentTimeMillis())) extends WsMessageDown 33 | case class PushMessage(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String, msgType: String, content: String, fileName: String, fileType: String, fileid: String, thumbid: String, dateline: String = timeToStr(System.currentTimeMillis())) extends WsMessageDown 34 | 35 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/jwt/JwtOps.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.jwt 2 | 3 | import java.util.Date 4 | 5 | import com.cookeem.chat.common.CommonUtils.configJwtSecret 6 | 7 | import io.jsonwebtoken.{Jwts, SignatureAlgorithm} 8 | 9 | import scala.collection.JavaConversions._ 10 | /** 11 | * Created by cookeem on 16/11/3. 12 | */ 13 | object JwtOps { 14 | val expireMs = 15 * 60 * 1000L 15 | 16 | def encodeJwt(payload: Map[String, Any], expireMs: Long = expireMs): String = { 17 | try { 18 | val jwtBuilder = Jwts.builder() 19 | .setHeaderParams(payload.asInstanceOf[Map[String, AnyRef]]) 20 | .signWith(SignatureAlgorithm.HS512, configJwtSecret) 21 | if (expireMs > 0) { 22 | jwtBuilder.setExpiration(new Date(System.currentTimeMillis() + expireMs)) 23 | } 24 | jwtBuilder.compact() 25 | } catch { 26 | case e: Throwable => 27 | "" 28 | } 29 | } 30 | 31 | def decodeJwt(jwtStr: String): Map[String, Any] = { 32 | try { 33 | Jwts.parser().setSigningKey(configJwtSecret).parse(jwtStr).getHeader.entrySet().map { t => (t.getKey, t.getValue)}.toMap[String, Any] 34 | } catch { 35 | case e: Throwable => 36 | Map[String, Any]() 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/mongo/package.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat 2 | 3 | import java.util.Date 4 | 5 | /** 6 | * Created by cookeem on 16/11/1. 7 | */ 8 | package object mongo { 9 | //mongoDB schema 10 | trait BaseMongoObj { var _id: String } 11 | case class User(var _id: String, login: String, nickname: String, password: String, gender: Int, avatar: String, lastLogin: Long = 0, loginCount: Int = 0, sessionsStatus: List[SessionStatus] = List(), friends: List[String] = List(), dateline: Long = System.currentTimeMillis()) extends BaseMongoObj 12 | case class SessionStatus(sessionid: String, newCount: Int) 13 | case class Session(var _id: String, createuid: String, ouid: String, var sessionName: String, var sessionIcon: String, sessionType: Int, publicType: Int, usersStatus: List[UserStatus] = List(), lastMsgid: String = "", lastUpdate: Long = System.currentTimeMillis(), dateline: Long = System.currentTimeMillis()) extends BaseMongoObj 14 | case class UserStatus(uid: String, online: Boolean) 15 | case class Message(var _id: String, uid: String, sessionid: String, msgType: String, content: String = "", fileName: String = "", fileType: String = "", fileid: String = "", thumbid: String = "", dateline: Long = System.currentTimeMillis()) extends BaseMongoObj 16 | case class Online(var _id: String, uid: String, dateline: Date = new Date()) extends BaseMongoObj 17 | case class Notification(var _id: String, noticeType: String, senduid: String, recvuid: String, sessionid: String, isRead: Int = 0, dateline: Long = System.currentTimeMillis()) extends BaseMongoObj 18 | 19 | //mongoDB update result 20 | case class UpdateResult(n: Int, errmsg: String) 21 | 22 | //user and session token info 23 | case class UserToken(uid: String, nickname: String, avatar: String) 24 | case class SessionToken(sessionid: String, sessionName: String, sessionIcon: String) 25 | case class UserSessionInfo(uid: String, nickname: String, avatar: String, sessionid: String, sessionName: String, sessionIcon: String) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/restful/Route.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.restful 2 | 3 | 4 | import akka.actor.{ActorRef, ActorSystem} 5 | import akka.http.scaladsl.model.{HttpRequest, StatusCodes} 6 | import akka.http.scaladsl.server.Directives._ 7 | import akka.http.scaladsl.server._ 8 | import akka.stream.ActorMaterializer 9 | import com.cookeem.chat.restful.RouteOps._ 10 | import org.joda.time.DateTime 11 | 12 | import scala.concurrent.{ExecutionContext, Future} 13 | 14 | /** 15 | * Created by cookeem on 16/11/2. 16 | */ 17 | object Route { 18 | def badRequest(request: HttpRequest): StandardRoute = { 19 | val method = request.method.value.toLowerCase 20 | val path = request.getUri().path() 21 | val queryString = request.getUri().rawQueryString().orElse("") 22 | method match { 23 | case _ => 24 | complete((StatusCodes.NotFound, "404 error, resource not found!")) 25 | } 26 | } 27 | 28 | //log duration and request info route 29 | def logDuration(inner: Route)(implicit ec: ExecutionContext): Route = { ctx => 30 | val rejectionHandler = RejectionHandler.default 31 | val start = System.currentTimeMillis() 32 | val innerRejectionsHandled = handleRejections(rejectionHandler)(inner) 33 | mapResponse { resp => 34 | val currentTime = new DateTime() 35 | val currentTimeStr = currentTime.toString("yyyy-MM-dd HH:mm:ss") 36 | val duration = System.currentTimeMillis() - start 37 | var remoteAddress = "" 38 | var userAgent = "" 39 | var rawUri = "" 40 | ctx.request.headers.foreach(header => { 41 | //this setting come from nginx 42 | if (header.name() == "X-Real-Ip") { 43 | remoteAddress = header.value() 44 | } 45 | if (header.name() == "User-Agent") { 46 | userAgent = header.value() 47 | } 48 | //you must set akka.http.raw-request-uri-header=on config 49 | if (header.name() == "Raw-Request-URI") { 50 | rawUri = header.value() 51 | } 52 | }) 53 | Future { 54 | val mapPattern = Seq("chat") 55 | var isIgnore = false 56 | mapPattern.foreach(pattern => 57 | isIgnore = isIgnore || rawUri.startsWith(s"/$pattern") 58 | ) 59 | if (!isIgnore) { 60 | println(s"# $currentTimeStr ${ctx.request.uri} [$remoteAddress] [${ctx.request.method.name}] [${resp.status.value}] [$userAgent] took: ${duration}ms") 61 | } 62 | } 63 | resp 64 | }(innerRejectionsHandled)(ctx) 65 | } 66 | 67 | def routeRoot(implicit ec: ExecutionContext, system: ActorSystem, materializer: ActorMaterializer, notificationActor: ActorRef) = { 68 | routeLogic ~ 69 | extractRequest { request => 70 | badRequest(request) 71 | } 72 | } 73 | 74 | def logRoute(implicit ec: ExecutionContext, system: ActorSystem, materializer: ActorMaterializer, notificationActor: ActorRef) = logDuration(routeRoot) 75 | } 76 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/websocket/NotificationActor.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.websocket 2 | 3 | import akka.cluster.pubsub.{DistributedPubSub, DistributedPubSubMediator} 4 | import com.cookeem.chat.event._ 5 | import com.cookeem.chat.mongo.MongoLogic._ 6 | 7 | /** 8 | * Created by cookeem on 16/9/25. 9 | */ 10 | class NotificationActor extends TraitPubSubActor { 11 | import DistributedPubSubMediator._ 12 | val mediator = DistributedPubSub(context.system).mediator 13 | 14 | def receive: Receive = eventReceive orElse { 15 | //push message to ChatSessionActor and PushSessionActor 16 | case WsTextDown(uid, nickname, avatar, sessionid, sessionName, sessionIcon, msgType, content, dateline) if uid != "" && nickname != "" && avatar != "" && sessionid != "" => 17 | mediator ! Publish(sessionid, ClusterText(uid, nickname, avatar, sessionid, sessionName, sessionIcon, msgType, content, dateline)) 18 | createMessage(uid, sessionid, msgType, content = content) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/scala/com/cookeem/chat/websocket/TraitPubSubActor.scala: -------------------------------------------------------------------------------- 1 | package com.cookeem.chat.websocket 2 | 3 | import akka.actor.Actor 4 | import akka.cluster.Cluster 5 | import akka.cluster.ClusterEvent._ 6 | import com.cookeem.chat.common.CommonUtils._ 7 | 8 | /** 9 | * Created by cookeem on 16/9/25. 10 | */ 11 | trait TraitPubSubActor extends Actor { 12 | val cluster = Cluster(context.system) 13 | 14 | override def preStart(): Unit = { 15 | cluster.subscribe(self, initialStateMode = InitialStateAsEvents, classOf[MemberEvent], classOf[UnreachableMember], classOf[LeaderChanged]) 16 | } 17 | 18 | override def postStop(): Unit = { 19 | cluster.unsubscribe(self) 20 | consoleLog("ERROR", s"*** ${context.system} context.system.terminate!!! ") 21 | context.system.terminate() 22 | } 23 | 24 | def eventReceive: Receive = { 25 | case MemberUp(member) => 26 | // println(s"*** Member is Up: $self ${member.address}") 27 | case UnreachableMember(member) => 28 | cluster.down(member.address) 29 | // println(s"*** Member Unreachable: $self ${member.address}") 30 | case MemberRemoved(member, previousStatus) => 31 | // println(s"*** Member is Removed: $self ${member.address} after $previousStatus") 32 | case MemberExited(member) => 33 | // println(s"*** Member is Exited: $self ${member.address}") 34 | case LeaderChanged(leader) => 35 | // println(s"*** Leader is Changed: $self $leader") 36 | case evt: MemberEvent => // ignore 37 | // println(s"*** Memver event $self ${evt.member.status} ${evt.member.address}") 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /www/changeinfo.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
Set User Profile
5 |
6 |
7 |
8 |
9 |
10 | 11 | 12 |
Select your avatar
13 |
14 |
15 |
16 |
17 |
18 | face 19 | 20 | 21 |
22 |
23 |
24 |
25 |
26 | 27 | 33 |
34 |
35 | 36 | 42 |
43 |
44 |
45 |
46 | 49 |
50 |
51 |
52 |
53 |
-------------------------------------------------------------------------------- /www/changepwd.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
Change Login Password
5 |
6 |
7 |
8 |
9 | lock 10 | 11 | 12 |
13 |
14 |
15 |
16 | vpn_key 17 | 18 | 19 |
20 |
21 |
22 |
23 | vpn_key 24 | 25 | 26 |
27 |
28 |
29 | 32 |
33 |
34 |
35 |
36 |
-------------------------------------------------------------------------------- /www/chatlist.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 9 |
10 | 37 |
38 |
-------------------------------------------------------------------------------- /www/error.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Error encounter!

5 |
6 |
7 |
8 | 9 |
10 |
11 |
12 |
13 | error {{errmsg}} 14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 24 |
25 |
-------------------------------------------------------------------------------- /www/fonts/Material_Icon/MaterialIcons-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/Material_Icon/MaterialIcons-Regular.eot -------------------------------------------------------------------------------- /www/fonts/Material_Icon/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/Material_Icon/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /www/fonts/Material_Icon/MaterialIcons-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/Material_Icon/MaterialIcons-Regular.woff -------------------------------------------------------------------------------- /www/fonts/Material_Icon/MaterialIcons-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/Material_Icon/MaterialIcons-Regular.woff2 -------------------------------------------------------------------------------- /www/fonts/Material_Icon/material-icons.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Material Icons'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: url(MaterialIcons-Regular.eot); /* For IE6-8 */ 6 | src: local('Material Icons'), 7 | local('MaterialIcons-Regular'), 8 | url(MaterialIcons-Regular.woff2) format('woff2'), 9 | url(MaterialIcons-Regular.woff) format('woff'), 10 | url(MaterialIcons-Regular.ttf) format('truetype'); 11 | } 12 | 13 | .material-icons { 14 | font-family: 'Material Icons'; 15 | font-weight: normal; 16 | font-style: normal; 17 | font-size: 24px; /* Preferred icon size */ 18 | display: inline-block; 19 | line-height: 1; 20 | text-transform: none; 21 | letter-spacing: normal; 22 | word-wrap: normal; 23 | white-space: nowrap; 24 | direction: ltr; 25 | 26 | /* Support for all WebKit browsers. */ 27 | -webkit-font-smoothing: antialiased; 28 | /* Support for Safari and Chrome. */ 29 | text-rendering: optimizeLegibility; 30 | 31 | /* Support for Firefox. */ 32 | -moz-osx-font-smoothing: grayscale; 33 | 34 | /* Support for IE. */ 35 | font-feature-settings: 'liga'; 36 | } 37 | -------------------------------------------------------------------------------- /www/fonts/baloo-bhai-v1-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/baloo-bhai-v1-latin-regular.eot -------------------------------------------------------------------------------- /www/fonts/baloo-bhai-v1-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/baloo-bhai-v1-latin-regular.ttf -------------------------------------------------------------------------------- /www/fonts/baloo-bhai-v1-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/baloo-bhai-v1-latin-regular.woff -------------------------------------------------------------------------------- /www/fonts/baloo-bhai-v1-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/baloo-bhai-v1-latin-regular.woff2 -------------------------------------------------------------------------------- /www/fonts/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Open Sans'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: url(open-sans-v13-latin-regular.eot); /* For IE6-8 */ 6 | src: local('Open Sans'), local('OpenSans'), 7 | url(open-sans-v13-latin-regular.eot) format('embedded-opentype'), 8 | url(open-sans-v13-latin-regular.woff) format('woff'), 9 | url(open-sans-v13-latin-regular.woff2) format('woff2'), 10 | url(open-sans-v13-latin-regular.ttf) format('truetype'), 11 | url(open-sans-v13-latin-regular.svg) format('svg'); 12 | } 13 | @font-face { 14 | font-family: 'Roboto'; 15 | font-style: normal; 16 | font-weight: 400; 17 | src: url(roboto-v15-latin-regular.eot); /* For IE6-8 */ 18 | src: local('Roboto'), 19 | url(roboto-v15-latin-regular.eot) format('embedded-opentype'), 20 | url(roboto-v15-latin-regular.woff) format('woff'), 21 | url(roboto-v15-latin-regular.woff2) format('woff2'), 22 | url(roboto-v15-latin-regular.ttf) format('truetype'), 23 | url(roboto-v15-latin-regular.svg) format('svg'); 24 | } 25 | @font-face { 26 | font-family: 'Baloo Bhai'; 27 | font-style: normal; 28 | font-weight: 400; 29 | src: url(baloo-bhai-v1-latin-regular.eot); /* For IE6-8 */ 30 | src: local('Baloo Bhai'), local('BalooBhai'), 31 | url(baloo-bhai-v1-latin-regular.eot) format('embedded-opentype'), 32 | url(baloo-bhai-v1-latin-regular.woff) format('woff'), 33 | url(baloo-bhai-v1-latin-regular.woff2) format('woff2'), 34 | url(baloo-bhai-v1-latin-regular.ttf) format('truetype'), 35 | url(baloo-bhai-v1-latin-regular.svg) format('svg'); 36 | } 37 | @font-face { 38 | font-family: 'Indie Flower'; 39 | font-style: normal; 40 | font-weight: 400; 41 | src: url(indie-flower-v8-latin-regular.eot); /* For IE6-8 */ 42 | src: local('Indie Flower'), local('IndieFlower'), 43 | url(indie-flower-v8-latin-regular.eot) format('embedded-opentype'), 44 | url(indie-flower-v8-latin-regular.woff) format('woff'), 45 | url(indie-flower-v8-latin-regular.woff2) format('woff2'), 46 | url(indie-flower-v8-latin-regular.ttf) format('truetype'), 47 | url(indie-flower-v8-latin-regular.svg) format('svg'); 48 | } 49 | -------------------------------------------------------------------------------- /www/fonts/indie-flower-v8-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/indie-flower-v8-latin-regular.eot -------------------------------------------------------------------------------- /www/fonts/indie-flower-v8-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/indie-flower-v8-latin-regular.ttf -------------------------------------------------------------------------------- /www/fonts/indie-flower-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/indie-flower-v8-latin-regular.woff -------------------------------------------------------------------------------- /www/fonts/indie-flower-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/indie-flower-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /www/fonts/open-sans-v13-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/open-sans-v13-latin-regular.eot -------------------------------------------------------------------------------- /www/fonts/open-sans-v13-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/open-sans-v13-latin-regular.ttf -------------------------------------------------------------------------------- /www/fonts/open-sans-v13-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/open-sans-v13-latin-regular.woff -------------------------------------------------------------------------------- /www/fonts/open-sans-v13-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/open-sans-v13-latin-regular.woff2 -------------------------------------------------------------------------------- /www/fonts/roboto-v15-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto-v15-latin-regular.eot -------------------------------------------------------------------------------- /www/fonts/roboto-v15-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto-v15-latin-regular.ttf -------------------------------------------------------------------------------- /www/fonts/roboto-v15-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto-v15-latin-regular.woff -------------------------------------------------------------------------------- /www/fonts/roboto-v15-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto-v15-latin-regular.woff2 -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Bold.eot -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Bold.woff -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Bold.woff2 -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Light.eot -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Light.woff -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Light.woff2 -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Medium.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Medium.eot -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Medium.woff -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Medium.woff2 -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Regular.eot -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Regular.woff -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Regular.woff2 -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Thin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Thin.eot -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Thin.woff -------------------------------------------------------------------------------- /www/fonts/roboto/Roboto-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/fonts/roboto/Roboto-Thin.woff2 -------------------------------------------------------------------------------- /www/friends.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 9 | 25 |
26 | 37 |
38 |
-------------------------------------------------------------------------------- /www/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/Thumbs.db -------------------------------------------------------------------------------- /www/images/avatar/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/avatar/boy.jpg -------------------------------------------------------------------------------- /www/images/avatar/girl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/avatar/girl.jpg -------------------------------------------------------------------------------- /www/images/avatar/unknown.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/avatar/unknown.jpg -------------------------------------------------------------------------------- /www/images/cookim.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/cookim.ai -------------------------------------------------------------------------------- /www/images/cookim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/cookim.png -------------------------------------------------------------------------------- /www/images/cookim.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 17 | 20 | 23 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /www/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/favicon.ico -------------------------------------------------------------------------------- /www/images/favicon_bak.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/favicon_bak.ico -------------------------------------------------------------------------------- /www/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/file.png -------------------------------------------------------------------------------- /www/images/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/sample.jpg -------------------------------------------------------------------------------- /www/images/yuna.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/images/yuna.jpg -------------------------------------------------------------------------------- /www/js/changepwd.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/3. 3 | */ 4 | app.controller('changePwdAppCtl', function($rootScope, $scope, $cookies, $timeout, $http) { 5 | $rootScope.showSideNavbar = true; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = true; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM - Change login password", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | }, 0); 27 | 28 | $rootScope.verifyUserToken(); 29 | 30 | $rootScope.getUserTokenRepeat(); 31 | 32 | $scope.changePwdData = { 33 | "oldPwd": "", 34 | "newPwd": "", 35 | "renewPwd": "", 36 | "userToken": $rootScope.userToken 37 | }; 38 | 39 | $scope.changePwdSubmit = function() { 40 | $rootScope.verifyUserToken(); 41 | $http({ 42 | method : 'POST', 43 | url : '/api/changePwd', 44 | data : $.param($scope.changePwdData), 45 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 46 | }).then(function successCallback(response) { 47 | console.log(response.data); 48 | if (response.data.errmsg) { 49 | $rootScope.errmsg = response.data.errmsg; 50 | Materialize.toast("error: " + $rootScope.errmsg, 3000); 51 | } else { 52 | $rootScope.successmsg = response.data.successmsg; 53 | Materialize.toast($rootScope.successmsg, 3000); 54 | window.location.href = '#!/chatlist/joined'; 55 | } 56 | }, function errorCallback(response) { 57 | console.error("http request error:" + response.data); 58 | }); 59 | }; 60 | 61 | }); -------------------------------------------------------------------------------- /www/js/chatlist.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/3. 3 | */ 4 | app.controller('chatListAppCtl', function($rootScope, $scope, $cookies, $timeout, $routeParams, $http) { 5 | $rootScope.showSideNavbar = true; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = true; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | }, 1000); 27 | 28 | $rootScope.getUserTokenRepeat(); 29 | 30 | $scope.listSessionsData = { 31 | "isPublic": 0, 32 | "userToken": $rootScope.userToken 33 | }; 34 | $scope.querystring = $routeParams.querystring; 35 | if ($scope.querystring != "public") { 36 | $scope.listSessionsData.isPublic = 0; 37 | $rootScope.titleInfo.title = 'CookIM - Chats joined'; 38 | } else { 39 | $scope.listSessionsData.isPublic = 1; 40 | $rootScope.titleInfo.title = 'CookIM - Chats public'; 41 | } 42 | $scope.listSessionsSubmit = function() { 43 | $rootScope.listSessionsResults = []; 44 | $http({ 45 | method : 'POST', 46 | url : '/api/listSessions', 47 | data : $.param($scope.listSessionsData), 48 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 49 | }).then(function successCallback(response) { 50 | console.log(response.data); 51 | if (response.data.errmsg) { 52 | $rootScope.errmsg = response.data.errmsg; 53 | Materialize.toast($rootScope.errmsg, 4000); 54 | } else { 55 | $rootScope.listSessionsResults = response.data.sessions; 56 | } 57 | }, function errorCallback(response) { 58 | console.error("http request error:" + response.data); 59 | }); 60 | }; 61 | 62 | $scope.listSessionsSubmit(); 63 | 64 | if (!$rootScope.wsPushSession) { 65 | $rootScope.listenPush(); 66 | } 67 | 68 | }); -------------------------------------------------------------------------------- /www/js/error.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/2. 3 | */ 4 | app.controller('errorAppCtl', function($rootScope, $timeout) { 5 | $rootScope.showSideNavbar = false; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = false; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM - Error encounter", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | $('label').addClass('active'); 27 | }, 0); 28 | }); -------------------------------------------------------------------------------- /www/js/friends.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/2. 3 | */ 4 | app.controller('friendsAppCtl', function($rootScope, $scope, $http, $timeout) { 5 | $rootScope.showSideNavbar = true; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = true; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM - Friends", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | $('.tooltipped').tooltip({delay: 50}); 27 | }, 0); 28 | 29 | $rootScope.getUserTokenRepeat(); 30 | $scope.searchResult = []; 31 | $rootScope.getFriendsByNickname = function(nickName) { 32 | $rootScope.verifyUserToken(); 33 | var postData = { 34 | "userToken": $rootScope.userToken, 35 | "nickName" : nickName 36 | }; 37 | $http({ 38 | method : 'POST', 39 | url : '/api/getUserInfoByName', 40 | data : $.param(postData), 41 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 42 | }).then(function successCallback(response) { 43 | console.log(response.data); 44 | if (response.data.errmsg) { 45 | $rootScope.errmsg = response.data.errmsg; 46 | window.location.href = '#!/error'; 47 | } else { 48 | $scope.searchResult = response.data.userInfo; 49 | console.log($scope.searchResult); 50 | } 51 | }, function errorCallback(response) { 52 | console.error("http request error:" + response.data); 53 | }); 54 | }; 55 | $scope.friends = []; 56 | $scope.getFriendsSubmit = function() { 57 | $rootScope.verifyUserToken(); 58 | var postData = { 59 | "userToken": $rootScope.userToken 60 | }; 61 | $http({ 62 | method : 'POST', 63 | url : '/api/getFriends', 64 | data : $.param(postData), 65 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 66 | }).then(function successCallback(response) { 67 | console.log(response.data); 68 | if (response.data.errmsg) { 69 | $rootScope.errmsg = response.data.errmsg; 70 | window.location.href = '#!/error'; 71 | } else { 72 | $scope.friends = response.data.friends; 73 | } 74 | }, function errorCallback(response) { 75 | console.error("http request error:" + response.data); 76 | }); 77 | }; 78 | $scope.getFriendsSubmit(); 79 | }); -------------------------------------------------------------------------------- /www/js/login.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/3. 3 | */ 4 | app.controller('loginAppCtl', function($rootScope, $scope, $cookies, $timeout, $http) { 5 | $rootScope.showSideNavbar = false; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = false; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM - User login", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | $('label').addClass('active'); 27 | }, 0); 28 | 29 | var cookie_login = ""; 30 | var cookie_password = ""; 31 | var cookie_remember = false; 32 | if ($cookies.get('login')) { 33 | cookie_login = $cookies.get('login'); 34 | } 35 | if ($cookies.get('password')) { 36 | cookie_password = $cookies.get('password'); 37 | } 38 | if ($cookies.get('remember')) { 39 | cookie_remember = true; 40 | } 41 | $scope.loginData = { 42 | "login": cookie_login, 43 | "password": cookie_password, 44 | "remember": cookie_remember 45 | }; 46 | 47 | $scope.loginSubmit = function() { 48 | $scope.submitData = { 49 | "login": $scope.loginData.login, 50 | "password": $scope.loginData.password 51 | }; 52 | 53 | $http({ 54 | method : 'POST', 55 | url : '/api/loginUser', 56 | data : $.param($scope.submitData), 57 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 58 | }).then(function successCallback(response) { 59 | console.log(response.data); 60 | if ($scope.loginData.remember) { 61 | $cookies.put('login', $scope.loginData.login); 62 | $cookies.put('password', $scope.loginData.password); 63 | $cookies.put('remember', $scope.loginData.remember); 64 | } else { 65 | $cookies.remove('login'); 66 | $cookies.remove('password'); 67 | $cookies.remove('remember'); 68 | } 69 | if (response.data.errmsg) { 70 | $rootScope.errmsg = response.data.errmsg; 71 | Materialize.toast("error: " + $rootScope.errmsg, 3000); 72 | } else { 73 | $rootScope.setCookieUserToken(response.data.uid, response.data.userToken); 74 | $rootScope.successmsg = response.data.successmsg; 75 | Materialize.toast($rootScope.successmsg, 3000); 76 | 77 | //redirect url 78 | window.location.href = '#!/chatlist/joined'; 79 | } 80 | }, function errorCallback(response) { 81 | console.error("http request error:" + response.data); 82 | }); 83 | } 84 | }); 85 | 86 | 87 | -------------------------------------------------------------------------------- /www/js/logout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/2. 3 | */ 4 | app.controller('logoutAppCtl', function($rootScope, $scope, $cookies, $http, $timeout) { 5 | //Hide sidebar when init 6 | $rootScope.showSideNavbar = false; 7 | $rootScope.showAccoutMenu = false; 8 | //Hide footer when init 9 | $rootScope.showMessageArea = false; 10 | $timeout(function() { 11 | showHideSideBar($rootScope.showSideNavbar); 12 | $(window).resize(function() { 13 | showHideSideBar($rootScope.showSideNavbar); 14 | }); 15 | $('label').addClass('active'); 16 | }, 0); 17 | 18 | $rootScope.verifyUserToken(); 19 | 20 | $scope.logoutSubmit = function() { 21 | var submitData = { 22 | "userToken": $rootScope.userToken 23 | }; 24 | 25 | $http({ 26 | method : 'POST', 27 | url : '/api/logoutUser', 28 | data : $.param(submitData), 29 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 30 | }).then(function successCallback(response) { 31 | console.log(response.data); 32 | if (response.data.errmsg) { 33 | $rootScope.errmsg = response.data.errmsg; 34 | Materialize.toast("error: " + $rootScope.errmsg, 3000); 35 | window.history.back(); 36 | } else { 37 | $cookies.remove('uid'); 38 | $cookies.remove('userToken'); 39 | $rootScope.uid = ""; 40 | $rootScope.userToken = ""; 41 | 42 | $rootScope.successmsg = response.data.successmsg; 43 | Materialize.toast($rootScope.successmsg, 3000); 44 | 45 | $rootScope.getUserTokenStop(); 46 | 47 | if ($rootScope.wsPushSession) { 48 | $rootScope.closeWs($rootScope.wsPushSession); 49 | } 50 | 51 | window.location.href = '#!/login'; 52 | } 53 | }, function errorCallback(response) { 54 | console.error("http request error:" + response.data); 55 | }); 56 | }; 57 | $scope.logoutSubmit(); 58 | }); -------------------------------------------------------------------------------- /www/js/notifications.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/2. 3 | */ 4 | app.controller('notificationsAppCtl', function($rootScope, $timeout, $scope, $http) { 5 | $rootScope.showSideNavbar = true; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = true; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM - Notifications", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | $('label').addClass('active'); 27 | }, 0); 28 | 29 | $rootScope.getUserTokenRepeat(); 30 | 31 | $scope.notifications = []; 32 | $scope.getNotificationsSubmit = function() { 33 | $rootScope.verifyUserToken(); 34 | var postData = { 35 | "userToken": $rootScope.userToken 36 | }; 37 | $http({ 38 | method : 'POST', 39 | url : '/api/getNotifications', 40 | data : $.param(postData), 41 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 42 | }).then(function successCallback(response) { 43 | console.log(response.data); 44 | if (response.data.errmsg) { 45 | $rootScope.errmsg = response.data.errmsg; 46 | window.location.href = '#!/error'; 47 | } else { 48 | $scope.notifications = response.data.notifications; 49 | } 50 | }, function errorCallback(response) { 51 | console.error("http request error:" + response.data); 52 | }); 53 | }; 54 | $scope.getNotificationsSubmit(); 55 | 56 | }); -------------------------------------------------------------------------------- /www/js/register.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by cookeem on 16/6/3. 3 | */ 4 | app.controller('registerAppCtl', function($rootScope, $scope, $cookies, $timeout, $http) { 5 | $rootScope.showSideNavbar = false; 6 | $rootScope.showMessageArea = false; 7 | $rootScope.showAccoutMenu = false; 8 | $rootScope.titleInfo = { 9 | //private_session, group_session, other 10 | mode: "other", 11 | //title text 12 | title: "CookIM - Register user", 13 | //title icon 14 | icon: "images/cookim.svg", 15 | //useful when mode == "group_session" 16 | sessionid: "", 17 | //useful when mode == "private_session" 18 | uid: "" 19 | }; 20 | 21 | $timeout(function() { 22 | showHideSideBar($rootScope.showSideNavbar); 23 | $(window).resize(function() { 24 | showHideSideBar($rootScope.showSideNavbar); 25 | }); 26 | }, 0); 27 | 28 | $scope.registerData = { 29 | "login": "", 30 | "nickname": "", 31 | "password": "", 32 | "repassword": "", 33 | "gender": 0 34 | }; 35 | 36 | $scope.registerSubmit = function() { 37 | $http({ 38 | method : 'POST', 39 | url : '/api/registerUser', 40 | data : $.param($scope.registerData), 41 | headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } 42 | }).then(function successCallback(response) { 43 | console.log(response.data); 44 | if (response.data.errmsg) { 45 | $rootScope.errmsg = response.data.errmsg; 46 | Materialize.toast("error: " + $rootScope.errmsg, 3000); 47 | } else { 48 | $rootScope.setCookieUserToken(response.data.uid, response.data.userToken); 49 | $rootScope.successmsg = response.data.successmsg; 50 | Materialize.toast($rootScope.successmsg, 3000); 51 | 52 | //redirect url 53 | window.location.href = '#!/chatlist/public'; 54 | } 55 | }, function errorCallback(response) { 56 | console.error("http request error:" + response.data); 57 | }); 58 | } 59 | 60 | }); 61 | 62 | -------------------------------------------------------------------------------- /www/jslib/angular-animate/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Angular 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /www/jslib/angular-animate/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular-animate 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular-animate 15 | ``` 16 | 17 | Then add `ngAnimate` as a dependency for your app: 18 | 19 | ```javascript 20 | angular.module('myApp', [require('angular-animate')]); 21 | ``` 22 | 23 | ### bower 24 | 25 | ```shell 26 | bower install angular-animate 27 | ``` 28 | 29 | Then add a ` 33 | ``` 34 | 35 | Then add `ngAnimate` as a dependency for your app: 36 | 37 | ```javascript 38 | angular.module('myApp', ['ngAnimate']); 39 | ``` 40 | 41 | ## Documentation 42 | 43 | Documentation is available on the 44 | [AngularJS docs site](http://docs.angularjs.org/api/ngAnimate). 45 | 46 | ## License 47 | 48 | The MIT License 49 | 50 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 51 | 52 | Permission is hereby granted, free of charge, to any person obtaining a copy 53 | of this software and associated documentation files (the "Software"), to deal 54 | in the Software without restriction, including without limitation the rights 55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 56 | copies of the Software, and to permit persons to whom the Software is 57 | furnished to do so, subject to the following conditions: 58 | 59 | The above copyright notice and this permission notice shall be included in 60 | all copies or substantial portions of the Software. 61 | 62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 68 | THE SOFTWARE. 69 | -------------------------------------------------------------------------------- /www/jslib/angular-animate/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-animate", 3 | "version": "1.5.8", 4 | "license": "MIT", 5 | "main": "./angular-animate.js", 6 | "ignore": [], 7 | "dependencies": { 8 | "angular": "1.5.8" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /www/jslib/angular-animate/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-animate'); 2 | module.exports = 'ngAnimate'; 3 | -------------------------------------------------------------------------------- /www/jslib/angular-animate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "angular-animate@1.5.8", 5 | "/Volumes/Share/Spark_program/DistributedWebChat/www" 6 | ] 7 | ], 8 | "_cnpm_publish_time": 1469201403964, 9 | "_from": "angular-animate@1.5.8", 10 | "_id": "angular-animate@1.5.8", 11 | "_inCache": true, 12 | "_installable": true, 13 | "_location": "/angular-animate", 14 | "_nodeVersion": "4.4.7", 15 | "_npmOperationalInternal": { 16 | "host": "packages-12-west.internal.npmjs.com", 17 | "tmp": "tmp/angular-animate-1.5.8.tgz_1469201403735_0.004368406254798174" 18 | }, 19 | "_npmUser": { 20 | "email": "angular-core+npm@google.com", 21 | "name": "angularcore" 22 | }, 23 | "_npmVersion": "2.15.8", 24 | "_phantomChildren": {}, 25 | "_requested": { 26 | "name": "angular-animate", 27 | "raw": "angular-animate@1.5.8", 28 | "rawSpec": "1.5.8", 29 | "scope": null, 30 | "spec": "1.5.8", 31 | "type": "version" 32 | }, 33 | "_requiredBy": [ 34 | "/" 35 | ], 36 | "_resolved": "https://registry.npm.taobao.org/angular-animate/download/angular-animate-1.5.8.tgz", 37 | "_shasum": "535f7369225aba7fb15bf7134c71b15bc635c586", 38 | "_shrinkwrap": null, 39 | "_spec": "angular-animate@1.5.8", 40 | "_where": "/Volumes/Share/Spark_program/DistributedWebChat/www", 41 | "author": { 42 | "email": "angular-core+npm@google.com", 43 | "name": "Angular Core Team" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/angular/angular.js/issues" 47 | }, 48 | "dependencies": {}, 49 | "description": "AngularJS module for animations", 50 | "devDependencies": {}, 51 | "directories": {}, 52 | "dist": { 53 | "noattachment": false, 54 | "shasum": "535f7369225aba7fb15bf7134c71b15bc635c586", 55 | "size": 76438, 56 | "tarball": "http://registry.npm.taobao.org/angular-animate/download/angular-animate-1.5.8.tgz" 57 | }, 58 | "gitHead": "688b68844cf95420e1793327f69d0c25589c23d1", 59 | "homepage": "http://angularjs.org", 60 | "jspm": { 61 | "shim": { 62 | "angular-animate": { 63 | "deps": [ 64 | "angular" 65 | ] 66 | } 67 | } 68 | }, 69 | "keywords": [ 70 | "angular", 71 | "framework", 72 | "browser", 73 | "animation", 74 | "client-side" 75 | ], 76 | "license": "MIT", 77 | "main": "index.js", 78 | "maintainers": [ 79 | { 80 | "email": "a.kalinovski@gmail.com", 81 | "name": "akalinovski" 82 | }, 83 | { 84 | "email": "angular-core+npm@google.com", 85 | "name": "angularcore" 86 | }, 87 | { 88 | "email": "pete@bacondarwin.com", 89 | "name": "petebd" 90 | } 91 | ], 92 | "name": "angular-animate", 93 | "optionalDependencies": {}, 94 | "publish_time": 1469201403964, 95 | "readme": "ERROR: No README data found!", 96 | "repository": { 97 | "type": "git", 98 | "url": "git+https://github.com/angular/angular.js.git" 99 | }, 100 | "scripts": { 101 | "test": "echo \"Error: no test specified\" && exit 1" 102 | }, 103 | "version": "1.5.8" 104 | } 105 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Angular 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular-cookies 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular-cookies 15 | ``` 16 | 17 | Then add `ngCookies` as a dependency for your app: 18 | 19 | ```javascript 20 | angular.module('myApp', [require('angular-cookies')]); 21 | ``` 22 | 23 | ### bower 24 | 25 | ```shell 26 | bower install angular-cookies 27 | ``` 28 | 29 | Add a ` 33 | ``` 34 | 35 | Then add `ngCookies` as a dependency for your app: 36 | 37 | ```javascript 38 | angular.module('myApp', ['ngCookies']); 39 | ``` 40 | 41 | ## Documentation 42 | 43 | Documentation is available on the 44 | [AngularJS docs site](http://docs.angularjs.org/api/ngCookies). 45 | 46 | ## License 47 | 48 | The MIT License 49 | 50 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 51 | 52 | Permission is hereby granted, free of charge, to any person obtaining a copy 53 | of this software and associated documentation files (the "Software"), to deal 54 | in the Software without restriction, including without limitation the rights 55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 56 | copies of the Software, and to permit persons to whom the Software is 57 | furnished to do so, subject to the following conditions: 58 | 59 | The above copyright notice and this permission notice shall be included in 60 | all copies or substantial portions of the Software. 61 | 62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 68 | THE SOFTWARE. 69 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.5.8 3 | (c) 2010-2016 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(n,c){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,void 0,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore", 8 | ["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular); 9 | //# sourceMappingURL=angular-cookies.min.js.map 10 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/angular-cookies.min.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version":3, 3 | "file":"angular-cookies.min.js", 4 | "lineCount":8, 5 | "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CA2Q3BC,QAASA,EAAc,CAACC,CAAD,CAAYC,CAAZ,CAAkBC,CAAlB,CAA4B,CACjD,IAAIC,EAAaD,CAAAE,SAAA,EAAjB,CACIC,EAAcL,CAAA,CAAU,CAAV,CAmClB,OAAO,SAAQ,CAACM,CAAD,CAAOC,CAAP,CAAcC,CAAd,CAAuB,CAjCW,IAC3CC,CAD2C,CACrCC,CACVF,EAAA,CAgCoDA,CAhCpD,EAAqB,EACrBE,EAAA,CAAUF,CAAAE,QACVD,EAAA,CAAOX,CAAAa,UAAA,CAAkBH,CAAAC,KAAlB,CAAA,CAAkCD,CAAAC,KAAlC,CAAiDN,CACpDL,EAAAc,YAAA,CAAoBL,CAApB,CAAJ,GACEG,CACA,CADU,+BACV,CAAAH,CAAA,CAAQ,EAFV,CAIIT,EAAAe,SAAA,CAAiBH,CAAjB,CAAJ,GACEA,CADF,CACY,IAAII,IAAJ,CAASJ,CAAT,CADZ,CAIIK,EAAAA,CAAMC,kBAAA,CAqB6BV,CArB7B,CAANS,CAAiC,GAAjCA,CAAuCC,kBAAA,CAAmBT,CAAnB,CAE3CQ,EAAA,CADAA,CACA,EADON,CAAA,CAAO,QAAP,CAAkBA,CAAlB,CAAyB,EAChC,GAAOD,CAAAS,OAAA,CAAiB,UAAjB,CAA8BT,CAAAS,OAA9B,CAA+C,EAAtD,CACAF,EAAA,EAAOL,CAAA,CAAU,WAAV,CAAwBA,CAAAQ,YAAA,EAAxB,CAAgD,EACvDH,EAAA,EAAOP,CAAAW,OAAA,CAAiB,SAAjB,CAA6B,EAMhCC,EAAAA,CAAeL,CAAAM,OAAfD,CAA4B,CACb,KAAnB,CAAIA,CAAJ,EACEnB,CAAAqB,KAAA,CAAU,UAAV,CASqChB,CATrC,CACE,6DADF;AAEEc,CAFF,CAEiB,iBAFjB,CASFf,EAAAkB,OAAA,CAJOR,CAG6B,CArCW,CAzPnDjB,CAAA0B,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,SAAA,CAOY,UAPZ,CAOwB,CAACC,QAAyB,EAAG,CAwBjD,IAAIC,EAAW,IAAAA,SAAXA,CAA2B,EAiC/B,KAAAC,KAAA,CAAY,CAAC,gBAAD,CAAmB,gBAAnB,CAAqC,QAAQ,CAACC,CAAD,CAAiBC,CAAjB,CAAiC,CACxF,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOH,EAAA,EAAA,CAAiBG,CAAjB,CADU,CAXd,CAyBLC,UAAWA,QAAQ,CAACD,CAAD,CAAM,CAEvB,MAAO,CADHzB,CACG,CADK,IAAAwB,IAAA,CAASC,CAAT,CACL,EAAQlC,CAAAoC,SAAA,CAAiB3B,CAAjB,CAAR,CAAkCA,CAFlB,CAzBpB,CAuCL4B,OAAQA,QAAQ,EAAG,CACjB,MAAON,EAAA,EADU,CAvCd,CAuDLO,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACjCsB,CAAA,CAAeE,CAAf,CAAoBzB,CAApB,CAAuCC,CAvFpC,CAAUV,CAAAuC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAuF0BnB,CAvF1B,CAAV,CAAkDmB,CAuFrD,CADiC,CAvD9B,CAuELW,UAAWA,QAAQ,CAACN,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACvC,IAAA4B,IAAA,CAASJ,CAAT,CAAclC,CAAAyC,OAAA,CAAehC,CAAf,CAAd,CAAqCC,CAArC,CADuC,CAvEpC,CAsFLgC,OAAQA,QAAQ,CAACR,CAAD,CAAMxB,CAAN,CAAe,CAC7BsB,CAAA,CAAeE,CAAf,CAAoBS,IAAAA,EAApB,CAA2CjC,CAtHxC,CAAUV,CAAAuC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAsH8BnB,CAtH9B,CAAV,CAAkDmB,CAsHrD,CAD6B,CAtF1B,CADiF,CAA9E,CAzDqC,CAA7B,CAPxB,CA8JA7B,EAAA0B,OAAA,CAAe,WAAf,CAAAkB,QAAA,CAiCS,cAjCT;AAiCyB,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CAErD,MAAO,CAWLZ,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOW,EAAAV,UAAA,CAAmBD,CAAnB,CADU,CAXd,CAyBLI,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAa,CACxBoC,CAAAL,UAAA,CAAmBN,CAAnB,CAAwBzB,CAAxB,CADwB,CAzBrB,CAsCLiC,OAAQA,QAAQ,CAACR,CAAD,CAAM,CACpBW,CAAAH,OAAA,CAAgBR,CAAhB,CADoB,CAtCjB,CAF8C,CAAhC,CAjCzB,CAqIAjC,EAAA6C,QAAA,CAAyB,CAAC,WAAD,CAAc,MAAd,CAAsB,UAAtB,CAEzB9C,EAAA0B,OAAA,CAAe,WAAf,CAAAC,SAAA,CAAqC,gBAArC,CAAuDoB,QAA+B,EAAG,CACvF,IAAAjB,KAAA,CAAY7B,CAD2E,CAAzF,CAvT2B,CAA1B,CAAD,CA4TGF,MA5TH,CA4TWA,MAAAC,QA5TX;", 6 | "sources":["angular-cookies.js"], 7 | "names":["window","angular","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isUndefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","undefined","factory","$cookies","$inject","$$CookieWriterProvider"] 8 | } 9 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-cookies", 3 | "version": "1.5.8", 4 | "license": "MIT", 5 | "main": "./angular-cookies.js", 6 | "ignore": [], 7 | "dependencies": { 8 | "angular": "1.5.8" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-cookies'); 2 | module.exports = 'ngCookies'; 3 | -------------------------------------------------------------------------------- /www/jslib/angular-cookies/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "angular-cookies@1.5.8", 5 | "/Volumes/Share/Scala_program/CookIM/www" 6 | ] 7 | ], 8 | "_cnpm_publish_time": 1469201424817, 9 | "_from": "angular-cookies@1.5.8", 10 | "_id": "angular-cookies@1.5.8", 11 | "_inCache": true, 12 | "_installable": true, 13 | "_location": "/angular-cookies", 14 | "_nodeVersion": "4.4.7", 15 | "_npmOperationalInternal": { 16 | "host": "packages-12-west.internal.npmjs.com", 17 | "tmp": "tmp/angular-cookies-1.5.8.tgz_1469201424585_0.8652908557560295" 18 | }, 19 | "_npmUser": { 20 | "email": "angular-core+npm@google.com", 21 | "name": "angularcore" 22 | }, 23 | "_npmVersion": "2.15.8", 24 | "_phantomChildren": {}, 25 | "_requested": { 26 | "name": "angular-cookies", 27 | "raw": "angular-cookies@1.5.8", 28 | "rawSpec": "1.5.8", 29 | "scope": null, 30 | "spec": "1.5.8", 31 | "type": "version" 32 | }, 33 | "_requiredBy": [ 34 | "/" 35 | ], 36 | "_resolved": "https://registry.npm.taobao.org/angular-cookies/download/angular-cookies-1.5.8.tgz", 37 | "_shasum": "08f39fa2e17b6e3a916cd3ba7352f9d702e8a9fe", 38 | "_shrinkwrap": null, 39 | "_spec": "angular-cookies@1.5.8", 40 | "_where": "/Volumes/Share/Scala_program/CookIM/www", 41 | "author": { 42 | "email": "angular-core+npm@google.com", 43 | "name": "Angular Core Team" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/angular/angular.js/issues" 47 | }, 48 | "dependencies": {}, 49 | "description": "AngularJS module for cookies", 50 | "devDependencies": {}, 51 | "directories": {}, 52 | "dist": { 53 | "noattachment": false, 54 | "shasum": "08f39fa2e17b6e3a916cd3ba7352f9d702e8a9fe", 55 | "size": 6265, 56 | "tarball": "http://registry.npm.taobao.org/angular-cookies/download/angular-cookies-1.5.8.tgz" 57 | }, 58 | "gitHead": "a2247a1efb436f0293289fb74ebd76fbe52a7422", 59 | "homepage": "http://angularjs.org", 60 | "jspm": { 61 | "shim": { 62 | "angular-cookies": { 63 | "deps": [ 64 | "angular" 65 | ] 66 | } 67 | } 68 | }, 69 | "keywords": [ 70 | "angular", 71 | "framework", 72 | "browser", 73 | "cookies", 74 | "client-side" 75 | ], 76 | "license": "MIT", 77 | "main": "index.js", 78 | "maintainers": [ 79 | { 80 | "email": "angular-core+npm@google.com", 81 | "name": "angularcore" 82 | }, 83 | { 84 | "email": "pete@bacondarwin.com", 85 | "name": "petebd" 86 | } 87 | ], 88 | "name": "angular-cookies", 89 | "optionalDependencies": {}, 90 | "publish_time": 1469201424817, 91 | "readme": "ERROR: No README data found!", 92 | "repository": { 93 | "type": "git", 94 | "url": "git+https://github.com/angular/angular.js.git" 95 | }, 96 | "scripts": { 97 | "test": "echo \"Error: no test specified\" && exit 1" 98 | }, 99 | "version": "1.5.8" 100 | } 101 | -------------------------------------------------------------------------------- /www/jslib/angular-route/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Angular 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /www/jslib/angular-route/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular-route 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngRoute). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular-route 15 | ``` 16 | 17 | Then add `ngRoute` as a dependency for your app: 18 | 19 | ```javascript 20 | angular.module('myApp', [require('angular-route')]); 21 | ``` 22 | 23 | ### bower 24 | 25 | ```shell 26 | bower install angular-route 27 | ``` 28 | 29 | Add a ` 33 | ``` 34 | 35 | Then add `ngRoute` as a dependency for your app: 36 | 37 | ```javascript 38 | angular.module('myApp', ['ngRoute']); 39 | ``` 40 | 41 | ## Documentation 42 | 43 | Documentation is available on the 44 | [AngularJS docs site](http://docs.angularjs.org/api/ngRoute). 45 | 46 | ## License 47 | 48 | The MIT License 49 | 50 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 51 | 52 | Permission is hereby granted, free of charge, to any person obtaining a copy 53 | of this software and associated documentation files (the "Software"), to deal 54 | in the Software without restriction, including without limitation the rights 55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 56 | copies of the Software, and to permit persons to whom the Software is 57 | furnished to do so, subject to the following conditions: 58 | 59 | The above copyright notice and this permission notice shall be included in 60 | all copies or substantial portions of the Software. 61 | 62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 68 | THE SOFTWARE. 69 | -------------------------------------------------------------------------------- /www/jslib/angular-route/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-route", 3 | "version": "1.5.8", 4 | "license": "MIT", 5 | "main": "./angular-route.js", 6 | "ignore": [], 7 | "dependencies": { 8 | "angular": "1.5.8" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /www/jslib/angular-route/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-route'); 2 | module.exports = 'ngRoute'; 3 | -------------------------------------------------------------------------------- /www/jslib/angular-route/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "angular-route@1.5.8", 5 | "/Volumes/Share/Spark_program/DistributedWebChat/www" 6 | ] 7 | ], 8 | "_cnpm_publish_time": 1469201488123, 9 | "_from": "angular-route@1.5.8", 10 | "_id": "angular-route@1.5.8", 11 | "_inCache": true, 12 | "_installable": true, 13 | "_location": "/angular-route", 14 | "_nodeVersion": "4.4.7", 15 | "_npmOperationalInternal": { 16 | "host": "packages-12-west.internal.npmjs.com", 17 | "tmp": "tmp/angular-route-1.5.8.tgz_1469201487889_0.9498146858531982" 18 | }, 19 | "_npmUser": { 20 | "email": "angular-core+npm@google.com", 21 | "name": "angularcore" 22 | }, 23 | "_npmVersion": "2.15.8", 24 | "_phantomChildren": {}, 25 | "_requested": { 26 | "name": "angular-route", 27 | "raw": "angular-route@1.5.8", 28 | "rawSpec": "1.5.8", 29 | "scope": null, 30 | "spec": "1.5.8", 31 | "type": "version" 32 | }, 33 | "_requiredBy": [ 34 | "/" 35 | ], 36 | "_resolved": "https://registry.npm.taobao.org/angular-route/download/angular-route-1.5.8.tgz", 37 | "_shasum": "964093de7ec8dc5799bd56a93a6ce5f60095674b", 38 | "_shrinkwrap": null, 39 | "_spec": "angular-route@1.5.8", 40 | "_where": "/Volumes/Share/Spark_program/DistributedWebChat/www", 41 | "author": { 42 | "email": "angular-core+npm@google.com", 43 | "name": "Angular Core Team" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/angular/angular.js/issues" 47 | }, 48 | "dependencies": {}, 49 | "description": "AngularJS router module", 50 | "devDependencies": {}, 51 | "directories": {}, 52 | "dist": { 53 | "noattachment": false, 54 | "shasum": "964093de7ec8dc5799bd56a93a6ce5f60095674b", 55 | "size": 19493, 56 | "tarball": "http://registry.npm.taobao.org/angular-route/download/angular-route-1.5.8.tgz" 57 | }, 58 | "gitHead": "e96eff424fdd9689061659603ca59470375bf024", 59 | "homepage": "http://angularjs.org", 60 | "jspm": { 61 | "shim": { 62 | "angular-route": { 63 | "deps": [ 64 | "angular" 65 | ] 66 | } 67 | } 68 | }, 69 | "keywords": [ 70 | "angular", 71 | "framework", 72 | "browser", 73 | "router", 74 | "client-side" 75 | ], 76 | "license": "MIT", 77 | "main": "index.js", 78 | "maintainers": [ 79 | { 80 | "email": "angular-core+npm@google.com", 81 | "name": "angularcore" 82 | }, 83 | { 84 | "email": "pete@bacondarwin.com", 85 | "name": "petebd" 86 | } 87 | ], 88 | "name": "angular-route", 89 | "optionalDependencies": {}, 90 | "publish_time": 1469201488123, 91 | "readme": "ERROR: No README data found!", 92 | "repository": { 93 | "type": "git", 94 | "url": "git+https://github.com/angular/angular.js.git" 95 | }, 96 | "scripts": { 97 | "test": "echo \"Error: no test specified\" && exit 1" 98 | }, 99 | "version": "1.5.8" 100 | } 101 | -------------------------------------------------------------------------------- /www/jslib/angular/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Angular 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /www/jslib/angular/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular 15 | ``` 16 | 17 | Then add a ` 21 | ``` 22 | 23 | Or `require('angular')` from your code. 24 | 25 | ### bower 26 | 27 | ```shell 28 | bower install angular 29 | ``` 30 | 31 | Then add a ` 35 | ``` 36 | 37 | ## Documentation 38 | 39 | Documentation is available on the 40 | [AngularJS docs site](http://docs.angularjs.org/). 41 | 42 | ## License 43 | 44 | The MIT License 45 | 46 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | -------------------------------------------------------------------------------- /www/jslib/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide:not(.ng-hide-animate) { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-shim { 16 | visibility:hidden; 17 | } 18 | 19 | .ng-anchor { 20 | position:absolute; 21 | } 22 | -------------------------------------------------------------------------------- /www/jslib/angular/angular.min.js.gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cookeem/CookIM/4898cb9ff8751c054c45b769996546e34c820a15/www/jslib/angular/angular.min.js.gzip -------------------------------------------------------------------------------- /www/jslib/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.5.8", 4 | "license": "MIT", 5 | "main": "./angular.js", 6 | "ignore": [], 7 | "dependencies": { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /www/jslib/angular/index.js: -------------------------------------------------------------------------------- 1 | require('./angular'); 2 | module.exports = angular; 3 | -------------------------------------------------------------------------------- /www/jslib/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "angular@1.5.8", 5 | "/Volumes/Share/Spark_program/DistributedWebChat/www" 6 | ] 7 | ], 8 | "_cnpm_publish_time": 1469201397934, 9 | "_from": "angular@1.5.8", 10 | "_id": "angular@1.5.8", 11 | "_inCache": true, 12 | "_installable": true, 13 | "_location": "/angular", 14 | "_nodeVersion": "4.4.7", 15 | "_npmOperationalInternal": { 16 | "host": "packages-16-east.internal.npmjs.com", 17 | "tmp": "tmp/angular-1.5.8.tgz_1469201394611_0.9924397475551814" 18 | }, 19 | "_npmUser": { 20 | "email": "angular-core+npm@google.com", 21 | "name": "angularcore" 22 | }, 23 | "_npmVersion": "2.15.8", 24 | "_phantomChildren": {}, 25 | "_requested": { 26 | "name": "angular", 27 | "raw": "angular@1.5.8", 28 | "rawSpec": "1.5.8", 29 | "scope": null, 30 | "spec": "1.5.8", 31 | "type": "version" 32 | }, 33 | "_requiredBy": [ 34 | "/" 35 | ], 36 | "_resolved": "https://registry.npm.taobao.org/angular/download/angular-1.5.8.tgz", 37 | "_shasum": "925a5392b8c212d09572dc446db7e01264e094cb", 38 | "_shrinkwrap": null, 39 | "_spec": "angular@1.5.8", 40 | "_where": "/Volumes/Share/Spark_program/DistributedWebChat/www", 41 | "author": { 42 | "email": "angular-core+npm@google.com", 43 | "name": "Angular Core Team" 44 | }, 45 | "bugs": { 46 | "url": "https://github.com/angular/angular.js/issues" 47 | }, 48 | "dependencies": {}, 49 | "description": "HTML enhanced for web apps", 50 | "devDependencies": {}, 51 | "directories": {}, 52 | "dist": { 53 | "noattachment": false, 54 | "shasum": "925a5392b8c212d09572dc446db7e01264e094cb", 55 | "size": 555606, 56 | "tarball": "http://registry.npm.taobao.org/angular/download/angular-1.5.8.tgz" 57 | }, 58 | "gitHead": "7e0e546eb6caedbb298c91a9f6bf7de7eeaa4ad2", 59 | "homepage": "http://angularjs.org", 60 | "keywords": [ 61 | "angular", 62 | "framework", 63 | "browser", 64 | "client-side" 65 | ], 66 | "license": "MIT", 67 | "main": "index.js", 68 | "maintainers": [ 69 | { 70 | "email": "angular-core+npm@google.com", 71 | "name": "angularcore" 72 | }, 73 | { 74 | "email": "pete@bacondarwin.com", 75 | "name": "petebd" 76 | } 77 | ], 78 | "name": "angular", 79 | "optionalDependencies": {}, 80 | "publish_time": 1469201397934, 81 | "readme": "ERROR: No README data found!", 82 | "repository": { 83 | "type": "git", 84 | "url": "git+https://github.com/angular/angular.js.git" 85 | }, 86 | "scripts": { 87 | "test": "echo \"Error: no test specified\" && exit 1" 88 | }, 89 | "version": "1.5.8" 90 | } 91 | -------------------------------------------------------------------------------- /www/jslib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /www/jslib/jquery/README.md: -------------------------------------------------------------------------------- 1 | # jQuery 2 | 3 | > jQuery is a fast, small, and feature-rich JavaScript library. 4 | 5 | For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/). 6 | For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery). 7 | 8 | ## Including jQuery 9 | 10 | Below are some of the most common ways to include jQuery. 11 | 12 | ### Browser 13 | 14 | #### Script tag 15 | 16 | ```html 17 | 18 | ``` 19 | 20 | #### Babel 21 | 22 | [Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively. 23 | 24 | ```js 25 | import $ from "jquery"; 26 | ``` 27 | 28 | #### Browserify/Webpack 29 | 30 | There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this... 31 | 32 | ```js 33 | var $ = require("jquery"); 34 | ``` 35 | 36 | #### AMD (Asynchronous Module Definition) 37 | 38 | AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html). 39 | 40 | ```js 41 | define(["jquery"], function($) { 42 | 43 | }); 44 | ``` 45 | 46 | ### Node 47 | 48 | To include jQuery in [Node](nodejs.org), first install with npm. 49 | 50 | ```sh 51 | npm install jquery 52 | ``` 53 | 54 | For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes. 55 | 56 | ```js 57 | require("jsdom").env("", function(err, window) { 58 | if (err) { 59 | console.error(err); 60 | return; 61 | } 62 | 63 | var $ = require("jquery")(window); 64 | }); 65 | ``` 66 | -------------------------------------------------------------------------------- /www/jslib/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ] 14 | } -------------------------------------------------------------------------------- /www/jslib/jquery/external/sizzle/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/sizzle 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /www/jslib/jquery/src/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | // Support: IE <=9 only, Android <=4.0 only 3 | // The above browsers are failing a lot of tests in the ES5 4 | // test suite at http://test262.ecmascript.org. 5 | "parserOptions": { 6 | "ecmaVersion": 3 7 | }, 8 | "globals": { 9 | "window": true, 10 | "jQuery": true, 11 | "define": true, 12 | "module": true, 13 | "noGlobal": true 14 | }, 15 | "rules": { 16 | "strict": ["error", "function"] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /www/jslib/jquery/src/ajax/jsonp.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "./var/nonce", 4 | "./var/rquery", 5 | "../ajax" 6 | ], function( jQuery, nonce, rquery ) { 7 | 8 | "use strict"; 9 | 10 | var oldCallbacks = [], 11 | rjsonp = /(=)\?(?=&|$)|\?\?/; 12 | 13 | // Default jsonp settings 14 | jQuery.ajaxSetup( { 15 | jsonp: "callback", 16 | jsonpCallback: function() { 17 | var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 18 | this[ callback ] = true; 19 | return callback; 20 | } 21 | } ); 22 | 23 | // Detect, normalize options and install callbacks for jsonp requests 24 | jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 25 | 26 | var callbackName, overwritten, responseContainer, 27 | jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 28 | "url" : 29 | typeof s.data === "string" && 30 | ( s.contentType || "" ) 31 | .indexOf( "application/x-www-form-urlencoded" ) === 0 && 32 | rjsonp.test( s.data ) && "data" 33 | ); 34 | 35 | // Handle iff the expected data type is "jsonp" or we have a parameter to set 36 | if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 37 | 38 | // Get callback name, remembering preexisting value associated with it 39 | callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 40 | s.jsonpCallback() : 41 | s.jsonpCallback; 42 | 43 | // Insert callback into url or form data 44 | if ( jsonProp ) { 45 | s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 46 | } else if ( s.jsonp !== false ) { 47 | s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 48 | } 49 | 50 | // Use data converter to retrieve json after script execution 51 | s.converters[ "script json" ] = function() { 52 | if ( !responseContainer ) { 53 | jQuery.error( callbackName + " was not called" ); 54 | } 55 | return responseContainer[ 0 ]; 56 | }; 57 | 58 | // Force json dataType 59 | s.dataTypes[ 0 ] = "json"; 60 | 61 | // Install callback 62 | overwritten = window[ callbackName ]; 63 | window[ callbackName ] = function() { 64 | responseContainer = arguments; 65 | }; 66 | 67 | // Clean-up function (fires after converters) 68 | jqXHR.always( function() { 69 | 70 | // If previous value didn't exist - remove it 71 | if ( overwritten === undefined ) { 72 | jQuery( window ).removeProp( callbackName ); 73 | 74 | // Otherwise restore preexisting value 75 | } else { 76 | window[ callbackName ] = overwritten; 77 | } 78 | 79 | // Save back as free 80 | if ( s[ callbackName ] ) { 81 | 82 | // Make sure that re-using the options doesn't screw things around 83 | s.jsonpCallback = originalSettings.jsonpCallback; 84 | 85 | // Save the callback name for future use 86 | oldCallbacks.push( callbackName ); 87 | } 88 | 89 | // Call if it was a function and we have a response 90 | if ( responseContainer && jQuery.isFunction( overwritten ) ) { 91 | overwritten( responseContainer[ 0 ] ); 92 | } 93 | 94 | responseContainer = overwritten = undefined; 95 | } ); 96 | 97 | // Delegate to script 98 | return "script"; 99 | } 100 | } ); 101 | 102 | } ); 103 | -------------------------------------------------------------------------------- /www/jslib/jquery/src/ajax/load.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../core/parseHTML", 4 | "../ajax", 5 | "../traversing", 6 | "../manipulation", 7 | "../selector" 8 | ], function( jQuery ) { 9 | 10 | "use strict"; 11 | 12 | /** 13 | * Load a url into a page 14 | */ 15 | jQuery.fn.load = function( url, params, callback ) { 16 | var selector, type, response, 17 | self = this, 18 | off = url.indexOf( " " ); 19 | 20 | if ( off > -1 ) { 21 | selector = jQuery.trim( url.slice( off ) ); 22 | url = url.slice( 0, off ); 23 | } 24 | 25 | // If it's a function 26 | if ( jQuery.isFunction( params ) ) { 27 | 28 | // We assume that it's the callback 29 | callback = params; 30 | params = undefined; 31 | 32 | // Otherwise, build a param string 33 | } else if ( params && typeof params === "object" ) { 34 | type = "POST"; 35 | } 36 | 37 | // If we have elements to modify, make the request 38 | if ( self.length > 0 ) { 39 | jQuery.ajax( { 40 | url: url, 41 | 42 | // If "type" variable is undefined, then "GET" method will be used. 43 | // Make value of this field explicit since 44 | // user can override it through ajaxSetup method 45 | type: type || "GET", 46 | dataType: "html", 47 | data: params 48 | } ).done( function( responseText ) { 49 | 50 | // Save response for use in complete callback 51 | response = arguments; 52 | 53 | self.html( selector ? 54 | 55 | // If a selector was specified, locate the right elements in a dummy div 56 | // Exclude scripts to avoid IE 'Permission Denied' errors 57 | jQuery( "
" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 58 | 59 | // Otherwise use the full result 60 | responseText ); 61 | 62 | // If the request succeeds, this function gets "data", "status", "jqXHR" 63 | // but they are ignored because response was set above. 64 | // If it fails, this function gets "jqXHR", "status", "error" 65 | } ).always( callback && function( jqXHR, status ) { 66 | self.each( function() { 67 | callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 68 | } ); 69 | } ); 70 | } 71 | 72 | return this; 73 | }; 74 | 75 | } ); 76 | -------------------------------------------------------------------------------- /www/jslib/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | // Cross-browser xml parsing 8 | jQuery.parseXML = function( data ) { 9 | var xml; 10 | if ( !data || typeof data !== "string" ) { 11 | return null; 12 | } 13 | 14 | // Support: IE 9 - 11 only 15 | // IE throws on parseFromString with invalid input. 16 | try { 17 | xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 18 | } catch ( e ) { 19 | xml = undefined; 20 | } 21 | 22 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 23 | jQuery.error( "Invalid XML: " + data ); 24 | } 25 | return xml; 26 | }; 27 | 28 | return jQuery.parseXML; 29 | 30 | } ); 31 | -------------------------------------------------------------------------------- /www/jslib/jquery/src/ajax/script.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document", 4 | "../ajax" 5 | ], function( jQuery, document ) { 6 | 7 | "use strict"; 8 | 9 | // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 10 | jQuery.ajaxPrefilter( function( s ) { 11 | if ( s.crossDomain ) { 12 | s.contents.script = false; 13 | } 14 | } ); 15 | 16 | // Install script dataType 17 | jQuery.ajaxSetup( { 18 | accepts: { 19 | script: "text/javascript, application/javascript, " + 20 | "application/ecmascript, application/x-ecmascript" 21 | }, 22 | contents: { 23 | script: /\b(?:java|ecma)script\b/ 24 | }, 25 | converters: { 26 | "text script": function( text ) { 27 | jQuery.globalEval( text ); 28 | return text; 29 | } 30 | } 31 | } ); 32 | 33 | // Handle cache's special case and crossDomain 34 | jQuery.ajaxPrefilter( "script", function( s ) { 35 | if ( s.cache === undefined ) { 36 | s.cache = false; 37 | } 38 | if ( s.crossDomain ) { 39 | s.type = "GET"; 40 | } 41 | } ); 42 | 43 | // Bind script tag hack transport 44 | jQuery.ajaxTransport( "script", function( s ) { 45 | 46 | // This transport only deals with cross domain requests 47 | if ( s.crossDomain ) { 48 | var script, callback; 49 | return { 50 | send: function( _, complete ) { 51 | script = jQuery( "