diff --git a/SNA/presentation/sna.Rmd b/SNA/presentation/sna.Rmd new file mode 100644 index 0000000..a2b10d2 --- /dev/null +++ b/SNA/presentation/sna.Rmd @@ -0,0 +1,66 @@ +--- +title: "Social Network Analysis" +author: + name: Sebnem Er + affiliation: University of Cape Town | Statistical Sciences Department + # email: sebnem.er@uct.ac.za +date: Lecture 1 #"`r format(Sys.time(), '%d %B %Y')`" +output: + html_document: + theme: flatly + highlight: haddock + # code_folding: show + toc: yes + toc_depth: 4 + toc_float: yes + keep_md: true +--- + +title: "R Notebook" +output: html_notebook + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE, cache = TRUE, dpi=300) +``` + +This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. + +Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*. + +```{r} +plot(cars) +``` + +Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Ctrl+Alt+I*. + +When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file). + +The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed. + +## Requirements + +### External libraries (requirements vary by OS) + +We're going to be doing all our spatial analysis and plotting today in R. Behind the scenes, R provides bindings to powerful open-source GIS libraries. These include the [Geospatial Data Abstraction Library (GDAL)](http://www.gdal.org/) and [Interface to Geometry Engine Open Source (GEOS)](https://trac.osgeo.org/geos/) API suite, as well as access to projection and transformation operations from the [PROJ.4 library](https://proj4.org/about.html). You needn't worry about all this, but for the fact that you *may* need to install some of these external libraries first. The requirements vary by OS: + +- **Linux:** Requirements vary by distribution. See [here](https://github.com/r-spatial/sf#linux). +- **Mac:** You should be fine to proceed directly to the R packages installation below. An unlikely exception is if you've configured R to install packages from source; in which case see [here](https://github.com/r-spatial/sf#macos). +- **Windows:** Same as Mac, you should be good to go unless you're installing from source. In which case, see [here](https://github.com/r-spatial/sf#windows). + +### R packages + +- **New:** `sf`, `lwgeom`, `maps`, `mapdata`, `spData`, `tigris`, `tidycensus`, `leaflet`, `tmap`, `tmaptools` +- **Already used:** `tidyverse`, `hrbrthemes` + +Note that you'll need `ggplot2` version 3.0.0 or above for the required [plotting support](https://www.tidyverse.org/articles/2018/07/ggplot2-3-0-0/) of `sf` objects. That's almost certainly the case, but now is a good time to upgrade you existing packages if you haven't done that for a while. + +Okay, let's install (if necessary) and load everything. As per usual, I'll also set my preferred plotting theme, but this is unnecessary. + +```{r, cache=F, message=F} +if (!require("pacman")) install.packages("pacman") +pacman::p_load(sf, tidyverse, hrbrthemes, lwgeom, rnaturalearth, maps, mapdata, spData, tigris, tidycensus, leaflet, tmap, tmaptools) +theme_set(hrbrthemes::theme_ipsum()) +``` + + +### Census API key diff --git a/SNA/snapresentation-figure/unnamed-chunk-2-1.png b/SNA/snapresentation-figure/unnamed-chunk-2-1.png new file mode 100644 index 0000000..a81119c Binary files /dev/null and b/SNA/snapresentation-figure/unnamed-chunk-2-1.png differ diff --git a/SNA/snapresentation-figure/unnamed-chunk-3-1.png b/SNA/snapresentation-figure/unnamed-chunk-3-1.png new file mode 100644 index 0000000..c58e8e3 Binary files /dev/null and b/SNA/snapresentation-figure/unnamed-chunk-3-1.png differ diff --git a/SNA/snapresentation.Rpres b/SNA/snapresentation.Rpres new file mode 100644 index 0000000..afbf00c --- /dev/null +++ b/SNA/snapresentation.Rpres @@ -0,0 +1,68 @@ + + +Social Network Analysis +======================================================== +author: Sebnem Er +date: +autosize: true + + +Structure of the Workshop +======================================================== + + +- + +Simple example - Edge list with no information +======================================================== + +```{r} +library(igraph) +# example in data frame +a=c("A","A","A","A","A","E","F") +b=c("B","C","D","E","F","F","G") +df = cbind(a,b) +df = as.data.frame(df) +df +``` + +Slide With Plot +======================================================== + +```{r, echo=FALSE} +g = graph.edgelist(as.matrix(df),directed = FALSE) +get.adjacency(g) +``` + +Slide With Plot +======================================================== + +```{r, echo=FALSE} +plot(g) +``` diff --git a/SNA/snapresentation.html b/SNA/snapresentation.html new file mode 100644 index 0000000..4c49726 --- /dev/null +++ b/SNA/snapresentation.html @@ -0,0 +1,943 @@ + + + + + + snapresentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+

snapresentation

Sebnem Er

+ +
+ +
+ +
+
+

First Slide

+
+

For more details on authoring R presentations please visit https://support.rstudio.com/hc/en-us/articles/200486468.

+ +
    +
  • Bullet 1
  • +
  • Bullet 2
  • +
  • Bullet 3
  • +
+ +
+ +
+
+

Slide With Code

+
+
summary(cars)
+
+ +
     speed           dist       
+ Min.   : 4.0   Min.   :  2.00  
+ 1st Qu.:12.0   1st Qu.: 26.00  
+ Median :15.0   Median : 36.00  
+ Mean   :15.4   Mean   : 42.98  
+ 3rd Qu.:19.0   3rd Qu.: 56.00  
+ Max.   :25.0   Max.   :120.00  
+
+ +
+ +
+
+

Slide With Plot

+
+

plot of chunk unnamed-chunk-2

+ +
+ +
+ + +
+
+ + + + + + + + + + diff --git a/SNA/snapresentation.md b/SNA/snapresentation.md new file mode 100644 index 0000000..f89f8c8 --- /dev/null +++ b/SNA/snapresentation.md @@ -0,0 +1,86 @@ + + +Social Network Analysis +======================================================== +author: Sebnem Er +date: +autosize: true + + +Structure of the Workshop +======================================================== + + +- + +Simple example - Edge list with no information +======================================================== + + +```r +library(igraph) +# example in data frame +a=c("A","A","A","A","A","E","F") +b=c("B","C","D","E","F","F","G") +df = cbind(a,b) +df = as.data.frame(df) +df +``` + +``` + a b +1 A B +2 A C +3 A D +4 A E +5 A F +6 E F +7 F G +``` + +Slide With Plot +======================================================== + + +``` +7 x 7 sparse Matrix of class "dgCMatrix" + A B C D E F G +A . 1 1 1 1 1 . +B 1 . . . . . . +C 1 . . . . . . +D 1 . . . . . . +E 1 . . . . 1 . +F 1 . . . 1 . 1 +G . . . . . 1 . +``` + +Slide With Plot +======================================================== + +![plot of chunk unnamed-chunk-3](snapresentation-figure/unnamed-chunk-3-1.png) diff --git a/css/all.css b/css/all.css new file mode 100644 index 0000000..4fba110 --- /dev/null +++ b/css/all.css @@ -0,0 +1,37 @@ +/* I am just copying the CSS file used by the lecturer Charlie Daly http://polya.computing.dcu.ie/ca165/css/ca165.css */ + +BODY { + font-family: Georgia, "Times New Roman", times, serif; + background-color: white; + color: #115; + text-align:justify; + text-indent:0%; + margin-left: 2.5%; + margin-right: 2.5% +} + +TT { font-family: "Courier new", "courier"; font-weight: bold; /*font-size: 1.1 em;*/ color: black;} +SPAN.gloss { background-color: #fff; color: #1d1; } /* Background to make glossary item stand out */ + +/* ul { list-style-image: url(http://www.foo.com/bullet.gif) } A graphic for list items! */ + +LI { line-height: 1.3} /* Normal links are just far too close. */ + +td, th { empty-cells: show } + +A:link { text-decoration:none; } +A:visited { text-decoration:none; } +A:active { text-decoration:none; } +A:hover { text-decoration:none; background-color:#eee;} + +/* The following taken from +http://www.blooberry.com/indexdot/css/properties/generate/quotes.htm +*/ +blockquote[lang-=fr] { quotes: "\201C" "\201D" } +blockquote[lang-=en] { quotes: "\00AB" "\00BB" } +blockquote:before { content: open-quote } +blockquote:after { content: close-quote } +blockquote { background:#dde; + font-style:italic; + padding-left:10pt; padding-right:10pt; +} \ No newline at end of file diff --git a/cv b/cv new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/cv @@ -0,0 +1 @@ + diff --git a/english/EUmembersCandidatesOthers19982008.dta b/english/EUmembersCandidatesOthers19982008.dta new file mode 100644 index 0000000..214a01b Binary files /dev/null and b/english/EUmembersCandidatesOthers19982008.dta differ diff --git a/english/GA4Stratification/GA4Stratification.html b/english/GA4Stratification/GA4Stratification.html new file mode 100644 index 0000000..09a5119 --- /dev/null +++ b/english/GA4Stratification/GA4Stratification.html @@ -0,0 +1,184 @@ + + + + + + +R: A genetic algorithm approach to determine stratum boundaries and sample sizes of each stratum in stratified sampling + + + + + + +

Şebnem Er

+

+ +
GA4Stratification {}R Documentation
+ +

A genetic algorithm approach to determine stratum boundaries and sample sizes of each stratum in stratified sampling

+ +

Description

+ +

This is a package for Genetic Algorithm approach for the determination of the stratum boundaries and sample sizes in each stratum in stratified sampling.

+ +

Author(s)

+ +

Şebnem Er, +Timur Keskintürk, +Charlie Daly +

+

Maintainer: Sebnem Er e-mail: sebnem.er@uct.ac.za, er.sebnem@gmail.com

+ + + + + + + + + + + + + + + + + + + + +
+Package: GA4Stratification
+Type: Package
+Version: 1.0
+Date: 2010-12-03
+License: GPL-2
+LazyLoad: yes
+

Usage

+
+GA4Stratification(dataName, numberOfStrata, sampleSize, iteration, GAgenerationSize, mutationRate, sampleAllocation)
+
+

How to Install the R Package

+

Since the package is not in CRAN package repository yet, these steps should be followed in order to use the package:

+

The file can be saved as a zip document. +Then after extracting the zip file into your R library where R is downloaded, the R package is ready to use in Windows. +The R library is something like this in my computer: +

+

+C:\Program Files\R\R-2.10.1\library +

+

First open an R console and type:

+
+library(GA4Stratification)
+data(iso2004)
+data(P75)
+data(chi1)
+data(chi5)
+data(chi10)
+data(chi15)
+data(normal100_10)
+data(beta10_3)
+
+GA4Stratification(iso2004,2,80,1000,50,0.15,"Equal")
+
+

By just typing the name of the data, and defining the following arguments, +you can obtain the boundaries and sample sizes to be drawn from each stratum with Genetic Algorithm developed by Keskinturk and Er (2007) given a sampling allocation scheme. +The sampling allocation scheme could be either "Equal", "Proportional", "Neyman" or "GA" sampling allocation scheme.

+ +

Arguments

+ + + + + + + + + + + + + + + + +
dataName +Any type of numeric data containing the values of a univariate stratification variable.
numberOfStrata +An integer: The number of strata.
sampleSize +An integer: The number total sample size.
iteration +An integer: The number of iterations in Genetic Algorithm process.
GAgenerationSize +An integer: The number of generations in Genetic Algorithm process.
mutationRate +A numeric: The mutation rate in Genetic Algorithm process. Mutation rate must be in between 0 and 1, inclusive. Small levels of mutation rate is preferable in Genetic Algorithms.
sampleAllocation +A string: sampleAllocation defines the type sample allocation method, which are "Equal", "Proportional", "Neyman" and "GA".
+ + +

Note

+ +

+This study is part of a project supported by the Scientific and Technological Research Council of Turkey (TUBITAK). +

+ +

References

+Timur Keskinturk, Sebnem Er, "A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling" +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. +

The Function

+ +
+The function is currently defined as:
+
+function(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate,sampleAllocation)
+{
+   if(sampleAllocation == "Equal")
+   {
+	GA4StratificationP1(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate)
+	
+   } else if(sampleAllocation=="Proportional") {
+	
+	GA4StratificationP2(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate)
+
+   } else if(sampleAllocation == "Neyman") {
+	
+	GA4StratificationP3(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate)
+   
+   } else if (sampleAllocation == "GA") {
+
+	GA4StratificationP4(dataName,numberOfStrata,sampleSize,iteration,GAgenerationSize,mutationRate)
+
+   }
+
+  }
+
+

See Also

+ +

+iso2004, +P75, +chi1, +chi5, +chi10, +chi15, +normal100_10, +beta10_3, +randomnumGenerator +

+ +
[]
+ diff --git a/english/GA4Stratification/GA4Stratification.rar b/english/GA4Stratification/GA4Stratification.rar new file mode 100644 index 0000000..eebf60a Binary files /dev/null and b/english/GA4Stratification/GA4Stratification.rar differ diff --git a/english/GA4Stratification/d b/english/GA4Stratification/d new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/english/GA4Stratification/d @@ -0,0 +1 @@ + diff --git a/english/GA4Stratification/data/P75.txt b/english/GA4Stratification/data/P75.txt new file mode 100644 index 0000000..c211dae --- /dev/null +++ b/english/GA4Stratification/data/P75.txt @@ -0,0 +1,284 @@ +27 +15 +20 +15 +52 +15 +62 +54 +12 +50 +29 +14 +40 +27 +43 +671 +78 +54 +28 +55 +36 +6 +39 +27 +19 +9 +10 +21 +138 +32 +19 +10 +62 +14 +18 +33 +92 +22 +6 +4 +11 +6 +13 +25 +9 +108 +119 +10 +42 +8 +25 +6 +8 +27 +11 +108 +33 +30 +12 +29 +18 +19 +12 +9 +15 +19 +15 +12 +62 +26 +8 +8 +11 +18 +13 +12 +52 +22 +28 +42 +16 +11 +54 +18 +60 +30 +32 +16 +15 +9 +13 +11 +14 +7 +16 +11 +11 +67 +20 +28 +48 +12 +15 +14 +21 +14 +19 +15 +13 +11 +14 +12 +10 +247 +75 +38 +102 +21 +26 +24 +35 +11 +74 +19 +33 +43 +37 +20 +27 +9 +14 +10 +10 +9 +10 +11 +446 +47 +28 +15 +47 +9 +5 +7 +22 +28 +8 +12 +12 +10 +11 +30 +10 +9 +34 +50 +28 +106 +21 +13 +5 +6 +5 +6 +8 +7 +17 +12 +11 +10 +25 +35 +17 +45 +8 +13 +33 +9 +10 +16 +5 +11 +6 +11 +11 +10 +14 +73 +28 +16 +19 +27 +20 +9 +17 +12 +11 +7 +118 +17 +11 +38 +9 +25 +5 +11 +13 +8 +19 +7 +118 +20 +16 +28 +15 +9 +12 +9 +13 +11 +7 +9 +13 +18 +47 +46 +10 +17 +27 +33 +6 +15 +13 +12 +22 +85 +43 +32 +28 +37 +14 +18 +27 +93 +28 +26 +60 +8 +10 +13 +18 +9 +9 +13 +53 +8 +4 +7 +7 +6 +4 +8 +4 +4 +8 +9 +5 +74 +15 +72 +8 +4 +8 +6 +18 +7 +10 +26 +9 +64 +35 +27 +9 +31 \ No newline at end of file diff --git a/english/GA4Stratification/data/beta10_3.txt b/english/GA4Stratification/data/beta10_3.txt new file mode 100644 index 0000000..d80f426 --- /dev/null +++ b/english/GA4Stratification/data/beta10_3.txt @@ -0,0 +1,1000 @@ +357.983022173023 +392.861383900526 +396.136140282008 +399.910963805119 +400.960043948045 +413.952520485263 +417.774355170357 +425.679806808402 +436.102735427637 +446.680828880227 +469.448543775662 +475.274509040401 +483.061247201904 +483.476873713109 +483.807355605245 +484.071004474446 +487.223288593530 +489.129990395826 +490.066599385227 +490.371089807704 +493.361614117610 +493.606741804044 +498.355719119549 +498.863277845613 +506.200930855375 +506.913106598178 +509.269631800513 +512.359144350232 +515.387882486789 +519.146562093771 +520.038213474739 +521.425431443403 +521.684139107118 +523.643984544708 +523.798364770603 +524.340078316016 +526.819664294659 +526.878682769264 +530.721782077186 +530.966712734647 +532.045244501745 +533.817338662909 +534.219223813952 +535.185489456370 +536.373097640819 +536.713367459834 +538.988277545708 +539.416369305241 +540.359871737727 +541.218868089169 +542.131200587856 +546.620398206242 +549.436886469371 +549.965121450785 +550.249895301800 +550.348580195530 +551.670657725240 +555.158164367182 +555.413341538415 +555.598329377366 +557.301323889599 +557.714145149472 +558.305438893940 +560.060018119550 +560.850573028203 +561.621639203976 +563.585161615690 +565.822146864506 +570.003684941971 +576.614420168443 +577.153099605073 +580.288845826113 +583.906068760206 +586.749495382866 +587.525888723763 +587.713010531891 +590.521107236336 +590.592616754899 +590.726522613537 +591.778230172001 +592.604375633494 +593.322158073859 +593.426147686333 +594.323197961858 +595.320353506983 +595.539339439519 +598.314559661296 +603.299101150038 +605.323116892696 +606.418690549140 +606.534983295244 +611.047958127687 +612.785817551274 +612.808058512798 +612.949044865753 +613.870216911909 +615.491389376903 +616.974341454973 +617.256355370024 +617.721869826862 +618.313672990541 +618.616542098609 +618.824716813454 +619.440563590794 +620.796609860900 +621.578201221464 +624.629619455441 +624.759980666742 +627.812259638168 +628.029848654818 +628.945266538273 +630.034343428569 +632.293445003416 +633.611443370256 +634.031262054804 +636.669436001048 +638.271503657143 +638.573248639652 +638.687642968836 +639.426331192057 +639.827153851582 +640.358850619744 +641.645297168799 +641.710343676535 +642.410546914291 +642.849015061096 +642.863898441319 +643.573639262352 +644.491893954473 +645.330689114239 +645.816788794518 +647.371003179941 +648.088133572267 +650.461716308409 +650.512589997737 +650.910319141059 +651.693058171881 +652.070836331441 +652.505315542339 +652.707263075318 +655.886063401516 +655.993236254329 +657.037830097939 +657.344918344875 +658.195775088389 +658.724545269095 +658.770473379058 +658.844236438450 +658.978541220942 +658.999576221616 +659.047128923833 +660.022198099223 +660.095692886446 +660.533950461067 +660.821078632028 +662.087601303399 +662.241239207533 +663.347924937353 +663.568624032441 +664.537157203409 +664.958399155652 +665.393373138830 +665.760873919549 +665.779626213620 +665.862406358916 +665.875225840293 +666.398134721704 +667.017314190631 +667.190408013625 +667.373212349558 +667.377261026903 +667.387231800767 +667.443948501784 +668.157313068392 +669.731791301661 +669.738518611466 +670.064270772984 +670.707911174090 +671.879902880597 +672.395319382707 +672.549494832487 +672.936279744957 +673.771462919412 +674.139903740747 +674.500944864218 +674.756839678191 +674.973243730978 +675.326525726981 +676.252451043778 +678.044040232859 +679.650029273084 +680.530832871059 +680.779639682187 +680.853700030292 +680.947377453366 +681.767421700614 +681.924241966667 +681.950495556442 +681.972274871409 +682.027365312072 +682.248791131370 +682.779716711276 +682.904698061702 +683.899605254042 +683.934135854633 +684.869791317974 +684.974136158646 +685.464571786126 +685.850688647381 +686.095484052591 +686.948442400662 +687.055398433407 +687.652855303133 +688.030286715341 +688.112080104514 +688.499848428452 +689.629858622480 +690.143220890099 +690.281969019903 +690.387403667420 +690.892721105001 +692.180120516800 +692.858787317688 +693.627263281074 +693.744553488151 +693.883644950434 +694.073106945727 +694.578258675074 +694.960917546432 +694.995972872881 +696.228696710143 +696.414937748175 +696.623474170195 +697.240428151492 +697.322054602301 +697.582452009439 +697.591467716015 +697.598018771775 +698.233917212707 +698.293434685536 +698.968858840120 +699.483519502799 +699.820417818305 +699.894027269550 +700.306832438319 +700.511725709938 +700.562427867434 +701.080654319786 +701.104069046135 +701.350435766400 +701.421752178196 +702.585515433685 +703.572953120736 +704.071274273341 +704.567807881423 +704.927579910028 +706.030220611325 +706.377300659802 +706.820320651000 +707.224048035831 +707.332965456955 +707.427427225251 +707.630187695515 +707.745220134305 +707.972426066892 +708.299073854105 +708.463391275213 +708.623479216258 +709.160864763757 +709.857328107571 +710.843042299742 +712.810774418619 +712.818914877817 +713.395701522894 +713.410923204896 +713.588825918182 +713.896561018625 +714.000972121945 +714.213853425666 +714.895711956327 +714.924053402565 +715.060233928929 +715.388422346149 +715.444546634380 +715.743811365735 +715.954383122295 +716.119399327653 +716.261850626175 +716.836037948911 +717.219711785022 +717.321122343018 +718.180680371510 +718.366371330722 +718.512565502424 +719.151054033317 +719.308143362539 +719.357725306573 +719.583655705746 +720.072689032211 +720.113764525996 +721.355072986151 +722.613425979280 +722.782337880242 +722.878054322261 +723.193041981602 +723.378223430041 +723.930165515561 +724.559748754985 +724.660892315505 +724.717300165237 +725.093262199310 +725.516925760019 +725.610734139330 +725.666783902916 +725.759211572093 +725.828354130633 +725.875878486204 +726.297791736015 +726.385567644414 +726.572315308114 +727.135353833805 +727.270006755397 +728.024119764760 +728.842997282651 +729.337527708865 +729.348440491303 +729.532082567634 +730.185810514356 +730.538130484052 +730.651608296424 +730.747228194556 +731.032766704717 +731.059372822332 +731.254179215746 +732.187092879359 +732.502326448793 +732.904497391255 +733.285128346720 +733.335743217442 +733.844640459758 +734.593832914835 +734.663296850586 +734.925846092086 +735.218256554027 +735.231242234382 +735.433670355494 +735.582556597396 +735.724181746823 +736.159748590120 +736.348549077319 +736.397008871166 +736.400508324403 +736.499415761957 +736.514657000314 +737.079189700965 +737.539835591598 +737.915415924697 +738.000982085547 +738.402514094221 +738.746628835626 +738.979302430245 +739.258439687657 +739.420051981681 +739.496760264057 +739.898656494963 +740.006485079168 +740.218711203849 +741.247782751047 +741.524043896805 +742.303271097980 +742.374915267679 +742.645181096711 +743.530794883071 +743.666293559545 +743.729388192560 +743.766484982130 +744.198596009409 +744.487609394879 +745.679605071825 +746.054749235514 +746.064473783734 +746.544784878573 +746.735324897823 +747.212465722114 +747.588260867912 +747.648878851664 +748.220924546047 +748.784472658149 +749.029942628982 +749.194306218086 +749.346169733528 +749.550116092148 +749.603935084737 +749.890671625766 +749.920525021634 +750.277729604968 +750.860377587978 +751.219669596986 +751.328661892109 +751.461978266744 +751.539436118465 +751.581055315110 +751.744383522549 +752.018691463609 +752.173894363940 +752.511138715784 +753.099059472638 +753.139660687687 +753.654810336860 +753.679889820960 +753.974751885005 +754.246816029419 +754.525849805099 +754.666858984818 +754.739086061921 +755.115051310045 +755.267241719979 +755.366875134868 +755.866976826599 +756.532437295464 +757.853696660956 +757.912973420039 +757.941655687576 +758.205817864095 +759.414437862051 +759.592549402002 +759.697488639351 +759.787891587612 +760.841772406251 +760.861553568587 +761.139859514946 +761.179961458080 +761.184239346591 +761.676312597417 +761.782558146599 +761.878287648876 +762.522595471120 +762.961086752070 +763.268435057817 +764.290815284094 +764.656598358722 +764.718167776845 +764.941108343244 +765.443881021850 +765.486323619900 +765.931521415858 +766.218743845028 +766.525570724742 +766.894559799279 +767.606659664139 +767.692139132610 +767.841728038546 +769.806752342110 +769.946803019227 +770.827907800674 +771.948159495775 +772.264428588654 +772.284584897802 +772.290446940606 +772.563175372797 +773.202850162373 +773.806432556156 +774.400877548704 +774.409378808767 +775.160792716623 +775.322593664696 +775.421057572253 +775.902878810424 +776.026377022714 +776.493894317243 +776.561720246010 +776.583558209296 +776.846171457848 +778.030763185670 +778.320964694277 +778.769371042405 +779.175013896476 +780.085498716636 +780.705650015652 +781.054676811864 +781.403045343005 +781.833175242709 +782.266042735068 +782.283404914579 +782.804110689378 +783.001927441859 +783.069804953615 +783.073749143005 +785.790487680860 +785.865857432975 +786.015627112557 +786.575233881384 +786.713938813913 +786.773685147447 +786.841115788947 +787.059797584530 +787.480343067602 +787.680306650155 +788.052014772552 +788.254870336906 +788.655385165960 +789.076337515517 +789.100012414633 +789.353090173597 +789.890646753951 +790.025409675628 +790.256617459717 +790.303144935110 +790.804033916026 +791.067240371393 +791.133008103200 +791.778845916823 +791.885957399954 +792.143840226070 +792.513135240362 +792.685972279081 +792.714079180994 +792.925811478167 +793.067901761432 +793.495696981014 +793.789425260525 +793.983604251323 +794.499312452387 +794.591306068944 +794.691022249951 +794.945489741579 +794.974783364882 +796.336009980235 +796.983700671720 +797.057211036621 +797.363381963606 +797.457567547971 +797.588471249513 +797.603599854582 +797.680371734657 +797.781837724383 +797.871624653925 +797.979805848576 +798.438194104015 +799.037065435061 +799.304756814707 +799.414282239566 +799.461401801872 +800.223724923561 +800.446921368734 +800.955981092556 +801.483540607231 +801.495363782451 +801.600720968112 +801.966367141486 +802.032223787223 +802.405471087044 +802.450596825451 +802.513773350301 +802.631178744639 +802.973640521929 +803.197144248628 +803.740425669249 +804.572095837682 +804.746656632843 +804.888461386599 +804.976693015999 +805.167522945251 +805.383649842010 +805.659342586690 +806.211557104752 +806.451782416330 +806.867051632289 +807.093347234776 +807.845700718233 +808.043078465364 +808.565451222421 +808.643012715169 +808.715757989356 +808.909757155495 +809.002859486402 +809.125802319976 +810.422130251892 +810.524358281350 +810.533370297068 +810.745535925165 +811.776983412415 +811.803628079530 +811.845259395171 +811.930377165080 +812.248420573197 +812.891129751929 +813.008641992790 +813.857761401338 +813.909932207713 +814.436557388102 +814.505774962651 +814.641997621763 +814.931037252810 +814.969341244443 +815.088353701078 +815.214546812812 +815.766744631340 +815.824229900838 +816.035698362005 +816.109294872107 +816.349133181891 +816.417541401092 +816.612693966131 +817.385184674930 +817.854843239253 +817.931969301694 +818.542229414259 +818.738081148173 +819.378202751715 +819.378735343800 +819.560907869989 +820.489856954937 +820.648748099043 +820.743875947353 +821.119279440253 +821.479026471147 +821.511814290653 +821.586420433393 +821.619183239674 +821.858824567536 +822.536268491362 +822.725686106765 +822.826569145469 +823.167463175384 +823.194022534915 +823.742072173303 +823.759388833837 +823.940158495216 +824.246519948302 +824.612373017360 +824.725498131193 +824.910844658891 +825.538866368962 +825.775492381172 +826.058715058552 +826.102831272070 +826.160837776877 +826.164412324741 +826.613152283143 +826.994231661308 +827.350168323868 +828.133575299100 +828.247221662601 +828.353423628988 +828.613554647489 +828.966273671340 +829.214206647171 +829.229523977988 +829.408867438941 +830.305626207757 +830.448562795675 +830.956376913111 +831.014125821766 +831.683037094560 +831.754768710978 +832.176417608667 +832.861685359291 +832.962408495135 +833.504718440398 +833.541071846879 +834.026309166798 +834.328750114695 +834.435891333402 +834.866350408117 +835.055801404029 +835.098548513764 +835.558953412810 +835.716701338538 +835.877596483057 +836.546364880269 +836.548927234273 +836.750262755089 +836.755817459495 +837.078915616444 +837.371920444691 +837.397754443250 +837.546901944883 +838.951771478438 +839.146189005795 +839.558849375305 +840.381643669838 +840.478633520201 +840.892855876353 +841.022787050925 +841.210571304891 +841.517204339940 +841.592130960946 +841.735928737572 +841.800818926469 +843.969072791431 +843.980622510636 +844.044822878569 +844.746740069589 +844.760002974815 +845.613855505843 +845.711092633832 +845.840799981070 +846.400219285766 +846.911440106844 +847.610191775099 +847.996695013891 +848.044638202431 +848.142873417356 +848.591853752048 +848.726744142069 +848.865697677516 +848.925635550012 +848.976877426617 +849.102219869623 +849.675859649475 +849.785678090949 +850.150215432196 +850.356670535568 +850.681607341924 +850.748616025588 +851.174653009174 +851.988291738093 +852.385673460977 +852.532868690848 +853.706427818018 +853.715553393708 +854.280482979536 +854.366669778555 +854.960744808712 +855.712118571547 +855.818518939365 +856.049674410134 +856.054863155400 +856.161982812851 +856.808852716847 +857.097860725834 +857.654845888327 +857.800239595968 +858.078544505037 +858.291842337487 +859.038088542817 +859.053498996926 +860.513511707155 +860.756887850484 +860.805512642721 +860.819992278920 +860.862104264614 +861.445088449730 +861.765201591735 +861.853359555846 +861.967268396231 +862.339059672439 +862.576336016920 +862.632410479508 +862.755880076987 +863.068920766285 +863.280538905206 +863.447303919145 +863.502733384702 +863.679149177463 +863.969043533809 +864.114005489558 +864.424129460282 +864.744547661510 +865.786730929120 +866.122781075069 +866.396144255046 +866.900864053839 +866.929953998747 +867.157771459701 +867.497928625876 +867.883472473385 +868.078795222869 +868.527433001307 +869.301113323215 +869.544038728971 +869.638258592125 +869.711122900232 +869.721552655032 +869.802277404867 +870.246483146880 +870.829764929810 +871.149192513139 +871.168406278185 +871.179004901072 +871.550885047202 +871.672945764858 +871.868184241984 +872.641395183246 +873.217677941950 +873.829154490167 +874.043147802168 +874.485899281338 +874.926684009600 +874.976963763198 +874.983335559876 +875.047637189664 +875.352599304466 +875.402970096364 +875.754562914553 +876.308782035994 +877.203810859113 +877.344341804134 +878.133754147152 +878.617202909734 +878.890891868444 +879.118267607258 +879.223087947687 +879.902876913744 +880.746868933014 +881.790430513428 +882.298225483919 +882.862641021659 +882.962577529881 +883.678999492862 +883.714650936066 +883.847866829247 +883.868755260038 +883.917366104261 +884.384425994022 +884.530991169799 +884.781823813676 +884.844167973604 +884.923473254691 +885.098446456388 +885.389863274159 +885.432316230028 +885.481968916613 +885.854218465892 +886.186643123135 +886.539606430667 +887.020425134180 +887.356951715289 +887.372680786164 +887.914471960836 +887.959586452433 +888.408664792675 +888.534022942462 +888.679225709033 +888.926444209076 +889.115515449643 +889.169634219245 +889.445102876712 +889.563441580371 +889.977388090725 +890.118276338026 +890.756921368491 +890.988359157791 +891.354682649799 +891.375245596747 +891.560126890645 +891.795930002467 +892.031868675645 +892.125150790976 +892.386013395160 +893.394929390106 +893.921262738979 +894.443087170538 +894.684538512236 +894.970425003294 +895.114517960493 +895.120083464890 +895.434536695443 +895.993652171468 +896.031198619401 +896.586180391948 +897.479712477607 +897.513422797422 +898.017496548745 +898.145821613925 +898.180395307250 +898.383595567665 +898.394460533747 +899.064054692488 +899.374581184535 +899.395370839270 +900.440782543707 +900.566744017606 +902.506425247952 +902.860491853673 +903.347313260397 +903.863723151021 +903.871052147300 +904.855650764504 +904.980275527405 +905.208434121381 +905.234071715043 +905.284236389227 +905.329756321961 +905.519307825660 +905.854005638842 +906.374414559798 +906.416112397317 +906.484141604662 +906.804373586415 +907.282886305083 +907.404556338287 +907.979542917280 +908.409928410861 +908.649003257697 +909.067574658435 +909.654558798426 +910.074411343410 +910.298407832284 +910.317163523347 +910.553712462926 +910.686107502686 +910.918974706556 +911.876915298313 +912.044067482323 +912.060368756712 +912.565543984797 +913.247032346708 +913.251345662953 +913.427036622485 +913.705480706263 +913.775894289035 +914.294934976098 +914.728032451985 +914.837830721593 +915.347016409168 +916.364033650625 +916.600598402659 +916.908782885968 +917.084162618903 +917.139296950626 +917.302780381443 +917.309111787208 +917.398799342559 +917.729229659682 +917.929185361259 +918.040344663887 +918.095417413760 +919.100778162517 +920.361861224480 +920.623739416514 +920.984519705753 +921.507268674165 +922.974809174049 +923.310720138808 +924.308331314656 +924.652833761990 +925.479472424107 +925.675188835441 +926.034485656798 +926.139746262463 +927.128394315490 +928.016135967802 +928.061480071256 +928.590833562364 +928.962673643519 +929.224154776392 +929.229854213816 +929.370958758062 +929.913819645597 +930.764693537798 +932.121072305427 +932.478603469060 +932.910620826751 +933.642770275595 +934.368858484650 +934.524398877308 +934.945232157098 +934.978356590201 +934.985647031382 +935.444083932657 +935.551067971071 +935.649629589793 +936.348072150893 +937.102848392157 +937.369226778285 +937.467108964130 +938.153927490480 +938.180420612998 +938.668690726211 +938.907921692483 +939.725843391756 +940.289348165118 +940.924811419365 +941.531028644690 +941.727149251686 +941.839494391063 +942.425621927851 +943.138638863107 +943.713299891095 +943.724719759459 +945.304726014202 +946.691449454369 +947.178752667839 +948.069709547068 +948.318602241789 +948.599205374386 +951.886477822963 +953.203780604165 +956.079154292991 +957.768253649763 +959.643042518212 +959.967090119967 +964.846352677914 +965.781085888588 +969.912973436423 +975.203746505440 +977.626048114090 +985.957426782109 diff --git a/english/GA4Stratification/data/chi1.txt b/english/GA4Stratification/data/chi1.txt new file mode 100644 index 0000000..d942115 --- /dev/null +++ b/english/GA4Stratification/data/chi1.txt @@ -0,0 +1,1000 @@ +0.00000423448626077472 +0.00003892714632103740 +0.00005240620106907600 +0.00015167367912667700 +0.00027036008321970800 +0.00033056732202900800 +0.00039437090066554400 +0.00046619939211608900 +0.00047913105876018800 +0.00057322066998221500 +0.00062892611295074000 +0.00069950377933729200 +0.00083519167170756900 +0.00109376291256935000 +0.00111572994943875000 +0.00122201134224318000 +0.00123733196459794000 +0.00125017102430350000 +0.00139936504877662000 +0.00142559035948763000 +0.00144978450280453000 +0.00145833637040790000 +0.00159502207578416000 +0.00163008122318222000 +0.00163746231623297000 +0.00166074107058874000 +0.00167450526593719000 +0.00186159411466469000 +0.00214092517555154000 +0.00216619513534863000 +0.00218948613640202000 +0.00228915470677240000 +0.00242925435610046000 +0.00274486430275629000 +0.00284727698664318000 +0.00288500613941838000 +0.00298204493752191000 +0.00313692139735145000 +0.00314065431466759000 +0.00314529335785681000 +0.00343177024244234000 +0.00347069074984088000 +0.00348542005039608000 +0.00356348315728702000 +0.00356768077448411000 +0.00385463548024063000 +0.00405129872187327000 +0.00410475226116205000 +0.00411691566156140000 +0.00441816373384711000 +0.00455844659536568000 +0.00458839617085492000 +0.00471575758302325000 +0.00478491851487965000 +0.00484171398055307000 +0.00501765055599340000 +0.00501778776681101000 +0.00517880569762936000 +0.00535372082457978000 +0.00564301243048147000 +0.00631954621368172000 +0.00691164401418674000 +0.00700843378902648000 +0.00701230384844576000 +0.00704622488567414000 +0.00718918254713785000 +0.00726852186738357000 +0.00736963051108237000 +0.00737360018266562000 +0.00758773258006406000 +0.00759911543022078000 +0.00779942409033127000 +0.00791395033745772000 +0.00798843329873060000 +0.00824457460822500000 +0.00850946386479146000 +0.00867419167314707000 +0.00883720839595476000 +0.00890510492148903000 +0.00930990250845566000 +0.00975931775033024000 +0.00983923066753593000 +0.00991786208103960000 +0.01006847548603910000 +0.01017898511152700000 +0.01078156360814690000 +0.01103225685776570000 +0.01127753414073960000 +0.01135204479079630000 +0.01142864269031040000 +0.01144121861568520000 +0.01153300568838860000 +0.01176602265232550000 +0.01195419546931390000 +0.01220906492082280000 +0.01259457464711200000 +0.01270871840820360000 +0.01281032500869910000 +0.01312473438550430000 +0.01347032882891980000 +0.01366356727724920000 +0.01381417812742880000 +0.01400207294299200000 +0.01458724706348800000 +0.01464982478626320000 +0.01467080699952180000 +0.01467953378950370000 +0.01469023919464420000 +0.01516733773900310000 +0.01562973350810540000 +0.01564496177727200000 +0.01673517575186790000 +0.01727384470061860000 +0.01738363147000890000 +0.01795039817295820000 +0.01795533889718770000 +0.01809924126681100000 +0.01823485587977780000 +0.01869955002058300000 +0.01888534645811920000 +0.01904793859819040000 +0.01907552005481060000 +0.01938130188115760000 +0.01939638551664130000 +0.01939709687539730000 +0.01968591171220190000 +0.01999222836533390000 +0.02146394150408640000 +0.02156685550114770000 +0.02176583202219660000 +0.02213923522924840000 +0.02224409470584160000 +0.02224668668397740000 +0.02239738227419510000 +0.02257933248578100000 +0.02281162087839700000 +0.02307496155267210000 +0.02335723160107430000 +0.02337720320756510000 +0.02389291705475400000 +0.02460359200223310000 +0.02521880461807740000 +0.02587203875526790000 +0.02613316456527100000 +0.02623188702636270000 +0.02643143941062680000 +0.02673923587240950000 +0.02688041269464250000 +0.02718992160764360000 +0.02724567452723180000 +0.02743412310531030000 +0.02749548299896870000 +0.02851724805353060000 +0.02917746780563690000 +0.02926674789015670000 +0.02957964560872750000 +0.02984483356591110000 +0.03096023113029370000 +0.03135934429111420000 +0.03183272511187490000 +0.03260968029715390000 +0.03299694345128870000 +0.03353990892063240000 +0.03359048656149580000 +0.03397699168269170000 +0.03399437238900650000 +0.03483127311446200000 +0.03645605455108630000 +0.03681377085463160000 +0.03695245551420610000 +0.03696026456639480000 +0.03741199588084220000 +0.03770653296682510000 +0.03773886293743300000 +0.03787191037623750000 +0.03820293836755410000 +0.03821124634464210000 +0.03914929784177790000 +0.03925238204188810000 +0.04213724905094160000 +0.04344319216498670000 +0.04363645560303860000 +0.04382819582148450000 +0.04391990290211690000 +0.04450836755968750000 +0.04451755987147120000 +0.04520686011228580000 +0.04675388005365460000 +0.04706089931986310000 +0.04727500858581970000 +0.04820237187608820000 +0.04837893131658210000 +0.04883715395775240000 +0.04898696828701930000 +0.04928738532611190000 +0.04988901320765230000 +0.05035772232270000000 +0.05054752400873670000 +0.05124195225377370000 +0.05437179551276470000 +0.05545848083579890000 +0.05565420672258770000 +0.05576469341767150000 +0.05624159327628280000 +0.05814845620778470000 +0.05830184873493330000 +0.05853364075566320000 +0.05878710974313570000 +0.05891072201389680000 +0.05893480114353620000 +0.05959335324429800000 +0.05974758724655470000 +0.06070688781491570000 +0.06084256520048410000 +0.06174753761041920000 +0.06223814727548960000 +0.06310011156669760000 +0.06319715664355560000 +0.06403519368386680000 +0.06412976546098510000 +0.06456934313648430000 +0.06471628886151840000 +0.06669607003842290000 +0.06712678162995920000 +0.06721159898851010000 +0.06726140022852680000 +0.06764641789172150000 +0.06891041081973680000 +0.06904735780697840000 +0.06959536721681960000 +0.06981337780645360000 +0.06994213043615990000 +0.07031270696176260000 +0.07078456499840760000 +0.07234314656273440000 +0.07235094775527570000 +0.07240255994297620000 +0.07426459627229080000 +0.07542970318561990000 +0.07630482956587060000 +0.07666007462523000000 +0.07681503806214780000 +0.07916059746149360000 +0.07976120254491400000 +0.08037175919489250000 +0.08196665260595690000 +0.08251907575480570000 +0.08291473291965000000 +0.08552828466094850000 +0.08587827830182540000 +0.08605719406393720000 +0.08685243151675330000 +0.08687230988767870000 +0.08719173214322310000 +0.08868801546634580000 +0.08995830064553500000 +0.09110999404683540000 +0.09141455990538200000 +0.09155201960525350000 +0.09199218786140280000 +0.09201996696624760000 +0.09202170895676900000 +0.09214661586103040000 +0.09381723320415860000 +0.09390134519301780000 +0.09458116964345420000 +0.09579111164795120000 +0.09652823215536200000 +0.09667633360459140000 +0.09790845743082230000 +0.09914336997540990000 +0.09967423450030570000 +0.10091233498404800000 +0.10099183645406200000 +0.10131258827370400000 +0.10209937741818400000 +0.10318901916633400000 +0.10403907544628000000 +0.10457252549177800000 +0.10588000092495700000 +0.10597671916169600000 +0.10736784235307300000 +0.10774473102711700000 +0.10806580916122700000 +0.10835934487457400000 +0.10873408074514900000 +0.10910179937817900000 +0.10935890136493600000 +0.11045233349467000000 +0.11071627409865900000 +0.11119619165446200000 +0.11209214859026800000 +0.11250154810225700000 +0.11397695702529100000 +0.11446047803879800000 +0.11498546728229900000 +0.11556600768211300000 +0.11592746946804600000 +0.11660940823817000000 +0.11801433364595200000 +0.11817956546687900000 +0.11897152634559600000 +0.12058951552624200000 +0.12255574540533100000 +0.12276999211112400000 +0.12279472659928600000 +0.12324438960439100000 +0.12733396579999900000 +0.12824326965577600000 +0.13117722289893800000 +0.13123522643901200000 +0.13300308496467200000 +0.13349725197680700000 +0.13371178567632700000 +0.13452065641459200000 +0.13456888604683000000 +0.13470267536092000000 +0.13680497207172300000 +0.13738425948462200000 +0.13946775685053700000 +0.14077756804173800000 +0.14118793248191000000 +0.14147089441354900000 +0.14280019916220000000 +0.14341291459402800000 +0.14382362745538000000 +0.14477160451298600000 +0.14745941742795600000 +0.14809801987073900000 +0.14818894423312200000 +0.14971273759313900000 +0.14993572558087600000 +0.15163674408467500000 +0.15178407732500900000 +0.15210397977355400000 +0.15355424148739300000 +0.15383184998182300000 +0.15531949832026600000 +0.16043818000402200000 +0.16164508072101800000 +0.16259127793205100000 +0.16333176040220900000 +0.16509336453715100000 +0.16702819504169500000 +0.16882355360982500000 +0.16932986099920900000 +0.16975256507259500000 +0.17117589526677900000 +0.17250268643576500000 +0.17388615967108100000 +0.17615388585150800000 +0.17628930836076900000 +0.17640092633770200000 +0.17702774514939600000 +0.17799122337203600000 +0.17906336704157400000 +0.18030924859869500000 +0.18424353164139400000 +0.18543509713010600000 +0.18652184168437200000 +0.18772959633493700000 +0.18780123101494000000 +0.18890722474227200000 +0.19135479988761100000 +0.19290766514612300000 +0.19534919805854200000 +0.19603647714699900000 +0.19843770118664300000 +0.19967969472280600000 +0.20020757790731400000 +0.20211929015368100000 +0.20344526204562400000 +0.20483371715323200000 +0.20594445150561100000 +0.20731543099480800000 +0.20762996803470400000 +0.20793426320748000000 +0.21166868007075400000 +0.21255166626224900000 +0.21284389539565400000 +0.21444562449212500000 +0.21534851082577800000 +0.21657540884093600000 +0.21672766890698400000 +0.21680734769219500000 +0.22018752054890100000 +0.22128221515348600000 +0.22134066488300300000 +0.22300889123558100000 +0.22303083474353700000 +0.22423197473508100000 +0.22822287320502200000 +0.23092064089299700000 +0.23491177339329900000 +0.23554488187516200000 +0.23728492457448700000 +0.23820233503140000000 +0.23893805023809800000 +0.24011177782671200000 +0.24095419043382600000 +0.24313574137527900000 +0.24333208919465700000 +0.24459203116940300000 +0.24738971345103300000 +0.24827202964082900000 +0.24863706351189700000 +0.24980619440084200000 +0.25029646777802100000 +0.25347843032931500000 +0.25422360337365000000 +0.25478241786830600000 +0.25675268345578400000 +0.25697747457535900000 +0.25938411641933300000 +0.26074552103764500000 +0.26655609127022500000 +0.26833642571474500000 +0.26858332069061000000 +0.27098307344598300000 +0.27102450210658500000 +0.27186301187145700000 +0.27361394899676400000 +0.27589074725716800000 +0.27595886607636800000 +0.27618734067590400000 +0.27664553626750100000 +0.28212808467675400000 +0.28753186546980400000 +0.29081246131423400000 +0.29245447805682400000 +0.29295903771633500000 +0.30197908584262300000 +0.30217736853601200000 +0.30293092380267200000 +0.30357477703482600000 +0.30899069126621600000 +0.31298944492010800000 +0.31842950475350000000 +0.32463441342657700000 +0.32667842141950600000 +0.32812835534705400000 +0.32900122485737100000 +0.33135912057743900000 +0.33381970214407300000 +0.33393301766844600000 +0.33494652041804600000 +0.33495637930218700000 +0.33612791522396700000 +0.33728982882575500000 +0.33732712785278700000 +0.33981354836062800000 +0.34118658267337800000 +0.34155093543009800000 +0.34346233414566900000 +0.34720523131628200000 +0.34758437774261300000 +0.34935613620141600000 +0.35261244830767000000 +0.35710135839964300000 +0.36049633147665600000 +0.36260088743455900000 +0.36307955204470300000 +0.36423603691968100000 +0.36801995638468800000 +0.36903260469175000000 +0.36928675256215200000 +0.37196150898302800000 +0.37231601396455000000 +0.37291848647704500000 +0.37384062236553400000 +0.37412283298027100000 +0.37800033641941800000 +0.37976074455773700000 +0.38001777005894800000 +0.38096213508886900000 +0.38184189376684000000 +0.38201455330647600000 +0.38235812851128200000 +0.38969442231018600000 +0.39059131625870000000 +0.39084366339604500000 +0.40844196769496200000 +0.40901503792179400000 +0.41299290372437000000 +0.41366534076897000000 +0.41517921177679800000 +0.41752859124597300000 +0.41946932004659500000 +0.41999638640409000000 +0.42161224652906500000 +0.42201597267482200000 +0.42654085724859200000 +0.42745612120396400000 +0.42766565206032200000 +0.43105226720566800000 +0.43156820744187700000 +0.43761321588511500000 +0.43771023699655100000 +0.43897249338643400000 +0.44007403395336400000 +0.44178228255512300000 +0.44198509454608200000 +0.44343212052735400000 +0.44418184042258400000 +0.44869436641672500000 +0.45009833447315700000 +0.45145669333214900000 +0.45359281568145000000 +0.45400660946528600000 +0.45658710959918400000 +0.45765256259644900000 +0.45790785989873500000 +0.45838245029021700000 +0.46004356628776900000 +0.46027980178190000000 +0.46158851982773400000 +0.46166668859621400000 +0.46591922368098400000 +0.46841854712073100000 +0.46936218307533000000 +0.47172647014464100000 +0.47400055997566000000 +0.47456607336113300000 +0.47609468510289800000 +0.47662672114639600000 +0.48760348295009400000 +0.49315168440603000000 +0.50044074732006600000 +0.50736117804460500000 +0.50762240070999100000 +0.50769381633389900000 +0.50991247553510200000 +0.51386307705073000000 +0.51431624424061800000 +0.51433657766593300000 +0.51667481380153600000 +0.51763213239525900000 +0.52361694854716500000 +0.52763199028631900000 +0.53010576452887500000 +0.53125716027365300000 +0.53333413335324600000 +0.53454022838419000000 +0.53779837181732600000 +0.54233606081274700000 +0.54327774155704700000 +0.54525070925460800000 +0.54575180557307900000 +0.54946305891689700000 +0.54965532699058800000 +0.55097955134146500000 +0.55192963776751200000 +0.55321012638880500000 +0.55841912020870500000 +0.56704197164012900000 +0.56901815210032800000 +0.57226154953513900000 +0.57291626590017800000 +0.57352543466807100000 +0.57777050225243400000 +0.57850564409116200000 +0.58398965962188800000 +0.58471321313792500000 +0.58543257875698900000 +0.58596036443882500000 +0.58873957900153100000 +0.59149422354029100000 +0.59276554807171300000 +0.59560264049073300000 +0.59765970693498700000 +0.60032347141815500000 +0.60078943790320800000 +0.60167294227990500000 +0.60321532805736100000 +0.60657834938074400000 +0.60659269517501800000 +0.61172333886067700000 +0.61685856756528500000 +0.61911935632838500000 +0.61981940062391200000 +0.62835375671111500000 +0.62900365038936500000 +0.63986006886433500000 +0.64091920173389100000 +0.64148307889809900000 +0.64170865355787800000 +0.64276471463543100000 +0.64425137569937300000 +0.64482081105346400000 +0.64765118814788100000 +0.64790564526392900000 +0.65357213590484300000 +0.65622428129510600000 +0.65707604126635100000 +0.65818546022057400000 +0.66139405348882000000 +0.67074742788684400000 +0.67371027382946700000 +0.67555655464585800000 +0.67760358769179700000 +0.68673175192744500000 +0.68767493640872000000 +0.69049266232045400000 +0.69529226113898500000 +0.69636600711166800000 +0.69925000424598400000 +0.70165589841342900000 +0.70220447105631600000 +0.70760351852124900000 +0.70897626143793100000 +0.71183721537613300000 +0.71387081913394900000 +0.71477526518340300000 +0.71678357725589500000 +0.72340753123829800000 +0.72776863622906600000 +0.72907353263046700000 +0.73588850184066800000 +0.73740353119897700000 +0.73850023493747900000 +0.74697340923195600000 +0.74784730771436700000 +0.74827209383107700000 +0.75180834695190800000 +0.75217064250514100000 +0.75223174358754400000 +0.76395694368014900000 +0.77346232550381200000 +0.78399774986623100000 +0.78516408962708200000 +0.79252941755084000000 +0.79606712162185500000 +0.79768432182788800000 +0.79947005380782200000 +0.79954341447004800000 +0.80300880848368600000 +0.80369189925231300000 +0.80555225946001300000 +0.81130809180416800000 +0.81135061244653200000 +0.81874105186183700000 +0.82053769716563600000 +0.82623787934182200000 +0.82646740208298300000 +0.82782504758346300000 +0.82901014187781000000 +0.83801080819658400000 +0.83965296867001100000 +0.84017718342582200000 +0.84126885939796800000 +0.84251540417154100000 +0.84410473222872100000 +0.85030101044215000000 +0.85124632790357500000 +0.85231100390868500000 +0.85246076220008500000 +0.86089602125249100000 +0.86595538602444100000 +0.86875066305078800000 +0.86878879805517300000 +0.86895640650543100000 +0.87179083761153600000 +0.87509262049806600000 +0.87720477074303000000 +0.87929770878747800000 +0.88465126488423200000 +0.89276932895306900000 +0.89381288966549300000 +0.89467586887990000000 +0.90824852786507800000 +0.91129092679214100000 +0.92421812690230900000 +0.92717376781774500000 +0.93058640573150000000 +0.93241551074472300000 +0.93531018539303200000 +0.93599795941069100000 +0.94973004928688600000 +0.95588726701065100000 +0.96745834277177000000 +0.96887980556476100000 +0.97063238735070300000 +0.97459157104234400000 +0.97685532483090000000 +0.97894529041027400000 +0.98080526996259300000 +0.99098893375708400000 +0.99339884178089400000 +0.99771813822635500000 +0.99866507773351900000 +0.99889607961075800000 +1.00272074788900000000 +1.00678775125742000000 +1.00736693772556000000 +1.01329614991625000000 +1.01745337672401000000 +1.01978888679434000000 +1.02389282348368000000 +1.02676834582491000000 +1.02860810176233000000 +1.02925559645101000000 +1.03856758897655000000 +1.06308711811046000000 +1.07282430859531000000 +1.07422292069538000000 +1.07756580134285000000 +1.08330791230822000000 +1.08564857006219000000 +1.09176907850324000000 +1.09825491782530000000 +1.10016404940952000000 +1.11964666363900000000 +1.12203248135515000000 +1.12995584637116000000 +1.15882624311186000000 +1.16635570916457000000 +1.16794715522732000000 +1.17387992319456000000 +1.17702710907059000000 +1.18141940544964000000 +1.18197500149147000000 +1.18620039734887000000 +1.20234504327016000000 +1.20331974471386000000 +1.21025139771202000000 +1.21490443852159000000 +1.21807441648776000000 +1.22186267997742000000 +1.22241370199688000000 +1.22797095881822000000 +1.23866291385432000000 +1.23952553251759000000 +1.24226047103883000000 +1.24226634441361000000 +1.24255296294912000000 +1.25455962365267000000 +1.25538692080289000000 +1.26873938568026000000 +1.27032226834140000000 +1.28036413242508000000 +1.28403182471028000000 +1.29221671106284000000 +1.29775092136549000000 +1.30581222347558000000 +1.30729381873431000000 +1.31414421862804000000 +1.31446904574995000000 +1.31761083052618000000 +1.33623437538827000000 +1.33720921379982000000 +1.35088273398303000000 +1.35114380868843000000 +1.35395121904675000000 +1.36413271314940000000 +1.36827402343932000000 +1.36882063202476000000 +1.36967259197913000000 +1.37899683669258000000 +1.38915261255607000000 +1.39293812846220000000 +1.39352609579688000000 +1.39597599280955000000 +1.40386718577355000000 +1.40569430501314000000 +1.41794398236191000000 +1.43381271688576000000 +1.43681429018356000000 +1.44008572721064000000 +1.44477115527190000000 +1.44803377093997000000 +1.45049421045424000000 +1.45273932239087000000 +1.46719600111296000000 +1.48241090644934000000 +1.48254304510576000000 +1.49140925057475000000 +1.49473733519480000000 +1.50322307711007000000 +1.51585446897578000000 +1.54656111692803000000 +1.55172071672658000000 +1.55364064207359000000 +1.56133519565626000000 +1.56652844230693000000 +1.57069405760812000000 +1.58207715272806000000 +1.59149892734392000000 +1.60404293768278000000 +1.60759663960815000000 +1.60908709502523000000 +1.61556152851595000000 +1.61736594435729000000 +1.62264110010640000000 +1.62455737650463000000 +1.63170037741143000000 +1.63765077075115000000 +1.63957636572785000000 +1.65647526788460000000 +1.66267788414179000000 +1.67099325116428000000 +1.67231131762537000000 +1.68211504801476000000 +1.69498567730418000000 +1.69652838309386000000 +1.69998493085236000000 +1.70378068041148000000 +1.71431085604795000000 +1.74758224555253000000 +1.75176123970820000000 +1.75232020469508000000 +1.75236763229738000000 +1.76017658200443000000 +1.76252677320160000000 +1.76722860417598000000 +1.76737519163857000000 +1.77382956596257000000 +1.78950755965908000000 +1.80108177976971000000 +1.80783056557722000000 +1.81474585652494000000 +1.82209593736391000000 +1.83000788760554000000 +1.84088573760563000000 +1.88305781012564000000 +1.88341367122197000000 +1.88467782455606000000 +1.89776079487418000000 +1.89911715309013000000 +1.90013249627014000000 +1.90453578382362000000 +1.90793319410557000000 +1.91173776830331000000 +1.91216760372734000000 +1.91477972407881000000 +1.92794265189150000000 +1.94363859846699000000 +1.94833410267834000000 +1.95546897688127000000 +1.96624844110554000000 +1.96967609075219000000 +1.97909657123099000000 +1.98519264588520000000 +1.99519829638864000000 +1.99631911705447000000 +2.00551507357670000000 +2.01115833560438000000 +2.01781042581807000000 +2.02509939637582000000 +2.02589372722791000000 +2.05611733112785000000 +2.06524084071379000000 +2.06671265737437000000 +2.06791354000082000000 +2.07779153105434000000 +2.08483874517317000000 +2.08880076668518000000 +2.09498954058435000000 +2.10982916807355000000 +2.12238443809490000000 +2.12365422020165000000 +2.12495981327910000000 +2.14511094255912000000 +2.15256863616598000000 +2.15852621105613000000 +2.16852989148889000000 +2.17212392582504000000 +2.17322971261946000000 +2.17886222477736000000 +2.19131844140075000000 +2.19331015745784000000 +2.19811606913573000000 +2.20949199104630000000 +2.21463561300565000000 +2.23037011744180000000 +2.24355259591201000000 +2.24417066934177000000 +2.25014702898768000000 +2.26485372451616000000 +2.27859406400569000000 +2.28150409419733000000 +2.28341336149760000000 +2.29912173598841000000 +2.30891743635296000000 +2.33821418113171000000 +2.34602320439153000000 +2.39625644384091000000 +2.40916706520108000000 +2.41487187717496000000 +2.41959563929980000000 +2.42777279243100000000 +2.44287016800135000000 +2.44659896854626000000 +2.45887691001848000000 +2.48517007916798000000 +2.48578165419845000000 +2.48947022679423000000 +2.50189923635988000000 +2.50371566745356000000 +2.57023249825803000000 +2.58129982228915000000 +2.59017109973555000000 +2.62407689389425000000 +2.65765059236352000000 +2.66844226030558000000 +2.66953047211006000000 +2.69095199244777000000 +2.70418071813685000000 +2.70464080459802000000 +2.72888439524910000000 +2.75623365709761000000 +2.76184513173559000000 +2.77684087079934000000 +2.80569940573654000000 +2.82490951473280000000 +2.82744715552185000000 +2.84618743647856000000 +2.85849060911643000000 +2.86109413381496000000 +2.90171985535263000000 +2.92611678057546000000 +2.93101516555507000000 +2.93315318068156000000 +2.93622291674822000000 +2.93734941829604000000 +2.94467670088111000000 +2.95221844818676000000 +2.95409097046565000000 +2.96885681973736000000 +2.97260284475216000000 +3.03001765578189000000 +3.04018761137840000000 +3.05785009842673000000 +3.05840351911558000000 +3.07110872883040000000 +3.10982432976435000000 +3.12654418091559000000 +3.14438620699603000000 +3.14930482983422000000 +3.17351043106668000000 +3.18834069300991000000 +3.22036479316733000000 +3.22322502639375000000 +3.22390896599315000000 +3.27894691875733000000 +3.28310031847135000000 +3.37093316045560000000 +3.37723755689817000000 +3.40801342222952000000 +3.44472756025630000000 +3.47589179242994000000 +3.47608058309290000000 +3.51967414830282000000 +3.52990573120825000000 +3.54900524569592000000 +3.58445666935051000000 +3.62245395188545000000 +3.62633684264936000000 +3.66552776231895000000 +3.71129272728801000000 +3.71675959287236000000 +3.78289913621483000000 +3.79978408864646000000 +3.83638783875030000000 +3.84052890769877000000 +3.89036605211605000000 +3.95973258599957000000 +3.98147473350646000000 +4.10252766379100000000 +4.10604275710596000000 +4.15567895265026000000 +4.23568596800872000000 +4.26476723471663000000 +4.30187560603180000000 +4.31721887859945000000 +4.36016954944068000000 +4.40274985647789000000 +4.40847941242943000000 +4.57067887918484000000 +4.70313337468294000000 +4.85329002429415000000 +4.90524496780211000000 +4.96701543266873000000 +5.01955665832064000000 +5.06736060816349000000 +5.10139603709856000000 +5.17920969856094000000 +5.22284575171011000000 +5.32707051131595000000 +5.36475814890394000000 +5.46570736497815000000 +5.47149931403373000000 +5.50221958377819000000 +6.54230306613683000000 +6.78850080057786000000 +6.81597523425869000000 +6.90102676719928000000 +7.21915369221370000000 +7.35876781745378000000 +8.20134894510166000000 +12.98871052370610000000 diff --git a/english/GA4Stratification/data/chi10.txt b/english/GA4Stratification/data/chi10.txt new file mode 100644 index 0000000..eb03c13 --- /dev/null +++ b/english/GA4Stratification/data/chi10.txt @@ -0,0 +1,1000 @@ +0.661428320316503 +1.316774657923030 +1.487364144070280 +1.546092165297460 +1.882785078242100 +1.971548346274820 +2.146472137075720 +2.282557798940180 +2.326761968294480 +2.361310188709190 +2.713829411341030 +2.718297854884670 +2.811562178542850 +2.823211965020870 +2.847092366360620 +3.055733749977650 +3.105762064195190 +3.132796896477270 +3.134197656088300 +3.192244857629940 +3.201006600451930 +3.228684522799340 +3.249398319300400 +3.265722056605600 +3.268589603680950 +3.278355174305580 +3.419038306393130 +3.445749573561970 +3.545507671904320 +3.575665098184780 +3.588755487872600 +3.610604318686250 +3.617565904755400 +3.627648153006680 +3.646126043682640 +3.656253859136470 +3.665547626950930 +3.676005523693340 +3.718093858467260 +3.761217212065410 +3.763978079300980 +3.768732852693630 +3.774560739155300 +3.783858452979140 +3.791514847385520 +3.819333517607020 +3.822441740469720 +3.840773895522560 +3.877868947475240 +3.890924528734910 +3.909511004665420 +3.943012556547040 +3.950468655506260 +3.999790239023650 +4.001244964203780 +4.064695849220660 +4.116590589725450 +4.125778425380790 +4.127356059558350 +4.164357002907140 +4.179563062594850 +4.185508366583100 +4.212605489714960 +4.226985500051060 +4.255865547762700 +4.288741166734320 +4.295197683665780 +4.363817121459070 +4.375115265293310 +4.447207906377260 +4.507617162141100 +4.514889939375460 +4.516677004784910 +4.525236597924040 +4.535234328623740 +4.541820031235400 +4.553286434527640 +4.558059900414690 +4.564502680587880 +4.588639236548820 +4.591854122080620 +4.606365200350350 +4.610840821553130 +4.613314073577710 +4.641332834304440 +4.700027485421160 +4.704439212325330 +4.724705580015960 +4.725848153441570 +4.728413044779450 +4.737902202440020 +4.747229125927620 +4.747801695139750 +4.752584180438990 +4.757898418196190 +4.759258346273740 +4.762686466279550 +4.765738456624110 +4.773716098382200 +4.775439229959800 +4.781027890264450 +4.782120267338670 +4.827545597219180 +4.831589040660970 +4.833949368272980 +4.848828008542700 +4.853831053685040 +4.887216992524860 +4.890777280439630 +4.910959425117350 +4.964297447040420 +4.970689498109600 +4.970707594121910 +4.998689613829980 +5.003500965218430 +5.034228779008710 +5.040935994351190 +5.067345807187900 +5.111819791925570 +5.121995782319620 +5.123576881093160 +5.148121645086110 +5.172140946846840 +5.195449000521090 +5.199971228065500 +5.232411191330520 +5.235538184519970 +5.252098002332250 +5.254573886718820 +5.260887505414030 +5.274911756262780 +5.279424738544460 +5.290460120615640 +5.293356477105180 +5.295461077447830 +5.311962249304890 +5.347525948695750 +5.363946451630560 +5.401064046981310 +5.402063315058330 +5.403075701926970 +5.405537662991310 +5.417749454951860 +5.428896011466910 +5.434721672859630 +5.438695352242420 +5.441852599813650 +5.449974178515270 +5.472850593872890 +5.484533966991070 +5.487405644664930 +5.518929211341030 +5.543273595779350 +5.549041520429900 +5.561039335736500 +5.566221217076070 +5.575366977439850 +5.577033186024250 +5.600742953475210 +5.635510141563750 +5.638261523575110 +5.639420959168290 +5.653585583418140 +5.656244399550620 +5.657070022473700 +5.675896469751780 +5.678646274464800 +5.680628447417660 +5.688463775085340 +5.692603923295990 +5.693587603059710 +5.693759167751250 +5.697801682516400 +5.700317646460320 +5.720071559046910 +5.726569395691420 +5.738238181454210 +5.748671842120840 +5.758520302548510 +5.773081886497770 +5.781301152168320 +5.783241872478130 +5.831436348393100 +5.839310463201300 +5.848297585645600 +5.878935753905570 +5.883380981157540 +5.911834389552220 +5.939354728518010 +5.939518372278740 +5.951335737371100 +5.954968663052440 +5.995670207043580 +5.997462710304490 +6.003188636374840 +6.028782639118660 +6.032550032751090 +6.041847196190290 +6.070785804046800 +6.089192076851970 +6.099906193162320 +6.109187954724920 +6.110368768987010 +6.113669935783810 +6.130349502793360 +6.132686313573110 +6.134894598644920 +6.138510067405030 +6.143265213315530 +6.150787748424210 +6.153486067144080 +6.153879661250440 +6.187618212535050 +6.194174055461030 +6.196387222881830 +6.228918047407950 +6.233498448452900 +6.253145408893270 +6.255285685425680 +6.257410975291110 +6.280115542220800 +6.284476194245450 +6.284510146371520 +6.294051810853070 +6.296402437740240 +6.341146021909020 +6.341879082333600 +6.355504129271200 +6.387289716469170 +6.395851741348610 +6.398136633519720 +6.405442814925940 +6.411963574694860 +6.413438312556980 +6.417490261728030 +6.424113815285960 +6.428028396439310 +6.440917153145780 +6.443568507829060 +6.444850743070900 +6.454944869626780 +6.479510151931370 +6.502478233248520 +6.503614543162940 +6.508759172682280 +6.546649899375540 +6.558216572314980 +6.579323005736140 +6.582596070454990 +6.583680325938700 +6.584818858554790 +6.607762386869070 +6.618669990999710 +6.626833011841790 +6.632758267128150 +6.633462425164470 +6.635367438770940 +6.635966441926980 +6.648227010416500 +6.655208368618130 +6.680876857363630 +6.683019685873210 +6.692307610059510 +6.700378119638940 +6.721175939669400 +6.727151965666270 +6.727949098447030 +6.761076632799260 +6.763436936647260 +6.778310364579170 +6.792657308562490 +6.795759070811140 +6.797534196316080 +6.813105518029950 +6.832890285499280 +6.868545465461110 +6.882342533050000 +6.891680656552830 +6.895276705573870 +6.902930223847860 +6.903915021467590 +6.905361817571480 +6.910185365818720 +6.910190684191920 +6.918097047130830 +6.935765171508200 +6.962626245617920 +6.975210631490610 +6.982186551427790 +6.995241095630470 +7.016806400574600 +7.026248526954250 +7.031657840621700 +7.032815129962550 +7.032897257139620 +7.034349713504440 +7.036653410133550 +7.045654245849440 +7.048294161222550 +7.055984430895330 +7.057347299909360 +7.073976833411640 +7.078836971674130 +7.090669190685460 +7.090804875537200 +7.095846264044970 +7.120887675171930 +7.137441503009160 +7.144653420641500 +7.151857266383860 +7.155263955220830 +7.181925902915040 +7.191544339665260 +7.202105739390240 +7.202867561377940 +7.207838926243600 +7.213745972501640 +7.221187685082310 +7.221401240305060 +7.228486073650760 +7.229702714183510 +7.229802669829850 +7.232781891047660 +7.236822433903880 +7.236988921257040 +7.247029602658370 +7.247344394724820 +7.260361267608040 +7.273788225642550 +7.274548666380980 +7.284274843567730 +7.286261298564050 +7.295793048238680 +7.340896585430860 +7.347658686038830 +7.357993020990380 +7.364957176394650 +7.374048819754760 +7.402205001196450 +7.431716587189340 +7.432055253203720 +7.440369568883190 +7.443840558812270 +7.451986338580500 +7.477355680500610 +7.482773086538340 +7.493045249348670 +7.500492818074650 +7.507852688733200 +7.518511344185900 +7.531752740937650 +7.539397840481810 +7.579331431219710 +7.596051895621800 +7.681013873749710 +7.697540624556700 +7.710343271718860 +7.712805488954660 +7.728677906249320 +7.731913013671640 +7.747109231782380 +7.748366146368200 +7.752543033931880 +7.768177946069240 +7.769051045582270 +7.770688724997960 +7.793207305082360 +7.798389457265290 +7.799259140656650 +7.823102211481770 +7.824413853048390 +7.832161631945540 +7.841079385235530 +7.862378018537650 +7.873088818841660 +7.879414130133620 +7.883314529904520 +7.928378451348520 +7.952175991329710 +7.955175700805170 +7.958575343776070 +7.958712583967230 +7.970848101668030 +7.988388813263350 +7.995863670884030 +8.005377261559620 +8.017269551785000 +8.022069456750590 +8.023573000374060 +8.034174965855970 +8.053264944222170 +8.063027399381920 +8.067138850295900 +8.071733676163650 +8.082818489931020 +8.091665451179660 +8.110742748585890 +8.111971886288640 +8.127451028913510 +8.131158470568960 +8.153257527630900 +8.170672978638170 +8.173883546508160 +8.175420657870640 +8.181047494504710 +8.189106704011340 +8.193911044560310 +8.197115164587810 +8.202157663569060 +8.213316468218610 +8.245538638376310 +8.272205005228100 +8.284340651302250 +8.305362675184760 +8.335770155812030 +8.340317003501100 +8.343852733157850 +8.366190642306650 +8.368346098420710 +8.377316651220010 +8.382545732281760 +8.383404117319040 +8.400277255251890 +8.402585122827980 +8.409942142725510 +8.417992559695080 +8.419158477318230 +8.464687735189800 +8.468084288777400 +8.475223088580100 +8.506859438578400 +8.513622924944980 +8.518686434003360 +8.523069564002520 +8.531143848038870 +8.535090568663240 +8.540402845776180 +8.550612576347810 +8.589430122478950 +8.601004584804050 +8.617473661777730 +8.623355567488710 +8.641376062446960 +8.665063111400580 +8.686205666706120 +8.694811643924170 +8.705274661491910 +8.712102872062010 +8.739612047902790 +8.744134203790650 +8.744622067953900 +8.763357624149150 +8.768100465021450 +8.775239241812040 +8.791090381747890 +8.793763701533290 +8.869041163582970 +8.870275340602720 +8.873609844180370 +8.879228108294420 +8.891538004543090 +8.909918163805760 +8.926358636866440 +8.935213342680030 +8.954939764985950 +8.961543960532510 +8.962647430969330 +8.967538894025230 +8.977144714089880 +8.987274987855420 +8.992632287373340 +9.005092620991470 +9.011084266045600 +9.026754156041680 +9.040324018494000 +9.053813942424880 +9.055552440957600 +9.091043895516360 +9.098078348593610 +9.105057488038500 +9.107766126829570 +9.114330206683360 +9.114453152093220 +9.120104546537410 +9.148156791641730 +9.151375407416710 +9.167669743408500 +9.181953535700770 +9.184285471777270 +9.196179381695870 +9.198327468182410 +9.204091020631740 +9.204144213992560 +9.205390930804710 +9.238329556899820 +9.257916901467870 +9.262228882520030 +9.268285646424600 +9.271728990719650 +9.297411034998780 +9.300765741465000 +9.306684640461560 +9.312599159799360 +9.313270726759550 +9.336006903821660 +9.339669671810090 +9.340758579038950 +9.349751545331220 +9.372419185439430 +9.405262472643620 +9.423695907805400 +9.438333021076660 +9.463955646458440 +9.510760046481610 +9.522009519767770 +9.526184377258390 +9.530331732367720 +9.537496493862430 +9.548366417128710 +9.574421091414140 +9.579263780027130 +9.592936113493240 +9.593605849283630 +9.612264453105360 +9.624503526995840 +9.639982466565260 +9.643201497083100 +9.668813415730280 +9.682182818892330 +9.717771365458650 +9.730798060828770 +9.735847355508300 +9.743334182929750 +9.754724609031700 +9.781789410891940 +9.818767980180480 +9.833674034469570 +9.841179447844720 +9.856734008101790 +9.863008160010140 +9.889112142508290 +9.900348522956380 +9.904620838963000 +9.909447420583840 +9.918328929734540 +9.918981496531290 +9.921743710615750 +9.943960047153820 +9.959325942417070 +9.984286905490180 +10.014726808235500 +10.028968991524800 +10.032542766370900 +10.057217726013600 +10.059828469411000 +10.059992878504000 +10.060096081764100 +10.068011210977000 +10.071319725856600 +10.095532650372900 +10.097196343618500 +10.098606203733500 +10.114329277305000 +10.119927711709400 +10.139759327893600 +10.145107813135900 +10.168908807142800 +10.171070362281900 +10.179952921845100 +10.180256607402800 +10.180784236428500 +10.186249011012400 +10.221437044183200 +10.231749617442300 +10.255454204097300 +10.266975952484100 +10.272229430258700 +10.272597021651000 +10.285925341276100 +10.287821825899300 +10.300651785247300 +10.303484681835900 +10.316278990081500 +10.322013450977800 +10.333219604570100 +10.334655896608600 +10.344603711513000 +10.357161618557900 +10.360882769173700 +10.364115287925700 +10.385659700489800 +10.406656158562300 +10.428236263593000 +10.447891909170900 +10.453007184316200 +10.457032810550400 +10.457323550371000 +10.460252079879300 +10.485737336349700 +10.526008678588900 +10.555512657252000 +10.563552115839600 +10.572794930466800 +10.577261942485600 +10.587662835879700 +10.590131572931600 +10.599368303789200 +10.622295228001300 +10.624213682537100 +10.655117678762000 +10.660628494144600 +10.678978332095500 +10.679761974196700 +10.690591817505400 +10.717757774984300 +10.724761112839200 +10.725448290466200 +10.735527054103000 +10.736749659479100 +10.768771250178300 +10.772382424266400 +10.772601862853400 +10.785625793498900 +10.795449906724300 +10.797070239275900 +10.810110981299900 +10.818441255938500 +10.845450511499700 +10.848697194460500 +10.852815203893900 +10.898396329851400 +10.900162059843500 +10.946727667300000 +10.950975928752000 +10.951499108986400 +10.952463136780700 +10.953708523507100 +10.959283376094000 +10.966225086613300 +10.970584811694200 +10.982039963250900 +10.990393189499700 +10.991547327760600 +10.994251483610900 +10.997174318933600 +11.007129786849100 +11.013869013821500 +11.064175307384900 +11.070607933396200 +11.099883131845200 +11.104576471327400 +11.116908154304000 +11.118880552256600 +11.122527324775100 +11.125272938225000 +11.126236607459000 +11.159112699995100 +11.159753161968600 +11.166483791302200 +11.173137585089900 +11.176865364832500 +11.178135162229500 +11.188390253593900 +11.195119821298100 +11.201683224356600 +11.212060581149800 +11.216920720390600 +11.218049188894000 +11.259843112920200 +11.262063535684500 +11.269022641989100 +11.278216842970300 +11.334223552799400 +11.340759401500000 +11.347187036534200 +11.355383860658700 +11.360640266129900 +11.368005680448300 +11.386573449957100 +11.416782056428000 +11.440641048298600 +11.474512122912700 +11.476865911065200 +11.478013551787700 +11.490517613433400 +11.502568819871000 +11.524564225245800 +11.541872608665400 +11.560042934613400 +11.566125983203200 +11.591848532532800 +11.629178599912000 +11.637644649507300 +11.638753599322400 +11.644582177536600 +11.652048568268600 +11.698035602165700 +11.700388422996700 +11.705246173742600 +11.717918965476500 +11.719395001211600 +11.721607135988500 +11.750252258894800 +11.758410872661100 +11.786364664389300 +11.791566362087600 +11.794388005195500 +11.804240209827100 +11.842414309055200 +11.856417858802500 +11.875261830870900 +11.898190769741900 +11.901963992898300 +11.913130963221900 +11.917923159958300 +11.961423214682100 +11.965250416104100 +11.987667329933700 +12.013013147019700 +12.021383428263300 +12.024731864674200 +12.047214936006300 +12.071864974265100 +12.094857960723400 +12.116911669336700 +12.123298890308000 +12.175150811413800 +12.200912030115800 +12.243182129138500 +12.250408560215300 +12.251857457794000 +12.261402366875300 +12.268376777125300 +12.271776206964700 +12.285551270515900 +12.323344085823100 +12.332598639746700 +12.349894092525000 +12.359950479765800 +12.370486319750700 +12.371981144405800 +12.399586304913000 +12.406624032534200 +12.408295301994600 +12.438167431939100 +12.448392590217600 +12.473513855366400 +12.479933615215700 +12.493475019523400 +12.512678425864700 +12.529929564161400 +12.530540597757300 +12.554456554796200 +12.558284754814800 +12.571375197801700 +12.589258335345600 +12.598711575452800 +12.611187464047700 +12.662431965930300 +12.693462431090700 +12.701315487709700 +12.705836851882300 +12.723390023728800 +12.731767362891400 +12.734523863964400 +12.772337933374200 +12.803354123351400 +12.810783959876200 +12.843369749453300 +12.856159630446800 +12.856569235731100 +12.863083410983100 +12.897157713210000 +12.943071990284900 +12.947362017255000 +12.991251952162200 +13.007282369626900 +13.032056867229400 +13.046340643303600 +13.074483284612900 +13.087397854681500 +13.092404442534900 +13.103248887838400 +13.119750824792900 +13.120113104890100 +13.128341499014700 +13.168688976842800 +13.184499159157800 +13.193534577749400 +13.220508275011100 +13.227217170363700 +13.231710740876000 +13.238297266220400 +13.242042427588100 +13.248336816975800 +13.250430942900300 +13.300856308281000 +13.303622377253800 +13.305982424699100 +13.319915118056300 +13.322690702174300 +13.356533856294100 +13.417478220566600 +13.427800498694200 +13.448229057005800 +13.462704456222400 +13.468352439464600 +13.497619324534700 +13.501879646959700 +13.523244768959900 +13.540272191961200 +13.552904796050800 +13.568611696973600 +13.588202843956400 +13.605528756219900 +13.618832640128100 +13.635566741472800 +13.654760726787300 +13.657644201905800 +13.745115200023400 +13.804233285285900 +13.819231098579600 +13.828157868814300 +13.838596030831400 +13.853648490903300 +13.858435499201700 +13.883971200000100 +13.917808352908200 +13.943258004758800 +13.944767689235500 +13.950429599085600 +13.955358565073500 +14.006396074950700 +14.098033377182300 +14.129833197870400 +14.176955509478800 +14.209999690525600 +14.277609855596000 +14.285227748438300 +14.328498473316700 +14.343395749614600 +14.367862567996300 +14.370087249876900 +14.385915551807100 +14.389720230974800 +14.393969214552000 +14.427907311721700 +14.441523789858000 +14.448421804996100 +14.483287063868400 +14.495782027303700 +14.533345122312200 +14.550576908006400 +14.570387615936900 +14.572691031363400 +14.618666856162800 +14.633812937210200 +14.657459414431000 +14.678348275552900 +14.680809494074200 +14.685261544383200 +14.711025503443100 +14.731650109314400 +14.735250060317700 +14.736320388091700 +14.765358711886200 +14.811265304034000 +14.837913321315600 +14.877742897032700 +14.920064421691600 +15.006485810893400 +15.022765969440000 +15.061870660899100 +15.124078006357500 +15.135425539986600 +15.157738754258900 +15.234066000370100 +15.236321629708700 +15.255176391686900 +15.276829669636900 +15.297108687410700 +15.391421119892400 +15.391973884766900 +15.414038157199500 +15.422624497446100 +15.436186540394900 +15.528509204669600 +15.592506732423200 +15.614550137742900 +15.647365050729200 +15.715389739883600 +15.768191015719400 +15.812788183664000 +15.893046911426400 +15.951591820066200 +15.978777631262600 +16.021871063722600 +16.021894510425900 +16.053975501568300 +16.055700701369100 +16.095123711607100 +16.134895759755600 +16.154204303356200 +16.177068405199700 +16.210662924015700 +16.241965750968300 +16.249921403426600 +16.283123211671200 +16.371001218495600 +16.398124387029300 +16.537088905893200 +16.549363021261900 +16.589198450481000 +16.629165510285300 +16.630591250701500 +16.649426207008000 +16.660744776247500 +16.774082812658500 +16.873212692495700 +16.888253160597100 +16.896438627018500 +16.912295765682300 +17.093507585094000 +17.113668480850100 +17.151825324027000 +17.268868904942600 +17.337854458863400 +17.544562470174300 +17.566326548779400 +17.616132244677100 +17.661768647644500 +17.689529515839000 +17.814953475373700 +17.826525141613800 +17.852240482768000 +17.924858669063500 +17.990542673923000 +18.046298086548500 +18.062250354935500 +18.107557986914400 +18.117255888953600 +18.133036143858900 +18.141082253700200 +18.156536230871000 +18.369677357890200 +18.400339173203400 +18.481745511878200 +18.506531267435100 +18.529027125476000 +18.594398128947500 +18.630839597647000 +18.637207078108000 +18.680673646513100 +18.714486717613400 +18.749985170568500 +18.869177638001600 +18.989266682154300 +19.026373720362800 +19.096286869165700 +19.303189261313600 +19.397815417177400 +19.416431242982000 +19.489002229327600 +19.546330578889500 +19.638144148294800 +19.898902373934300 +20.051797111490800 +20.112092866816300 +20.250529128111900 +20.255032852175800 +20.258603019727900 +20.476975458320700 +20.551467578789700 +20.624419258809400 +20.879380082642400 +21.015169898522600 +21.130114865886600 +21.365059200442400 +21.449553373181600 +21.491662489964800 +21.850235942921100 +22.121870671079500 +22.241330194148400 +22.264116259158900 +22.479315208935100 +22.846042706241700 +22.887995787264200 +23.022520812733700 +23.737071083141500 +23.818930457518500 +23.997782221032300 +25.587398818355000 +25.833648310952500 +25.870876905341200 +26.577940050992700 +27.220912845039200 +27.366787093742200 +32.975503966344900 +35.475820107910300 +36.000346120945300 diff --git a/english/GA4Stratification/data/chi15.txt b/english/GA4Stratification/data/chi15.txt new file mode 100644 index 0000000..56dcf53 --- /dev/null +++ b/english/GA4Stratification/data/chi15.txt @@ -0,0 +1,1000 @@ +3.91984491436103 +4.30126487179861 +4.52240388696963 +4.56061701771692 +4.78028790852164 +4.79790897063784 +4.80890950544999 +4.90992848154461 +4.93401789148851 +5.22587177589907 +5.31223944245926 +5.40043341349673 +5.47965616149427 +5.60327689635595 +5.61579967420894 +5.63732681064646 +5.70031169542427 +5.72043885982456 +5.85311429794419 +5.90214297979026 +5.95548503998050 +5.95804993684858 +6.01800206273179 +6.07811313080057 +6.09675915957104 +6.16332539081004 +6.24591685964182 +6.25358635301819 +6.30631168549580 +6.36415359367991 +6.39492104869131 +6.41954758927197 +6.51516450286385 +6.51584917461148 +6.52208509682740 +6.60029552630009 +6.62527221755586 +6.63906836700558 +6.75166238413067 +6.75190486018971 +6.75320148106943 +6.85742495753976 +6.90281043005994 +6.92280844911850 +6.94922766283699 +6.96476528648926 +6.97427082388928 +6.98913796418546 +7.05381068119889 +7.06778696106984 +7.10233944348493 +7.10708469443023 +7.11568529806644 +7.12577789863300 +7.17169497815733 +7.17702940980318 +7.21437807946519 +7.21763786313827 +7.23135597138468 +7.23672515879527 +7.23744516122595 +7.26537474220460 +7.36227172072254 +7.43321032863631 +7.43504138212630 +7.44716896120970 +7.45302014781619 +7.52250795440075 +7.53150642460472 +7.54186511403570 +7.54214430838790 +7.56155127456954 +7.62063859215387 +7.64153306130412 +7.71798213270657 +7.74774939297174 +7.75404781575449 +7.76655345591259 +7.77193055003627 +7.79609473503371 +7.82122477412756 +7.83191008912633 +7.88345794544878 +7.90371800578177 +7.99370066507285 +7.99814735192049 +8.04901805788299 +8.05145194844134 +8.06416185276849 +8.10766623673264 +8.16749444641096 +8.17412043134216 +8.20272028855217 +8.20428603451312 +8.27572490918297 +8.28944226745538 +8.31603793750748 +8.32580809072201 +8.34497880478308 +8.38084213937611 +8.41733123540186 +8.41856552698309 +8.47206739728969 +8.52142417986880 +8.54448391447885 +8.55884564767327 +8.61567991380609 +8.61845984989287 +8.62441545512552 +8.62998939719533 +8.63548887248227 +8.65656225397172 +8.66732119442336 +8.73140127985060 +8.75141751782579 +8.76942637302532 +8.77510045966019 +8.77677711888879 +8.77911255508108 +8.83605247175186 +8.86626149629867 +8.89471570419412 +8.96932379024004 +8.97155414619306 +8.97257097350173 +8.98782174352952 +8.98925859666458 +9.02093327976202 +9.02793111074482 +9.09477624479009 +9.09951995919631 +9.09997384743177 +9.10111582552654 +9.12524843047096 +9.13246049099280 +9.16512433446906 +9.16792253881259 +9.17790199864204 +9.18286605717525 +9.18351966703206 +9.18920432925678 +9.20250468066691 +9.22625447986555 +9.24154585582495 +9.24689254265767 +9.25092100397195 +9.27043699912130 +9.27151600103072 +9.28697296213641 +9.31510379984651 +9.32382632308850 +9.37747731499759 +9.37816053247844 +9.38586409934489 +9.38655520220119 +9.40402978463426 +9.41042014422511 +9.45020184514255 +9.46307726177786 +9.47382687998289 +9.48825362890915 +9.49018669889743 +9.49585750255443 +9.52102195570854 +9.52356264384363 +9.52381505224398 +9.53875461037832 +9.54292743881097 +9.62319457529960 +9.69741470218971 +9.69887140681104 +9.70730047498513 +9.71499438170768 +9.71884742740596 +9.72762236791295 +9.72974816601097 +9.73140589164259 +9.74118042543459 +9.74716769494817 +9.74848520642112 +9.76491198318581 +9.77843104241306 +9.79667765653996 +9.84866248152614 +9.85497892810200 +9.90124367822351 +9.91676918838922 +9.96159697444360 +10.02581623844160 +10.05834123732430 +10.06850142308050 +10.07684326706280 +10.10361719554120 +10.11368995689680 +10.13629083137700 +10.13844234302650 +10.14060608468320 +10.14792731788430 +10.15325996394550 +10.15821541950810 +10.16238811795760 +10.18576672588480 +10.21825682481210 +10.23490431924450 +10.25387695040840 +10.27581642244700 +10.29056560194960 +10.30124881123200 +10.30601470336810 +10.31056223005670 +10.32018985587700 +10.36551237933670 +10.38794178389190 +10.41970509216250 +10.42807643490380 +10.43023090180570 +10.43550270925660 +10.44766111662890 +10.45038131557070 +10.45684727773350 +10.45969812924160 +10.47572395237940 +10.51400313389310 +10.51890244694970 +10.53188013127610 +10.53414128667800 +10.54802901387250 +10.58242706221320 +10.59765332485600 +10.60416095918360 +10.60817507487140 +10.61777351925420 +10.63690383604230 +10.63932193651940 +10.72277973725150 +10.76703105273880 +10.77724621318670 +10.77848447330910 +10.78855553736960 +10.82712287124260 +10.84094844239350 +10.85298176166100 +10.87273213870800 +10.90039414257950 +10.90743202702920 +10.91099539493510 +10.94199695276230 +10.96656165869240 +11.00388175321230 +11.04550811098740 +11.05222277799420 +11.05309850427980 +11.05511403267480 +11.06248494199590 +11.07972689973570 +11.08538490437220 +11.08595509845370 +11.09060593035770 +11.09159156289640 +11.11366452979710 +11.13251839133360 +11.14761917520620 +11.14765508453600 +11.15433280060990 +11.16089241159840 +11.16643148312480 +11.18494265376100 +11.19164666487910 +11.19575124088110 +11.20276984344030 +11.20583438718950 +11.24283355003240 +11.24751030898480 +11.26193818744770 +11.26202975699800 +11.28220062300530 +11.29127258472990 +11.31520469760240 +11.33681257520150 +11.33826051250330 +11.34681778615120 +11.35201474681260 +11.36985615552260 +11.38843768501630 +11.40788788218370 +11.41827918048170 +11.43801755268840 +11.45728867720270 +11.45972737468170 +11.48005983642920 +11.49092231470000 +11.52198297164810 +11.53080337491800 +11.56215106527780 +11.57077589728130 +11.57554523163080 +11.58565897236280 +11.60739665704450 +11.60844323466020 +11.63689440344540 +11.64233053519700 +11.64444805420640 +11.65606626417070 +11.66172041984460 +11.67753914941590 +11.71189961501510 +11.72635713351450 +11.74602966628900 +11.76793204148560 +11.78029062713020 +11.78517323316890 +11.79557302812740 +11.82596106971020 +11.83455632762670 +11.83458590243590 +11.83915390731570 +11.84989659473260 +11.86449284836320 +11.87100971493720 +11.87704228647470 +11.87916349774810 +11.89267086257590 +11.89430001922830 +11.92700272074880 +11.92930760239510 +11.94400763151160 +11.94453047570170 +11.94570382437600 +11.99319947266510 +11.99344329861640 +11.99583713186920 +12.00596442629910 +12.06193616774170 +12.06565036937450 +12.08718581352660 +12.09355552156010 +12.11011024478200 +12.11992121318340 +12.12718058993140 +12.14227184976030 +12.14720050244580 +12.15346096435710 +12.18336996670300 +12.23202111512210 +12.24746586672250 +12.28948870611600 +12.30917200937310 +12.33206456198920 +12.33834428586720 +12.33894972907520 +12.35743834196790 +12.37315399459890 +12.41586528683360 +12.42592495738820 +12.43743237760310 +12.44983512577280 +12.47194678292740 +12.49788250076570 +12.49979272817170 +12.51959849422530 +12.52736548557980 +12.56200448410700 +12.56235244289350 +12.56389716210850 +12.56873238621550 +12.58708255827340 +12.59259926883210 +12.59729916898990 +12.60025008239260 +12.60306331319430 +12.62429099325280 +12.62717293470080 +12.65227623755100 +12.65329577771510 +12.65473640847490 +12.65566170185640 +12.65829375404850 +12.66792024625160 +12.70698560423970 +12.71014289611660 +12.73108992359770 +12.75408073894980 +12.79870793674990 +12.80694564758810 +12.81212686877280 +12.83058481343500 +12.84192300741230 +12.85865431605620 +12.88325530470820 +12.92544806766040 +12.92862425824940 +12.93058766957310 +12.93749296263980 +12.94956912838040 +12.95659456632110 +12.96849307120330 +12.97410609044890 +13.02773568049160 +13.04004176546500 +13.04076571367170 +13.04412991994550 +13.04965629876410 +13.07129768749530 +13.10210691317450 +13.11778098335200 +13.12344592207820 +13.12987818608480 +13.13618893931240 +13.19261586771880 +13.19668053493160 +13.19855656143890 +13.20487386429660 +13.24101417772280 +13.24866981089650 +13.25345192769400 +13.27472763908680 +13.27705598036620 +13.28321969515660 +13.30490436014370 +13.34556962919470 +13.35450497320700 +13.39154038039160 +13.39510087999870 +13.41651434413110 +13.43749097991720 +13.43985236118810 +13.49258226419260 +13.50760420459360 +13.55117368781180 +13.55578164872030 +13.56783957834940 +13.57007232235180 +13.59237469569210 +13.60209761665090 +13.60260678688260 +13.62149987182780 +13.63747946360160 +13.64266894365800 +13.65226593384940 +13.65444341623140 +13.66226726488660 +13.66718114463380 +13.69266320933350 +13.71091403095570 +13.71506218452460 +13.71520075047250 +13.72193897500020 +13.72806459271270 +13.74162751490810 +13.77336651274810 +13.77389202052730 +13.78952903697130 +13.80507456961210 +13.81094429432270 +13.81406714750220 +13.82336148191290 +13.82845260069420 +13.84135602799930 +13.84320365510180 +13.85049728339090 +13.86850615393730 +13.87328893934180 +13.88012924690910 +13.88713978124770 +13.90194703186080 +13.92178485519220 +13.95175440863140 +13.96756191891320 +13.96826495600680 +13.97572358863130 +13.99553236920830 +13.99766673235250 +14.00382926366900 +14.00652194596380 +14.02323072402970 +14.04167033945410 +14.05380632629530 +14.06447090131680 +14.09376051754310 +14.09486809774610 +14.11667600449950 +14.11826965487290 +14.17251552583160 +14.17452551975230 +14.19167992519670 +14.21845115360580 +14.22829037295940 +14.22920518422500 +14.23179515730980 +14.23311612677230 +14.25107247962850 +14.26405871299800 +14.28251627189240 +14.32275222300250 +14.32848787561850 +14.34231351209870 +14.35967750620430 +14.37166097390970 +14.38529953171680 +14.39117531617400 +14.39544064627220 +14.40536814735970 +14.41190745178750 +14.42010618871470 +14.42020093218060 +14.42491882416820 +14.42633827686000 +14.43677711466470 +14.45784276134350 +14.47059632964100 +14.48245051629280 +14.51786315664170 +14.51871450589030 +14.54801440439750 +14.55317363681820 +14.56130507747810 +14.56772241134190 +14.57133687098080 +14.59161399634320 +14.60749489751920 +14.63519542496490 +14.65853052083570 +14.67866229523210 +14.69677103942280 +14.70032591896910 +14.70054004152340 +14.70191357386520 +14.71487377126580 +14.71715896073040 +14.71942129973670 +14.72220821423670 +14.72440826554300 +14.75328483984290 +14.78945656173090 +14.83931087113590 +14.84607130321560 +14.85636314114130 +14.85695292079630 +14.86008065921700 +14.86275441394860 +14.87691406707890 +14.88190211675070 +14.89810083549420 +14.91508442342810 +14.91773958749290 +14.93100490085890 +14.93344415522360 +14.94527550142870 +14.96082087184300 +14.96946353505200 +14.97850601248670 +14.98743782619040 +14.99286935376530 +15.01382857970690 +15.01419160826130 +15.03495005453730 +15.05824570178050 +15.10380328866510 +15.10618334032280 +15.10982649726450 +15.12602136708190 +15.13780122091110 +15.14221141166170 +15.17790732537620 +15.19184367524350 +15.23775684715200 +15.24749617452980 +15.27594766505640 +15.28480476368560 +15.30542933436590 +15.33517840569320 +15.36211793758060 +15.37110619240870 +15.37789623093680 +15.43319714029100 +15.46136290258740 +15.52977380730820 +15.52988981635330 +15.54669474263330 +15.54818186269020 +15.56005914609800 +15.59069145665870 +15.59136915638290 +15.61254023122000 +15.61368595909010 +15.62841376106830 +15.63364530544750 +15.66701419594490 +15.67511161723680 +15.69819627870150 +15.70699741577350 +15.74297582996230 +15.77790522318900 +15.77815781746240 +15.78177149758780 +15.80093227876390 +15.84453228127870 +15.85396722983360 +15.86332878025040 +15.87305788572210 +15.88907799663620 +15.90408475665640 +15.91166143038540 +15.91584531065440 +15.92571606905030 +15.92701098833680 +15.93510819460090 +15.93618526833990 +15.97354600876040 +15.97460631481430 +15.98115059652520 +15.99071403708300 +15.99186162176470 +16.01266455676700 +16.01629109131220 +16.04423207948190 +16.04995257892910 +16.06404389919510 +16.07263898413100 +16.07781065616530 +16.08328059609170 +16.09610632658340 +16.09717223822760 +16.12355850162160 +16.12729820321000 +16.16820310249090 +16.19846631408880 +16.22157002219610 +16.22650700179110 +16.25056959777080 +16.25925729177710 +16.26319121295410 +16.26476279832660 +16.27237819307570 +16.31090744573350 +16.32673548113880 +16.33522491301710 +16.33553542641890 +16.34058295008690 +16.36814023052160 +16.37117187943360 +16.38519616075090 +16.40062882521130 +16.42455684161330 +16.43853315447460 +16.43935084079600 +16.44092632907760 +16.44695006604500 +16.45358389045640 +16.49045801704940 +16.50282850953990 +16.54982009009600 +16.56381967333490 +16.62333150226470 +16.64558418415530 +16.65661171049120 +16.66373712701750 +16.66789791952470 +16.68521159083450 +16.68645956814590 +16.69419901264080 +16.70040636128940 +16.70462313837830 +16.70921412919520 +16.78695639443430 +16.80435036283420 +16.83670015803500 +16.84597338017940 +16.85594647162390 +16.87994826340880 +16.90751549437730 +16.90812452461980 +16.91295006181960 +16.93002191871460 +16.93164680148290 +16.93650941820190 +16.93809203323880 +16.96823807819130 +16.97162952021780 +16.97262155929340 +16.98414411471530 +16.99006155163620 +17.01495197193600 +17.02357850341820 +17.02508878888960 +17.02581385608460 +17.04073717257620 +17.04076192776300 +17.05839044746660 +17.05937979272400 +17.06097142870690 +17.06272810970160 +17.07567627479760 +17.08179655747550 +17.11279466452730 +17.11433200171430 +17.11976785616730 +17.15655568333740 +17.15701999738160 +17.18726476539620 +17.18834900330020 +17.19057198843610 +17.23816629438410 +17.25832611381710 +17.27098600901670 +17.32329594464920 +17.33371897542420 +17.38250981949200 +17.39825975141840 +17.41245163162320 +17.42364170058940 +17.50500466667970 +17.51335628097650 +17.53347809364690 +17.53868246030570 +17.55688502878140 +17.57688719773800 +17.59046578580000 +17.62281103267370 +17.66518721092840 +17.68141207199810 +17.69769675516500 +17.72241484171660 +17.73732803637160 +17.75968215678800 +17.78129539656390 +17.81542726314460 +17.83439605740910 +17.85247675142060 +17.85401098697800 +17.87641654640970 +17.88148761863270 +17.90898487236950 +17.93813659413740 +17.94065545912300 +17.94499258737970 +17.95765672986290 +17.96008529561300 +17.97105050287620 +17.99630039705600 +18.04036455448640 +18.04859966241420 +18.06804903695200 +18.06938888186330 +18.08634215024760 +18.09526258908900 +18.09904490576060 +18.10014487777620 +18.13693919068470 +18.15535704007220 +18.18319506120640 +18.18666156879580 +18.24702711572110 +18.24737532845870 +18.25114969479170 +18.26576653813220 +18.27684541864210 +18.30609990018140 +18.32175108050390 +18.33134620341210 +18.34605064161410 +18.39755868838420 +18.41107435143840 +18.41842448726490 +18.46632975067020 +18.46767432142210 +18.47485310157700 +18.50602436590120 +18.55877464691300 +18.56622292737040 +18.57842489249530 +18.58141721351560 +18.69930539411880 +18.70112803307600 +18.70956337997320 +18.71225063781480 +18.72964417916960 +18.73398869922110 +18.73956337339050 +18.76561354490150 +18.81580026345010 +18.81912707818660 +18.83439067423680 +18.87798413533110 +18.87936322010290 +18.88488860825350 +18.88505761934810 +18.92556856910100 +18.95542533897220 +18.96655426090190 +18.97096952963990 +18.98964241951970 +19.00149405839870 +19.01015107249500 +19.03235980612800 +19.06598570419550 +19.07847446916650 +19.10674847852730 +19.14832330275830 +19.16365302007700 +19.21121911793000 +19.21511914972990 +19.25469669108150 +19.31547113377920 +19.32013701936550 +19.32551850153260 +19.33003444894560 +19.37665341130660 +19.39194874017760 +19.39804971319670 +19.39850671525170 +19.40422463015660 +19.43830778279540 +19.44105616964990 +19.45811583500180 +19.47422918422900 +19.49422881429650 +19.50053662592200 +19.50774179937560 +19.51125483083840 +19.53478080387350 +19.54455445690600 +19.56855581700220 +19.57273430957810 +19.59637418043560 +19.64400798232200 +19.68682098920140 +19.71999678911160 +19.73695459461160 +19.76118558380420 +19.79047769811120 +19.79578604117920 +19.81889866227700 +19.84460510646610 +19.86265759399970 +19.88313519311350 +19.92733932384540 +19.93941048903100 +19.99397524101690 +20.03520638996170 +20.06131328470980 +20.06606332444010 +20.07136154865270 +20.08655580925250 +20.09363282423640 +20.13062971281400 +20.16098784402850 +20.16692713681270 +20.18457364266040 +20.28904546011840 +20.30663562480940 +20.31521712339460 +20.33398587833950 +20.35967968840490 +20.38726222972690 +20.41412999001780 +20.43037304668440 +20.44004979543830 +20.44025277070530 +20.44623279439210 +20.46533921525300 +20.61162308403000 +20.61205643780320 +20.62679594296930 +20.66572526240900 +20.68294698512470 +20.68372260960180 +20.71370813627180 +20.71678258610370 +20.73613356721970 +20.75296660523100 +20.77279984712680 +20.79025730662760 +20.81448550000190 +20.81610183215940 +20.95027732260620 +20.97580067584230 +20.97610734803950 +20.97821380220260 +20.99385023035680 +21.11523287599560 +21.13033021614340 +21.21758717105010 +21.22624290992970 +21.23140579098160 +21.23804133348780 +21.33535520629340 +21.45360702541960 +21.46312826730200 +21.63259063982560 +21.64071165435870 +21.67194991264400 +21.77912213128560 +21.80212292170340 +21.81239462592630 +21.84998178244580 +21.85152323254810 +22.05149190410040 +22.05500516250260 +22.08320015866620 +22.09836502202670 +22.18250474299190 +22.30428729594790 +22.31005180727100 +22.32826604338710 +22.37452427475710 +22.39864134713840 +22.40844365260690 +22.50948433865910 +22.70661803374000 +22.71167802086370 +22.71187610857400 +22.71352901941720 +22.88637682794170 +22.90832934429910 +22.96332235283720 +22.99811696999130 +23.01044630905880 +23.11192510848680 +23.12401934168430 +23.13176317190870 +23.17773560261200 +23.23256024751450 +23.25035350231730 +23.30413955241460 +23.35828166292180 +23.50727829972580 +23.71648983571460 +23.75226925728880 +23.75316662662300 +23.81116405254500 +24.07155768871730 +24.09832386152360 +24.19517325581930 +24.21521738307480 +24.26992440350340 +24.35520491226390 +24.45648369136840 +24.49518299733380 +24.53327773458310 +24.53818602328280 +24.69346637333440 +24.72649262860990 +24.84127946163430 +24.94751349655950 +25.05352957336290 +25.19790773005270 +25.22966138238290 +25.30318236529790 +25.33995971203250 +25.37985969550130 +25.46884901743770 +25.49444226106020 +25.54862242922410 +25.60952371498980 +25.74202016752640 +25.83405340230970 +25.92948877502700 +25.93988584049280 +25.94416209923330 +26.07762900895530 +26.08518262132950 +26.20276547247340 +26.26517485972800 +26.60149165787780 +26.63852805603250 +26.79252349478480 +26.99444420736900 +27.07105900564370 +27.20149569280120 +27.29025251339570 +27.29724796575550 +27.40123668544560 +27.41307658104580 +27.62142514073060 +27.86263417389600 +28.15099943813290 +28.24340704582570 +28.32340069183790 +28.56360509903230 +28.61903043837760 +28.62112590337280 +28.73581238166230 +28.81811782154400 +28.95358186287130 +29.48192661120160 +29.49051297267950 +29.52926702931830 +29.61887002532720 +29.89714126176480 +29.97713195279260 +30.04094784512900 +30.44533467580990 +30.45088795752920 +30.73494854104230 +31.20338412096140 +31.40474137858990 +31.71900635601330 +32.45581386770720 +41.96180580609570 diff --git a/english/GA4Stratification/data/chi5.txt b/english/GA4Stratification/data/chi5.txt new file mode 100644 index 0000000..81d306d --- /dev/null +++ b/english/GA4Stratification/data/chi5.txt @@ -0,0 +1,1000 @@ +0.0598740794517052 +0.1878381798298520 +0.2633185849254450 +0.3144923968471940 +0.3554713640107810 +0.4195154660133450 +0.4484185493448280 +0.4909859540627870 +0.5416745495002190 +0.5464107671173820 +0.6292948193402060 +0.6421974882709890 +0.6606270817111080 +0.7016462099692510 +0.7135328338952160 +0.7212586624477330 +0.7241381598677250 +0.7242483088883870 +0.7259421967845480 +0.7278389372533390 +0.7416046495349420 +0.7460452167426310 +0.7524084137974300 +0.7560781162214120 +0.7735795829300110 +0.8086320704005130 +0.8207194901492030 +0.8707129970145810 +0.8767794860539160 +0.8868508471977770 +0.8897095029157520 +0.8919559638983330 +0.9033491235276820 +0.9143757202453690 +0.9255460700529500 +0.9276982942320730 +0.9286281575887770 +0.9389510019554580 +0.9576486164178830 +0.9622234307252190 +0.9722961529872030 +0.9814341746235880 +1.0197017208970900 +1.0470050229597900 +1.0598707189980600 +1.0614858857946800 +1.0623746094814900 +1.0815611704909200 +1.0900490954226700 +1.1023584947594000 +1.1056832107405700 +1.1067624976418500 +1.1173088618198200 +1.1187800386715800 +1.1332074201903500 +1.1341422435716000 +1.1377254743951700 +1.1421746950593300 +1.1532770242424100 +1.1550499840726100 +1.1823692610310800 +1.1864146396933900 +1.2330587341991000 +1.2508244694931600 +1.2671640923239600 +1.2847040228299300 +1.3006995406923700 +1.3184503522995900 +1.3235717480138900 +1.3241027305015000 +1.3249532078210800 +1.3658764821368400 +1.3725245190755400 +1.3845180246911500 +1.3853167229006100 +1.3865906944400300 +1.3867637475748200 +1.3875820820534700 +1.3894930904390600 +1.3975542036908800 +1.4025431613943600 +1.4121012426494100 +1.4125205781193100 +1.4204532568670900 +1.4240548737233900 +1.4253667562491500 +1.4254982721208300 +1.4281727962194700 +1.4327368219643200 +1.4403026197097600 +1.4421998139132400 +1.4607695230575200 +1.4626299313630400 +1.4722765730545800 +1.4728176955537800 +1.4755293649541600 +1.4824268436239700 +1.4850453366823500 +1.4882174407751800 +1.4934993447857600 +1.5010898374206000 +1.5034298543620500 +1.5094859196184500 +1.5178253054757600 +1.5202720022723900 +1.5546594235376200 +1.5548999404291800 +1.5551863180606600 +1.5636130308017400 +1.5706473341009700 +1.5842107555574800 +1.6033005337770200 +1.6206629616600700 +1.6298334406524800 +1.6322733012286200 +1.6573687038135400 +1.6587678278620200 +1.7026058036313700 +1.7152275017649300 +1.7280145910971800 +1.7329074017390000 +1.7335942809706700 +1.7435407759001400 +1.7469971949686400 +1.7501449096946000 +1.7516105871608100 +1.7516128448284600 +1.7545094343494900 +1.7851402133479200 +1.7862990674941900 +1.7940194716286700 +1.8061678355139800 +1.8076422948838600 +1.8229415663065800 +1.8255658273235100 +1.8439590873045000 +1.8735117610658200 +1.8825657134498200 +1.8936746174745900 +1.8945782701506800 +1.9065199615022500 +1.9293749923187200 +1.9345008520889400 +1.9350202712867800 +1.9396748428983900 +1.9403681430821600 +1.9542951946052900 +1.9597074933734700 +1.9621175121634000 +1.9691131274438800 +1.9764386206692100 +1.9888047352892100 +1.9938730086003500 +1.9948876486560700 +1.9981305972218000 +1.9981420935616400 +1.9997964759625300 +2.0071552518504400 +2.0136927518136500 +2.0201503302419900 +2.0348903390937800 +2.0420891591607300 +2.0470010688331100 +2.0519893317482600 +2.0548261795265400 +2.0654446648078000 +2.0677047891031800 +2.0876262276272600 +2.0896196156252500 +2.0995492754262800 +2.1071963287503200 +2.1195438444395600 +2.1204827804240100 +2.1209233002722800 +2.1408511850957700 +2.1470821908113800 +2.1639313230057500 +2.1677509090657000 +2.1911807952747900 +2.2002660401244000 +2.2067017718520200 +2.2119415594348700 +2.2278811666405600 +2.2289849162784800 +2.2293310190625200 +2.2318485296552000 +2.2329575865292100 +2.2504427840978100 +2.2533589773012600 +2.2567145645367400 +2.2713995717778500 +2.2729097765028000 +2.2785081549108900 +2.2830085589070600 +2.2982493170876800 +2.3038123705591400 +2.3085428937285900 +2.3105994507320700 +2.3193678986909500 +2.3431398065771900 +2.3544150957784200 +2.3735621612360900 +2.3784339344160000 +2.3827104287245500 +2.3887113533120800 +2.4017218223011200 +2.4093499896548600 +2.4128978546119000 +2.4188281612711300 +2.4256971145172600 +2.4309136734126700 +2.4393168401370400 +2.4457875363650400 +2.4602521842231800 +2.4688094193901500 +2.4761815704165300 +2.4816915100467200 +2.4850270577988200 +2.4913435369218900 +2.4980961466878000 +2.5096944132634900 +2.5159753023111300 +2.5216290101976600 +2.5386943469439500 +2.5572376600212200 +2.5732894165448700 +2.5823920154774300 +2.5842046373709900 +2.5885943307992000 +2.5984620280183000 +2.6023211908670100 +2.6073522523612500 +2.6144803107894900 +2.6225592661607300 +2.6361446138443500 +2.6425056579158100 +2.6461169755481800 +2.6527744198112200 +2.6534414382207200 +2.6585767719479700 +2.6588335354501400 +2.6620767108461300 +2.6754101689026400 +2.6755046571040400 +2.6758821821270100 +2.6760647115556300 +2.6824268724986900 +2.6856378536568700 +2.6892169823547000 +2.6972008576580000 +2.7024613313059400 +2.7033917004644500 +2.7043710002077600 +2.7132805511619800 +2.7134404348181000 +2.7148333169056000 +2.7153981415713000 +2.7208339102340600 +2.7216540797971900 +2.7373728541979700 +2.7522434547665400 +2.7727091612143400 +2.7833667922409700 +2.7880714139523900 +2.7962471320989300 +2.8019495198403500 +2.8141284764008100 +2.8251724363753900 +2.8277434089531700 +2.8318293285610400 +2.8368568242451700 +2.8372824662069200 +2.8376028208331300 +2.8475969462692500 +2.8510021896870600 +2.8510667714589400 +2.8510899325515500 +2.8536116512083100 +2.8563089865721400 +2.8608568022669100 +2.8621712100918500 +2.8673730941985100 +2.8677031963389200 +2.8688639733121300 +2.8703069961494300 +2.8705789319057300 +2.8707649067357000 +2.9024198861451100 +2.9045622863385000 +2.9092772395317700 +2.9094083529930200 +2.9124231139140700 +2.9157973153397200 +2.9186480060897900 +2.9199333022786200 +2.9204206971590400 +2.9239779690928700 +2.9259219594271600 +2.9295354859456600 +2.9319367651948600 +2.9319609883323400 +2.9326874088579900 +2.9380216354638100 +2.9458615709752300 +2.9533347899560500 +2.9581286913714500 +2.9595511607098800 +2.9603323707018900 +2.9644879233842000 +2.9653236756250200 +2.9899087777769400 +2.9920805812520500 +2.9951612414333700 +2.9956556107659500 +2.9966169196767900 +3.0014572825060000 +3.0036259613802100 +3.0039742488976000 +3.0073479879836600 +3.0207628647488400 +3.0264216278487800 +3.0372290695463800 +3.0373184449405800 +3.0463541447695600 +3.0525646740595000 +3.0546479748152000 +3.0655830605245500 +3.0663717088619800 +3.0883115742974700 +3.0909337054433400 +3.0956467863445600 +3.0981365701228600 +3.1048163133746000 +3.1058877613246100 +3.1115404450581900 +3.1262193601273900 +3.1445678141365700 +3.1454608523203400 +3.1528965599446800 +3.1549534157760600 +3.1580760718233700 +3.1593101132187700 +3.1664959911629400 +3.1810635319326500 +3.1920128828043000 +3.1930089115120600 +3.2096168905714000 +3.2097442218767400 +3.2300180754048400 +3.2315372279194600 +3.2366315715946300 +3.2423009091392700 +3.2428111024373100 +3.2544354118867300 +3.2553188624116800 +3.2656205966414600 +3.2793800876357000 +3.2799034279229300 +3.2883665377623300 +3.2887587016686000 +3.2913451257085300 +3.2968426982416800 +3.3045241198738100 +3.3245591271252600 +3.3265776158122400 +3.3303822736706600 +3.3389380031749800 +3.3392666696131400 +3.3394221078965200 +3.3405687770179900 +3.3514817038961000 +3.3567818493677300 +3.3585295520289100 +3.3631699681750200 +3.3673199059417900 +3.3674698069863600 +3.3763984106997100 +3.3810956953849600 +3.3918728636056500 +3.3960210859301500 +3.4227968364627700 +3.4269443935395700 +3.4395844224481800 +3.4527125095501500 +3.4594873466640200 +3.4686208918484100 +3.4717794573243500 +3.4907631486285300 +3.4991309999786400 +3.4999893516884700 +3.5056671588245100 +3.5078375662772100 +3.5103309143731100 +3.5166746745896200 +3.5187671121593800 +3.5191835146267700 +3.5202903482863800 +3.5253047955315800 +3.5321551346083200 +3.5335092626473500 +3.5463176798004800 +3.5501555621911000 +3.5711390071287000 +3.5731430019402100 +3.5738200128568200 +3.5841988862673300 +3.5857095122462200 +3.5968837081356200 +3.5992422945440700 +3.6024340480098200 +3.6037725767541300 +3.6226020554861500 +3.6255283607866300 +3.6259107117899400 +3.6336905212990000 +3.6348630861385300 +3.6412261595400700 +3.6495152239690700 +3.6517574892698600 +3.6522094142456900 +3.6586080021162500 +3.6616736389137100 +3.6672187965403400 +3.6748033547145600 +3.6801310480424200 +3.6900108157564400 +3.6953243827491800 +3.6967535681431900 +3.7142841630086000 +3.7275946897230600 +3.7278254700161400 +3.7303534588826200 +3.7477530519478200 +3.7520438822308100 +3.7539393533576100 +3.7657978270086900 +3.7827086709098700 +3.8027871014097100 +3.8051416097789900 +3.8053460398754200 +3.8247251928130300 +3.8343104955272600 +3.8395190201797200 +3.8418885610500800 +3.8424970964943700 +3.8441245438521400 +3.8523283692764100 +3.8577397446239700 +3.8581364097528200 +3.8745456746668300 +3.8766835160155900 +3.8804676035732800 +3.8915059731328800 +3.9108637024824900 +3.9111238535737200 +3.9134016733658200 +3.9252843206250500 +3.9335938377379100 +3.9647138032807200 +3.9725820709547100 +3.9827932262620500 +3.9890774879889300 +3.9914098092680500 +4.0040927651184700 +4.0071925105235700 +4.0285639975437100 +4.0417493844601500 +4.0511146669298200 +4.0551711508196700 +4.0554040372359700 +4.0592199446464500 +4.0643865641031100 +4.0648963079169000 +4.0685010474268200 +4.0723642153219300 +4.0805547754678900 +4.0860429064761400 +4.0878763564310800 +4.0896506374845000 +4.0907887601187200 +4.0991083391103400 +4.1013870123758400 +4.1032864714728200 +4.1145828112360300 +4.1182673152682900 +4.1249167156623600 +4.1264739735492300 +4.1401004413352000 +4.1426343531035000 +4.1455177823811500 +4.1580204970693600 +4.1589502347251500 +4.1679553778029300 +4.1687073601008700 +4.1732449814610900 +4.1831476228938500 +4.1954124775733000 +4.1988562773343000 +4.2184712692820400 +4.2265620555826100 +4.2298845536076900 +4.2377675263795900 +4.2508838046580600 +4.2573716505941200 +4.2619344294166500 +4.2801577332404900 +4.2829922692469600 +4.2851886538978100 +4.2879472852725100 +4.3013681392524900 +4.3096437807539700 +4.3099082875355600 +4.3099198737942600 +4.3162928968129700 +4.3165637174393000 +4.3350405962003600 +4.3395366276618600 +4.3419243818926300 +4.3617664552201200 +4.3636406947828800 +4.3687408506983000 +4.3741512241680700 +4.3870372861647000 +4.3950829721459100 +4.4126470069951900 +4.4145932686798100 +4.4259908062272400 +4.4281527336127400 +4.4390252527809400 +4.4555153788021700 +4.4600682248146900 +4.4615265973639100 +4.4649465879566100 +4.4880408635678200 +4.5049227294912300 +4.5053130613432900 +4.5131951159610300 +4.5168827163069100 +4.5243631033899100 +4.5305892725311400 +4.5310911437939200 +4.5363762235283400 +4.5490462875653300 +4.5547042198040400 +4.5722797805805000 +4.5833080518376500 +4.6021533931887000 +4.6101123494057100 +4.6208976757400800 +4.6250633629437100 +4.6296258556986300 +4.6455703312914100 +4.6556761432539800 +4.6565122422479600 +4.6624320226252700 +4.6708567749949400 +4.6865553924975600 +4.6941979383165400 +4.6962087428102600 +4.6987074107351200 +4.7017066739256100 +4.7046722743282600 +4.7152560240023800 +4.7240134688601000 +4.7273256703672300 +4.7389768291781100 +4.7596479538447800 +4.7675059960524300 +4.7835159467987700 +4.8025610988875500 +4.8072615381349900 +4.8234066871909500 +4.8248424156453700 +4.8319538603475500 +4.8373134670286300 +4.8448674285573300 +4.8582624548239300 +4.8593406042297600 +4.8709947274604300 +4.8737417681218700 +4.9043362863126400 +4.9110146867011100 +4.9176703721903500 +4.9295452406888400 +4.9309769935467100 +4.9322170593058300 +4.9432301609807500 +4.9469598217263200 +4.9490526280839600 +4.9550007504952800 +4.9799911493188200 +4.9825349928183000 +4.9846829555024300 +5.0035202852262600 +5.0067412402473700 +5.0070475471427800 +5.0136728690963700 +5.0335675925234600 +5.0559302142671100 +5.0661314135131700 +5.0773386556650300 +5.1032077120742600 +5.1165350718395000 +5.1223864720705700 +5.1629274795532000 +5.1710076521861200 +5.1743622183706700 +5.2133277307284300 +5.2260990822938800 +5.2285492264164400 +5.2395873953485700 +5.2474495705836800 +5.2563863467971500 +5.2636945278463700 +5.2664272415155700 +5.2884122170357300 +5.3152396817064700 +5.3196757852363000 +5.3358968983721600 +5.3477125568162900 +5.3607676437770900 +5.3634731535601000 +5.3764830268190500 +5.3801035572601400 +5.3868187936852500 +5.3869299809512800 +5.3879462112921100 +5.3963618453844300 +5.4106799581358500 +5.4167487882769800 +5.4248646169067100 +5.4270061829750700 +5.4576495503530200 +5.4702379033006900 +5.4711258643895800 +5.4749889822046400 +5.4785911452263800 +5.4977024511158600 +5.4997658687999800 +5.5452921959632200 +5.5538256715980500 +5.5621726096826900 +5.5633425102184600 +5.5974059442219800 +5.6020292977208500 +5.6054837255982800 +5.6298508214864100 +5.6447624207027700 +5.6588898946695600 +5.6777502731251100 +5.6837824005167200 +5.7315584357836900 +5.7386567610284400 +5.7400036593429500 +5.7652213079570500 +5.7666891794822200 +5.7734722207068700 +5.7757058181753600 +5.7846871645730800 +5.7875014583728100 +5.7927893085008100 +5.7938819889971000 +5.8275943298156800 +5.8342229939985600 +5.8680744674108700 +5.8752829684218100 +5.8808276200105900 +5.8932572183298400 +5.9044514529520600 +5.9222779853940800 +5.9337581081874400 +5.9439288837476600 +5.9450024063697600 +5.9553751071113100 +5.9650157040229900 +5.9720937284879400 +5.9810088941198100 +5.9947886158375100 +6.0096094821959900 +6.0159189482589500 +6.0296847780270300 +6.0391288888228700 +6.0582052044011800 +6.0638161216238800 +6.0867260456090300 +6.0941723705831000 +6.1081994196836100 +6.1084960952969400 +6.1102040077361400 +6.1172687386342100 +6.1237472412684300 +6.1429052143398400 +6.1480018698792700 +6.1569387867211900 +6.1572777886815400 +6.1937265572802700 +6.2069075279935200 +6.2115720230751600 +6.2127954013568400 +6.2349743791484400 +6.2454815689024700 +6.2602251400889000 +6.2617840205718100 +6.2748241178691000 +6.2802946478556500 +6.2847776087183900 +6.2868258723435100 +6.2971932194846100 +6.3045630787376000 +6.3080389077002600 +6.3119832408989500 +6.3249627329822000 +6.3343465646424700 +6.3346056264221500 +6.3424969432362600 +6.3522204529293600 +6.3818240148856500 +6.4138857324307000 +6.4217725528249700 +6.4293087467720700 +6.4425178547709200 +6.4557681445895600 +6.4756471636881200 +6.4889340421401200 +6.5002150111867000 +6.5162506733558700 +6.5188126031071900 +6.5250386265038200 +6.5347512746914500 +6.5430229783734400 +6.5445281910356100 +6.5533878879024700 +6.6068786638245200 +6.6148058945758000 +6.6226604096124000 +6.6250442736463300 +6.6573174989387900 +6.6681951091424300 +6.6723133408345300 +6.6742152451733400 +6.7126654052360400 +6.7158627976027400 +6.7296036802035400 +6.7398055451954700 +6.7449494780397800 +6.7519517053368000 +6.7746091266111200 +6.7765363259399200 +6.7788461770824800 +6.7869345410914800 +6.8129272525629700 +6.8227281347717100 +6.8260382682086200 +6.8328579041098700 +6.8404833278388100 +6.8939086373979000 +6.8945704793706600 +6.8989802101447800 +6.9232625677672900 +6.9288060892134500 +6.9551827844669300 +6.9634512718473000 +6.9830422414159000 +6.9837028637110700 +6.9879843886766700 +6.9994423993699200 +7.0109955730445200 +7.0429348493348400 +7.0585022958411400 +7.0744720359938200 +7.0824091881417400 +7.0916836558152800 +7.1127129388829800 +7.1268481455009800 +7.1422550522148700 +7.1494169699316800 +7.1683349376131800 +7.1731473841165000 +7.1959618724402500 +7.2024153513324300 +7.2070533987964700 +7.2153436859481300 +7.2247973423569400 +7.2356016106930400 +7.2388244775277700 +7.2696452742244200 +7.2724539341730800 +7.3094484164908400 +7.3213616709532600 +7.3582807318536400 +7.3762854562217500 +7.3980232461001800 +7.4007430133531900 +7.4214770997010100 +7.4332562134980000 +7.4544564932455100 +7.4660192481224900 +7.4814977735961500 +7.4938958698157700 +7.4964165029512600 +7.5208451406835000 +7.5930865329770200 +7.6049762288982200 +7.6053103866357700 +7.6062833195527400 +7.6225507818394600 +7.6260368591414700 +7.6737587704159500 +7.6785442416444400 +7.6866437311990000 +7.6932010594289500 +7.7123326866904200 +7.7138369473805200 +7.7251911906164600 +7.7284480853389900 +7.7311133923735700 +7.7494010764526400 +7.7550454573977100 +7.7626028841784700 +7.7799828437896100 +7.7874126683597800 +7.7888628096621600 +7.8116641356577400 +7.8142422129814100 +7.8974660304708300 +7.9102500709658800 +7.9117902436458000 +7.9144365029598500 +7.9204752766119200 +7.9748603223178300 +7.9750831403657600 +7.9989461805316300 +8.0146850690044200 +8.0275818905953200 +8.0792173235868500 +8.0950923865059200 +8.1253515134599700 +8.1351126423746200 +8.1550382794766500 +8.1661252730065200 +8.1747301225345100 +8.2269502052361200 +8.2310901797706500 +8.2419026839530800 +8.2447044639296200 +8.2495725899321400 +8.2620194883311700 +8.2934243833663000 +8.2966567042647400 +8.3479495030968900 +8.3589697600708200 +8.3881009306338100 +8.3935153035771900 +8.4028703966828200 +8.4407952937363800 +8.4544018582614200 +8.4911980068794700 +8.4913791321662500 +8.5191117373921000 +8.5416638787586700 +8.5647528345383600 +8.5761056452911600 +8.5778151778459500 +8.5885741846497000 +8.6008395833683000 +8.6129517599709200 +8.6516419717991300 +8.6600657182051100 +8.6757280717579500 +8.7097406331777900 +8.7291732751944300 +8.7310980052172000 +8.7487013407895800 +8.7677853537442600 +8.7924320698971700 +8.8163488878361200 +8.8187165269114700 +8.8187303440167900 +8.8242501982605400 +8.8818193486352800 +8.8889877632963100 +8.9083829544741300 +8.9295396338367200 +8.9486940452757100 +8.9690042468647900 +8.9709023036727500 +9.0036246005507100 +9.0447544101617900 +9.0448013796426300 +9.0871505504554500 +9.1228415040688000 +9.1473172105317000 +9.1528711836039000 +9.1580953272216000 +9.1637497308595500 +9.1976714103272400 +9.2047593911424000 +9.2417212523753100 +9.2769349920089600 +9.3042817081575500 +9.3503478455910200 +9.3545108719253700 +9.3980440864657900 +9.4467145045777300 +9.4669607093536900 +9.4715252408166500 +9.4760817728623200 +9.5271119802526900 +9.5272521407183900 +9.5547938641970800 +9.5881060679809800 +9.6702942294575300 +9.6809409633229600 +9.7838457004056800 +9.8544477323640300 +9.8558472348670800 +9.8857664520728900 +9.9150367912805600 +9.9367409121838600 +9.9792925490045500 +10.0338358752119000 +10.0493280787510000 +10.0563955315440000 +10.0974477501337000 +10.1291544644135000 +10.3752100997552000 +10.5141873255705000 +10.5266117307458000 +10.5694374558740000 +10.5748118811024000 +10.6525452114617000 +10.6569366265115000 +10.6934200152716000 +10.6964320149148000 +10.7408097171242000 +10.8456669646926000 +10.8522867629977000 +10.8616019782897000 +10.8823237606773000 +10.8931022076183000 +10.9349201171700000 +10.9426202668338000 +11.0070471428968000 +11.0468370775813000 +11.0955716546398000 +11.1234764499814000 +11.1534825435116000 +11.1631737288688000 +11.1786369349959000 +11.2080674803433000 +11.2922890711064000 +11.3465360991269000 +11.3759762638828000 +11.4147925547633000 +11.5123723974540000 +11.5158569515633000 +11.5175360683786000 +11.5516943260307000 +11.6123915121948000 +11.6898060424104000 +11.7156390054941000 +11.7446509801660000 +11.9616441440992000 +12.0700959157651000 +12.1084171535775000 +12.1099675968577000 +12.2504021181649000 +12.2818723352206000 +12.3110238800023000 +12.3437851491809000 +12.3463068784637000 +12.4039022334210000 +12.6284248755717000 +12.7742915699546000 +13.1206496463756000 +13.1486419740792000 +13.3215806443353000 +13.8172244275390000 +13.9411371074374000 +13.9887240400722000 +14.1362999961704000 +14.2867975754958000 +14.3250318828173000 +14.4738128787022000 +14.6731457058094000 +14.8180907743704000 +14.8286279165963000 +15.0287816510518000 +15.2132562448979000 +16.1452030996432000 +16.6225429401942000 +17.6096514741924000 +17.6291694287782000 +17.8080624154097000 +19.0193479541369000 +19.6930810802398000 +20.4098994860328000 +20.6857725584742000 +20.8982800465291000 +23.4270299853751000 diff --git a/english/GA4Stratification/data/h b/english/GA4Stratification/data/h new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/english/GA4Stratification/data/h @@ -0,0 +1 @@ + diff --git a/english/GA4Stratification/data/iso487.txt b/english/GA4Stratification/data/iso487.txt new file mode 100644 index 0000000..018ede8 --- /dev/null +++ b/english/GA4Stratification/data/iso487.txt @@ -0,0 +1,487 @@ +63582908 +63604116 +63627100 +63737353 +63827462 +63891364 +64083470 +64109972 +64192863 +64318779 +64350068 +64420450 +64452000 +64660204 +64787567 +64810540 +64925649 +65281207 +65531095 +65669142 +65835368 +66138738 +66289212 +66337456 +66406936 +66417581 +66505581 +66523662 +66631161 +66708665 +66735814 +66835705 +67504640 +67617765 +67759064 +68042052 +68165481 +68273980 +68318304 +68461263 +69266126 +69343493 +69415391 +69515975 +69531034 +69561107 +69580246 +69873045 +69892303 +70549038 +70652589 +70710135 +71247172 +71333318 +71443640 +71450806 +71592907 +71702841 +71730931 +72112291 +72207814 +72364086 +72371364 +72535472 +72633962 +72689298 +73406868 +73532107 +73595229 +73642817 +74466261 +74627354 +74700129 +75277941 +75345406 +75644808 +75655035 +75850558 +76160327 +76333632 +76437524 +76863670 +76904718 +76941975 +77409668 +77516020 +78251378 +78523601 +79191812 +79358351 +79602869 +80007031 +80475502 +80760829 +80874600 +81333358 +81924505 +82045970 +82060807 +82145209 +82205277 +82467540 +82612049 +82690723 +82757106 +83224186 +83322865 +83368481 +83485907 +83487229 +83561408 +83638083 +83911557 +84054305 +84086623 +84136527 +84279771 +84590156 +85029152 +85115229 +85135555 +85261052 +85542447 +86518779 +87147651 +87221269 +87295084 +87498716 +87537814 +87612245 +87681393 +87861728 +87934654 +88218719 +88686120 +88695581 +89179652 +89665429 +89804437 +90123239 +90167407 +90786961 +91000589 +91219111 +91937893 +92000758 +92232719 +92271813 +92750341 +92841646 +93227040 +93889133 +94088293 +94173623 +94537145 +94562389 +95018172 +95080776 +96368570 +97115572 +97292880 +97323567 +97763414 +98284285 +99424210 +99440686 +99814091 +100309118 +101082155 +101764029 +101845791 +101872296 +101955370 +102062250 +102103787 +102642023 +103014094 +103101328 +103251653 +103317488 +103410138 +103930292 +104000061 +104055651 +104787271 +104924867 +105134787 +105460346 +105674974 +106232637 +106470196 +107093624 +107448973 +107459828 +107529481 +107744320 +107790846 +108095951 +108542567 +109110404 +110030263 +110170326 +110672632 +110696318 +110752173 +111027801 +111032264 +111556913 +112191750 +112313445 +112514938 +112555368 +113108219 +113324026 +113970799 +114434586 +114831641 +115574191 +115762328 +116601706 +117057763 +118099578 +118294277 +118420387 +118560460 +118785910 +119295647 +119579357 +120092808 +121145562 +122335730 +123015407 +123538952 +124510197 +124815964 +125070230 +125437746 +125437874 +125660829 +125997819 +126072502 +126910545 +127051976 +127433429 +127921418 +128359335 +128377626 +128576407 +129284980 +129359853 +129452471 +130000283 +131417163 +131434409 +132208275 +133095022 +134453055 +135636807 +135682802 +136450796 +136799370 +136993464 +137854930 +138690336 +139445933 +139751708 +141458337 +141511227 +141620983 +142376950 +142512764 +143229869 +143813875 +145565045 +145952986 +146419716 +147336681 +147645680 +148108489 +148718818 +148870051 +151423321 +151586987 +151970298 +153473239 +153564468 +153580359 +153729255 +153908392 +154028909 +155215752 +155962747 +157780964 +157807645 +158206408 +158419898 +158986234 +159610444 +161249871 +161572001 +163405446 +163630549 +164455879 +164548931 +164867127 +166159315 +167532633 +167554633 +168098314 +168261340 +168650000 +168662108 +171933473 +174604129 +177327981 +177714416 +178593935 +178766463 +179373798 +179747853 +180931247 +181097442 +182296875 +182822605 +183082060 +184060388 +184794193 +184874842 +185786464 +186221719 +187492807 +189768782 +190182192 +190299338 +190305375 +190362675 +190553530 +190872512 +191109222 +191663350 +191913949 +196166801 +196937762 +197763790 +198465090 +198809741 +200202069 +201319661 +201370007 +203130619 +203539859 +212232936 +213430406 +217706012 +219638593 +221176169 +222066890 +228632045 +229335316 +230387172 +234039236 +234541031 +234725164 +234762831 +235055306 +235808327 +235827401 +239720303 +240128088 +241222289 +242230263 +244374139 +246792234 +249081000 +252585167 +252891071 +255597429 +267602064 +268598337 +269123528 +270080419 +270438399 +276400264 +276650201 +277111593 +279134567 +281446281 +283150831 +284164257 +288109729 +292618985 +293764020 +294013962 +304917784 +309037647 +310940502 +315985062 +318321108 +318394488 +320727061 +324501086 +325598126 +334879811 +334967001 +342419638 +343074770 +348463623 +348664608 +349210638 +350510363 +351917194 +352871496 +355029172 +359019264 +364584283 +365258614 +367820946 +372479552 +372972280 +386227089 +387775944 +390548194 +397729758 +401547314 +402450231 +403468446 +404287275 +406281443 +409727689 +420192587 +422609530 +439033028 +449389507 +451109403 +453447491 +453851842 +459047994 +460833747 +467949455 +493417885 +499978437 +502712860 +508337210 +518743183 +526646990 +534842449 +541561244 +546398966 +555444865 +562414259 +578814400 +601528025 +611442823 +614713761 +636345459 +640094513 +650895909 +661042447 +682570250 +716994199 +718414804 +744731642 +816718464 +833290078 +906635595 +968782038 +980458581 +1067141342 +1116999999 +1125508434 +1185416580 +1218993109 +1345054341 +1489649139 +1616169797 +1827115895 +1832112754 +1890336892 +2146938617 +2404084375 +2688686138 +2848736197 +2966839536 +3279366618 +3348031394 +4445190178 +10446591755 diff --git a/english/GA4Stratification/data/normal100_10.txt b/english/GA4Stratification/data/normal100_10.txt new file mode 100644 index 0000000..2f17585 --- /dev/null +++ b/english/GA4Stratification/data/normal100_10.txt @@ -0,0 +1,1000 @@ +73.5577807831926 +73.6501915778000 +74.7999636056006 +75.5098224624319 +75.7604286615497 +75.8540906541980 +76.2082764732847 +76.3541015205842 +76.7478887111623 +76.9439494773482 +77.2276349456520 +77.5241768652811 +77.6262160731822 +77.9767928267656 +78.2932550569474 +78.7690759918722 +78.7957331177579 +78.9470812262875 +79.2236514470194 +79.3607518511709 +79.4567531944339 +79.7491559757003 +79.9114967821085 +79.9543667840921 +80.4578725033250 +80.5492140008067 +80.8286414702823 +81.2600974235904 +81.3723333412269 +81.8110837643594 +82.4200440811917 +82.4938471151462 +82.7085852105965 +82.7422734307688 +82.7651011222143 +82.8709080344176 +82.9266642216226 +82.9894715953013 +83.0692743116493 +83.1945722247735 +83.3441562176190 +83.3499405528409 +83.3598912306941 +83.3639354717023 +83.4545230915782 +83.5339427258394 +83.6602600677968 +83.8085355967841 +83.8542669778707 +83.9015319320449 +83.9591443799884 +83.9669013399680 +84.0627042355252 +84.0975970728005 +84.1140620102347 +84.1959750069684 +84.2694859805411 +84.4361615620406 +84.6510545120258 +84.8246086891045 +84.8692302100177 +85.0023734893520 +85.0139462160058 +85.1033660864911 +85.1143549556682 +85.2486549414474 +85.3293329782143 +85.5599593412200 +85.5733497988267 +85.5903556809898 +85.6422711890956 +85.7036282982387 +85.7719699340093 +85.8613912267012 +85.9047151063080 +85.9403080573155 +86.0736779496536 +86.0861098843350 +86.1583331869988 +86.1873437598016 +86.2552134578514 +86.2822666965407 +86.4270225690325 +86.4435654152888 +86.5072245689751 +86.5263732614976 +86.5458703433923 +86.5895014056591 +86.6381814206220 +86.6646927026361 +86.7649703819679 +86.8056300189046 +86.9313803108987 +86.9943753529697 +87.0631524014778 +87.0806395503406 +87.1181280257762 +87.2949979629162 +87.3687851290062 +87.4158462222693 +87.4340989216618 +87.4405983322568 +87.5160595344589 +87.6564652201574 +87.6836346667499 +87.7127320317219 +87.7236442419225 +87.7243427778415 +87.8268254629545 +87.8684793150609 +87.9100947589515 +87.9754288522606 +87.9868518466096 +88.1145794125508 +88.1165403548464 +88.1222298353020 +88.1411378619147 +88.2543971869756 +88.3049913805436 +88.3218063527336 +88.3660470616273 +88.4175251358302 +88.5352864931854 +88.6022059768677 +88.6696104658162 +88.6828071684781 +88.6965925441888 +88.7165613567977 +88.7364813898683 +88.7548218840580 +88.8096042461869 +88.8128336239568 +88.8379124221439 +88.8937228439105 +88.9029597222133 +88.9182606742918 +88.9293010517399 +89.0015954528919 +89.1642518107183 +89.1894350982306 +89.1933814878831 +89.2239935525536 +89.2591438275987 +89.2745897030337 +89.4352707191852 +89.4409707647631 +89.4596728579997 +89.4771731300408 +89.4797603453283 +89.5266206228535 +89.6625869233544 +89.7102490045620 +89.7486252215004 +89.7544694257097 +89.7673582891366 +89.7738985566579 +89.7885831306423 +89.8186278360093 +89.8667014394360 +89.8936629352575 +89.9088447565921 +89.9180421016896 +89.9193558269101 +89.9223660832173 +89.9392693863537 +89.9605553325227 +89.9739444576619 +90.0227818425179 +90.0790826445620 +90.0960398888301 +90.1024032831800 +90.1347992374550 +90.1715244446882 +90.1880943685583 +90.2235163295794 +90.2294332803873 +90.2512998616099 +90.3601188342122 +90.4050297360812 +90.4273492117834 +90.4662906718291 +90.4703817536816 +90.5009620145236 +90.5285393526146 +90.5591256864349 +90.5862780657167 +90.6270493070513 +90.7398759973357 +90.7809837564446 +90.9051274240796 +90.9057076354189 +90.9075683968399 +90.9643305738222 +90.9859939590171 +91.0365172338165 +91.0395749357808 +91.0529117370787 +91.0950396672490 +91.1156481862063 +91.2368987377731 +91.2909238903943 +91.2988255357571 +91.4046607324234 +91.4580262553102 +91.4672473830085 +91.4904636624482 +91.5324183611694 +91.5637236084520 +91.6071446917844 +91.6181208534367 +91.6765053634998 +91.6796956531150 +91.7009928249899 +91.7828570830374 +91.8377188943935 +91.8499784227160 +91.9235086910282 +91.9239295349125 +91.9490959580312 +91.9697030884948 +92.0059030031986 +92.0237392760455 +92.1293415497999 +92.1519984951810 +92.1710695562171 +92.1736813216578 +92.2451850157265 +92.2662437086729 +92.3270147587895 +92.3629236330177 +92.4190774561045 +92.4379139445330 +92.4662937913432 +92.4774944183447 +92.5210313717696 +92.5795524786640 +92.6276916486717 +92.6283618454366 +92.6633798695495 +92.6667706985872 +92.7772932756670 +92.7850952283559 +92.8357137627414 +92.8791454750564 +92.8929791397173 +92.9492357645808 +92.9569827156639 +92.9644573846325 +92.9858329356148 +93.0379519996711 +93.0565098888086 +93.0637740629866 +93.0805981563344 +93.0822429829771 +93.1151136253530 +93.1413156934843 +93.1451561947633 +93.1586141486366 +93.1687645709489 +93.1834313999764 +93.1960625614341 +93.2700683614529 +93.3011488994351 +93.3537783481395 +93.3842332342276 +93.3855694052895 +93.4444061049609 +93.4529232491722 +93.4792589476379 +93.5485418430883 +93.5532108445806 +93.5640479731747 +93.6320988708671 +93.6453477452068 +93.6872034327485 +93.7246878003317 +93.8503147594478 +93.9197498872928 +93.9327436353070 +93.9351714072273 +93.9497784091566 +93.9779024663826 +93.9858787373028 +93.9956662603904 +94.0217488556386 +94.0246096916446 +94.0450909738052 +94.0889616136780 +94.1168345698581 +94.1389324153914 +94.1746412572783 +94.1913976503443 +94.1973599785805 +94.2146840025029 +94.2646586589412 +94.2767454351494 +94.2974735247274 +94.4042669780376 +94.4079051018169 +94.5218385307884 +94.5352410523238 +94.5729758413910 +94.5798344349604 +94.5879067008381 +94.7152019611062 +94.7336515512008 +94.7744069836360 +94.7829509317704 +94.7838086075300 +94.8136493365525 +94.8273911523470 +94.8921441298692 +94.8922352366720 +94.8936535562341 +94.9192211958221 +94.9383681435146 +94.9503244000136 +94.9846263095742 +94.9879370367647 +95.0010174881527 +95.0227019478812 +95.0691208234030 +95.1240950871019 +95.1818745232014 +95.2465324179745 +95.2908876365623 +95.3502663282888 +95.3803601791483 +95.3866290578128 +95.3939482049385 +95.4207778466234 +95.4580690301675 +95.4693291076952 +95.5319059334305 +95.5623481869382 +95.6524806884747 +95.6743518847178 +95.7069699544809 +95.7443245421094 +95.7538598494351 +95.7907846422828 +95.8177680927716 +95.8252777728486 +95.8482739428324 +95.8714227138120 +95.9402299667681 +95.9833326540321 +95.9947086572000 +96.0011442228464 +96.1020045152317 +96.1570681815933 +96.1648384278332 +96.1762587480525 +96.2253104447764 +96.2286644226036 +96.2547036726468 +96.2557080497083 +96.2653892967443 +96.3212643325936 +96.3906281912528 +96.4142808723388 +96.4902526167226 +96.4911508161809 +96.5275721780273 +96.5281681026647 +96.6018822258504 +96.6315687254154 +96.6404536271905 +96.6485677039095 +96.6922579680886 +96.6940112010724 +96.6963895420134 +96.7242208968997 +96.7755079624976 +96.7899530781871 +96.8214054875231 +96.8432913032952 +96.8586232525435 +96.8647800855484 +96.9877598657223 +96.9985956909949 +97.0411288999644 +97.0723574134641 +97.0746194721481 +97.0852931256945 +97.1232551617164 +97.2095663342939 +97.2214377174606 +97.2264570853435 +97.2378214064524 +97.2489432456119 +97.2490112611594 +97.2533301354322 +97.3161235121510 +97.3337686387611 +97.3439314866745 +97.3452255208715 +97.3597637603756 +97.3598664507776 +97.3756004716167 +97.3889837693838 +97.4238288434652 +97.4435458436804 +97.4879262543112 +97.5056371530457 +97.5147968099520 +97.5366347191510 +97.5461370324833 +97.5668305096222 +97.6138804376568 +97.6385570284195 +97.6599595234397 +97.6872943570098 +97.7616857150118 +97.7650338522566 +97.7782208590305 +97.7936837801741 +97.8646249379130 +97.8887651661974 +97.9135744033803 +97.9333427767586 +97.9630952043264 +97.9708205465928 +97.9881900048286 +98.0106795171732 +98.0524107171636 +98.1329142231856 +98.1418347263234 +98.1437932708898 +98.1616599985905 +98.1791813158862 +98.2064359176329 +98.2144700127916 +98.2523966880328 +98.2785886767056 +98.3238470380022 +98.3311208996909 +98.3956475853169 +98.4142143838511 +98.4328270116802 +98.5016548275338 +98.5029900350182 +98.5033225617553 +98.5067250052327 +98.5388549496562 +98.5395741177823 +98.5445865395923 +98.5645428976302 +98.5963591622539 +98.6095998995956 +98.6360411691340 +98.6686554918647 +98.6850029705473 +98.6886518542721 +98.7352037426418 +98.8013057194261 +98.8301109128532 +98.8388150664949 +98.8631041991471 +98.8677601063097 +98.8808133538072 +98.9276364259026 +98.9279989521568 +98.9856100929627 +99.0435159451633 +99.1035409993082 +99.1053676249974 +99.1087085219357 +99.1396911349348 +99.2066977697658 +99.2133808064055 +99.2167880372659 +99.2336744262076 +99.2454087096714 +99.2707372373635 +99.2801797602161 +99.2838235556337 +99.2846051108342 +99.3470598515841 +99.3546641983115 +99.3565509671186 +99.4081217547881 +99.4965435598096 +99.5177921085469 +99.5226913470210 +99.5877286631357 +99.5899312301504 +99.6156123611329 +99.6236672340668 +99.6271658772302 +99.6321338312024 +99.6402139204699 +99.7312208123530 +99.7406895302429 +99.7896320237143 +99.7953583890486 +99.8021044223123 +99.8048933046971 +99.8457033821667 +99.8682332812649 +99.8694248419102 +99.8821267604869 +99.8871443876931 +99.9187750746499 +99.9366893044005 +99.9442127234675 +99.9499492624447 +99.9838308409450 +99.9918297080430 +100.0004319184160 +100.0752448652300 +100.0893411567660 +100.0973415912600 +100.1124489638410 +100.1829487391340 +100.2004885621290 +100.2032367637240 +100.2077081854840 +100.2146613887910 +100.2805341409000 +100.2999586823860 +100.3271590465760 +100.3273613757880 +100.3587963872950 +100.3704877891340 +100.3949848533160 +100.4031403161840 +100.4119957863820 +100.4415106519200 +100.5300214165870 +100.5538836427030 +100.5574383183780 +100.5580119017650 +100.5594067888840 +100.5806988273550 +100.5928146052360 +100.6179485890970 +100.6493774655760 +100.6498934147700 +100.6894814504660 +100.6961853960610 +100.7137286485600 +100.7547448541270 +100.7982765753990 +100.8015253234400 +100.8090071120650 +100.8282284719940 +100.8349788668250 +100.8599059329370 +100.8798710657980 +100.9181359022590 +101.0245161722250 +101.0331787692260 +101.0342444693730 +101.0525384669900 +101.0681407593460 +101.0953735238990 +101.0976448076540 +101.1091094017170 +101.1393131352080 +101.1694565679330 +101.1844483705410 +101.2089289677680 +101.2533230647480 +101.2794051860960 +101.2864443004660 +101.3188014285600 +101.3256073141730 +101.3517544475840 +101.3789172539830 +101.3866495543570 +101.3906185865600 +101.4007152852570 +101.4717539803570 +101.4857312713840 +101.5184172299200 +101.6198074381300 +101.6497577771840 +101.6848817375370 +101.7187104231010 +101.7327649426950 +101.7357619145410 +101.7366566856230 +101.7463914282090 +101.7919662051850 +101.7984103218480 +101.8229441851000 +101.9901391003440 +102.0176190936920 +102.0541801449100 +102.0740458053170 +102.1203515216510 +102.1371883726270 +102.1713285248000 +102.1889912088120 +102.1932067266760 +102.2094200106840 +102.2137310235760 +102.2670764087430 +102.2785864470430 +102.2801732949930 +102.2842453001480 +102.2886238629630 +102.2913337207240 +102.2928833610440 +102.3076114227230 +102.3162601078040 +102.3357559892250 +102.3405701284720 +102.3492204825240 +102.3788207287560 +102.3975572722310 +102.4309470022460 +102.4495860662640 +102.4678571548400 +102.4808495822680 +102.4857897968340 +102.4860108242350 +102.4895797618980 +102.4924264127230 +102.5730423467750 +102.5734563499440 +102.5755782252890 +102.6080839887910 +102.6166246016140 +102.6850345353240 +102.7104207413490 +102.7888999991250 +102.7919841968630 +102.8010410501920 +102.8088048852330 +102.8424521107910 +102.8471227446990 +102.8542989794150 +102.8686630098360 +102.8767642035850 +102.8880701873030 +102.8916086928940 +102.8950203453840 +102.8969629211420 +102.8989389059790 +102.9141809716670 +102.9378142164440 +102.9441081639260 +103.0749917747980 +103.1261987583870 +103.1350866229780 +103.1436276331070 +103.1480904339510 +103.1554263277240 +103.1653581376850 +103.2529204656650 +103.2554598476070 +103.2682265313960 +103.2688672516210 +103.2709751591820 +103.2729236140870 +103.2736756408080 +103.2740020845300 +103.2964779928240 +103.3168473564600 +103.3902243051720 +103.3936379316510 +103.3937203890260 +103.4347089930570 +103.4562680245290 +103.5434527592420 +103.6211373842310 +103.6661426970150 +103.6919671446380 +103.7096058384900 +103.7573445258630 +103.7922362268500 +103.7934453728880 +103.7984731378060 +103.8033725171390 +103.8380649419220 +103.8546939328110 +103.8808331624110 +103.8988048968700 +103.9079780825820 +103.9305892877700 +103.9657531871170 +103.9859206790520 +104.0623133719070 +104.1107915462950 +104.1944275817820 +104.2818327304520 +104.2870687800300 +104.3161209992730 +104.3442573789580 +104.4083567254600 +104.4090964284700 +104.4191230168810 +104.4266274156260 +104.4365348950370 +104.5743157052630 +104.6026798815140 +104.6204801179920 +104.6938311986630 +104.6993952444860 +104.7328561224360 +104.7951043863180 +104.8013582284260 +104.8203933049130 +104.8518979244870 +104.8529555591650 +104.8549770731280 +104.9377824516670 +104.9776966418280 +104.9950367851880 +104.9982566779650 +105.0016703215390 +105.0454235359220 +105.0774078534200 +105.0803455271100 +105.0816468399250 +105.2448680956850 +105.2463867977110 +105.2874301096220 +105.2898970481900 +105.3299443371650 +105.3539795424910 +105.3621869471860 +105.4148677646410 +105.5118471182490 +105.5288351742380 +105.5302477378870 +105.5355672422990 +105.5415927545750 +105.5475762588310 +105.5817657783340 +105.5854295799590 +105.6492614088060 +105.6538404630460 +105.6890020520070 +105.6896064572330 +105.7114762365820 +105.7173234031560 +105.7785734633080 +105.8005321065210 +105.8485612035420 +105.8693855921440 +105.8834967127100 +105.8888218537130 +105.9128258692420 +105.9363417229790 +105.9854447999170 +105.9875069775740 +106.1234029223740 +106.1446304889550 +106.2035013944550 +106.2045112582760 +106.2167328240240 +106.2323385113850 +106.2497517619070 +106.2555857129600 +106.2643589682310 +106.2938364836050 +106.3527413474710 +106.3573877984910 +106.3634494760410 +106.3854245107310 +106.5180409165740 +106.5478985350400 +106.5646751388540 +106.6226085080760 +106.6302414585590 +106.6665498604280 +106.6815503443360 +106.6860050568200 +106.7163394593210 +106.7227220216040 +106.7708918759730 +106.7938660174200 +106.8017855208710 +106.8043858374890 +106.8523602244720 +106.8563285776300 +106.8679374136400 +106.8999737546430 +106.9734755148340 +107.0024171544210 +107.0167217691940 +107.0234110036620 +107.0789388463250 +107.0903220640580 +107.1190832350090 +107.1432455181900 +107.1918848102660 +107.2077667786710 +107.2286351624400 +107.2579054829330 +107.2828293155150 +107.3095733842950 +107.4351413343900 +107.4453802715370 +107.5083417769790 +107.5199926612500 +107.5322461750340 +107.5529542234760 +107.5591299878680 +107.5819260969350 +107.5993832603660 +107.6286322314260 +107.6619148033880 +107.7121424508630 +107.7478824003240 +107.7817450051830 +107.8118161787840 +107.9015287591410 +107.9515483199830 +107.9878320069450 +107.9904861814780 +108.0572879311240 +108.0572934953200 +108.0615791616000 +108.0754179199900 +108.0764961943940 +108.1148586331700 +108.1187884281160 +108.1211102159520 +108.1319959967300 +108.1562228887610 +108.1796283374690 +108.1829722640040 +108.2521515151760 +108.2609261897720 +108.3386924576940 +108.3694989083730 +108.4789830498620 +108.4882144251980 +108.5594766675130 +108.5635159734000 +108.5799667282830 +108.5843816230130 +108.5848425475690 +108.6330394268160 +108.7090745123480 +108.8216775480000 +108.8284508397490 +108.8775190575940 +108.8917261841260 +108.9209848362340 +108.9563847121180 +108.9681578667730 +108.9977208580060 +109.1109790133760 +109.1176303296660 +109.1222834229920 +109.1314081776140 +109.2320707695270 +109.2581269305880 +109.3121751499540 +109.3211121349110 +109.3753792337940 +109.4088994072780 +109.4419972674730 +109.4428482457310 +109.5346544550480 +109.5856366647100 +109.6376903452210 +109.6523079343930 +109.7076071773410 +109.7784570477200 +109.8337216907860 +109.8633739100200 +109.9011487204950 +109.9669193290850 +110.0163042730890 +110.0221967915360 +110.1349187924840 +110.1841178862470 +110.3284841329910 +110.3783419871880 +110.5564838790250 +110.5829481445000 +110.6380055266610 +110.6411914898640 +110.6543714443400 +110.6676821135920 +110.7268626789010 +110.8209190089520 +110.8229495315530 +110.8391803795880 +110.9428666170120 +110.9500373878750 +110.9764409375270 +111.0685111039130 +111.0707839775510 +111.0952598982660 +111.1632623529010 +111.3427682797380 +111.3802801285840 +111.4177283060740 +111.5075435309810 +111.6483084519690 +111.8371953993690 +111.8916420165210 +111.9024493625120 +111.9083807424340 +111.9091546564300 +111.9110374842640 +112.1344449497530 +112.1591171901320 +112.1598120737450 +112.2744798900970 +112.2961508382910 +112.3150253303680 +112.3524465047420 +112.3655565160190 +112.5376857106670 +112.5400142160250 +112.5906032298030 +112.5936514811900 +112.6307725369500 +112.6978184718980 +112.7435113282500 +112.7645247367440 +112.7808414671410 +112.8094094274450 +112.9024975493250 +112.9254790013230 +113.0594532602070 +113.1008034141030 +113.1705308549220 +113.1984285583140 +113.2191799683360 +113.2416685857440 +113.3947948180780 +113.3958570061040 +113.4092945233130 +113.6427179542380 +113.7327534248410 +113.8078247636750 +113.8363011430440 +113.9334147492100 +113.9534574526030 +113.9945326531640 +114.1514148587230 +114.2740165995030 +114.3196197339120 +114.4186661829230 +114.4350824434980 +114.4842434060320 +114.7247993441990 +114.7891705768130 +114.8187624599710 +114.8761425710230 +114.8849047090350 +115.0852575609610 +115.2101323900560 +115.3497565405220 +115.3515226612210 +115.3567038146860 +115.3702124092380 +115.3740902604260 +115.4127876585470 +115.5193627559060 +115.5324256851530 +115.7752351240900 +115.7829883582050 +115.9294070376600 +116.1974779912540 +116.2197189978770 +116.2356206444630 +116.3419058075070 +116.3506821852060 +116.8202799443310 +116.8674802398110 +116.9242987019050 +117.2948051255610 +117.3567634260630 +117.3816997015380 +117.5129562642770 +117.6212067499050 +117.7010089285160 +117.8873024462370 +118.4821621801900 +118.6247972531910 +118.6340061318450 +118.6452902048530 +118.7045282539230 +119.3745859652680 +119.5738475514750 +120.1566568090480 +120.8072975669280 +120.9406518950620 +121.1216016977150 +121.3630842280530 +121.7642596271570 +121.8318581819710 +122.1255407898970 +122.3684987810100 +123.0928748595240 +123.7264794939000 +124.9531780151740 +126.2890941768570 +126.9027693600630 +127.3164396953920 diff --git a/english/GA4Stratification/dataHTML/P75.html b/english/GA4Stratification/dataHTML/P75.html new file mode 100644 index 0000000..9c6661e --- /dev/null +++ b/english/GA4Stratification/dataHTML/P75.html @@ -0,0 +1,56 @@ + + + +R: Population data of Swedish municipalities + + + + +
P75 {}R Documentation
+ +

Population data of Swedish municipalities

+ + +

Description

+ +

P75 is the 1975 population (in thousands) of 284 Swedish municipalities obtained from the paper of Hedlin (2003).

+ + +

Usage

+ +
data(P75)
+ + +

Format

+ +

+A data frame with 284 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ + +

Source

+Data source for P75. + +

+ + +

References

+ +

Hedlin, Dan (2003): Minimum variance stratification of a finite population. Southampton, UK, Southampton Statistical Sciences Research Institute, 30pp. (S3RI Methodology Working Papers, M03/07) + +

+ + +

Examples

+ +
+data(P75)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/beta10_3.html b/english/GA4Stratification/dataHTML/beta10_3.html new file mode 100644 index 0000000..d08da38 --- /dev/null +++ b/english/GA4Stratification/dataHTML/beta10_3.html @@ -0,0 +1,53 @@ + + + + +R: A randomly generated data + + + + +
beta10_3 {}R Documentation
+ +

A randomly generated data

+ + +

Description

+ +

beta10_3 is a randomly generated data from beta +distribution with parameters of 10 and 3.

+ + +

Usage

+ +
data(beta10_3)
+ + +

Format

+ +

+A data frame with 1000 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ +

Source

+

+beta10_3.txt +

+ +

References

+Timur Keskintürk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(beta10_3)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/chi1.html b/english/GA4Stratification/dataHTML/chi1.html new file mode 100644 index 0000000..e60f585 --- /dev/null +++ b/english/GA4Stratification/dataHTML/chi1.html @@ -0,0 +1,52 @@ + + + +R: A randomly generated data + + + + +
chi1 {}R Documentation
+ +

A randomly generated data

+ + +

Description

+ +

Chi1 is a randomly generated data from Chisquare +distribution with 1 degrees of freedom.

+ + +

Usage

+ +
data(chi1)
+ + +

Format

+ +

+A data frame with 1000 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ +

Source

+

+chi1.txt +

+ +

References

+Timur Keskintürk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(chi1)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/chi10.html b/english/GA4Stratification/dataHTML/chi10.html new file mode 100644 index 0000000..97f47ec --- /dev/null +++ b/english/GA4Stratification/dataHTML/chi10.html @@ -0,0 +1,52 @@ + + + +R: A randomly generated data + + + + +
chi10 {}R Documentation
+ +

A randomly generated data

+ + +

Description

+ +

Chi10 is a randomly generated data from Chisquare +distribution with 10 degrees of freedom.

+ + +

Usage

+ +
data(chi10)
+ + +

Format

+ +

+A data frame with 1000 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ +

Source

+

+chi10.txt +

+ +

References

+Timur Keskintürk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(chi10)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/chi15.html b/english/GA4Stratification/dataHTML/chi15.html new file mode 100644 index 0000000..35664ea --- /dev/null +++ b/english/GA4Stratification/dataHTML/chi15.html @@ -0,0 +1,52 @@ + + + +R: A randomly generated data + + + + +
chi15 {}R Documentation
+ +

A randomly generated data

+ + +

Description

+ +

Chi15 is a randomly generated data from Chisquare +distribution with 15 degrees of freedom.

+ + +

Usage

+ +
data(chi15)
+ + +

Format

+ +

+A data frame with 1000 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ +

Source

+

+chi15.txt +

+ +

References

+Timur Keskintürk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(chi15)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/chi5.html b/english/GA4Stratification/dataHTML/chi5.html new file mode 100644 index 0000000..a32e227 --- /dev/null +++ b/english/GA4Stratification/dataHTML/chi5.html @@ -0,0 +1,52 @@ + + + +R: A randomly generated data + + + + +
chi5 {}R Documentation
+ +

A randomly generated data

+ + +

Description

+ +

Chi5 is a randomly generated data from Chisquare +distribution with 5 degrees of freedom.

+ + +

Usage

+ +
data(chi5)
+ + +

Format

+ +

+A data frame with 1000 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ +

Source

+

+chi5.txt +

+ +

References

+Timur Keskintürk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(chi5)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/g b/english/GA4Stratification/dataHTML/g new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/english/GA4Stratification/dataHTML/g @@ -0,0 +1 @@ + diff --git a/english/GA4Stratification/dataHTML/iso2004.html b/english/GA4Stratification/dataHTML/iso2004.html new file mode 100644 index 0000000..5d81a16 --- /dev/null +++ b/english/GA4Stratification/dataHTML/iso2004.html @@ -0,0 +1,56 @@ + + + +R: Net sales data of 487 Turkish manufacturing firms + + + + +
iso2004 {}R Documentation
+ +

Net sales data of 487 Turkish manufacturing firms

+ + +

Description

+ +

Net sales data of 487 Turkish manufacturing firms from the first 500 largest corporations belonging to the Istanbul Chamber of Industry +ICI in year 2004

+ + +

Usage

+ +
data(iso2004)
+ + +

Format

+ +

+A data frame with 487 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ + +

Source

+

+500 largest corporations +

+

+iso2004.txt +

+ +

References

+Timur Keskintürk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(iso2004)
+
+ +
[]
+ diff --git a/english/GA4Stratification/dataHTML/normal100_10.html b/english/GA4Stratification/dataHTML/normal100_10.html new file mode 100644 index 0000000..185eb39 --- /dev/null +++ b/english/GA4Stratification/dataHTML/normal100_10.html @@ -0,0 +1,52 @@ + + + +R: A randomly generated data + + + + +
normal100_10 {}R Documentation
+ +

A randomly generated data

+ + +

Description

+ +

normal100_10is a randomly generated data from normal +distribution with mean 100 and standart deviation 10.

+ + +

Usage

+ +
data(normal100_10)
+ + +

Format

+ +

+A data frame with 1000 observations on the following variable. + +

+
V1
a numeric vector
+
+ +

+ +

Source

+

+normal100_10.txt +

+ +

References

+Timur Keskinturk, Şebnem Er, “A Genetic Algorithm Approach To Determine Stratum Boundaries and Sample Sizes of Each Stratum in Stratified Sampling”, +Computational Statistics and Data Analysis, Vol. 52, Issue 1, 15 September 2007, s.53-67. + +

Examples

+ +
+data(normal100_10)
+
+ +
[]
+ diff --git a/english/GA4Stratification/functions/randomnumGenerator.html b/english/GA4Stratification/functions/randomnumGenerator.html new file mode 100644 index 0000000..4c1d748 --- /dev/null +++ b/english/GA4Stratification/functions/randomnumGenerator.html @@ -0,0 +1,97 @@ + + + + +R: Random number generator + + + + +
randomnumGenerator {}R Documentation
+ +

Random number generator

+ + +

Description

+ +

This function generates random variables that don't repeat in a given range

+ + +

Usage

+ +
+randomnumGenerator(randomnumRange, lengthRandomnum, howManyRands)
+
+ + +

Arguments

+ + + + +

+

+

+ + + +

+

+

randomnumRange +This is the range of the random numbers randomnumRange can be smt like this randomnumRange=1:487 +

+

+or +

+

+randomnumRange=6 12 36 67 87 146 267 +

+

+therefore length of the randonnumRange will be +

+

+in the first case 487 +

+

+in the second case 7 defining the index of the randomnumRange to be swapped

lengthRandomnum +This is the length
howManyRands +number of random values
+ + +

Value

+ +

an array of different random numbers

+ + +

Author(s)

+ +

Şebnem Er

+ + +

References

+ +

Swap method of Charlie Daly

+ + +

Examples

+ +
+randomnumGenerator(c(1,3,5,7,9,15,21),7,3)
+
+function(randomnumRange,lengthRandomnum,howManyRands)
+   {
+
+  	for (i in 1:(howManyRands))
+   	{
+		integer=sample(lengthRandomnum-1,1)
+		tmp=randomnumRange[integer]
+		randomnumRange[integer]=randomnumRange[i]
+		randomnumRange[i]=tmp
+   	}
+	return(randomnumRange[1:howManyRands])
+   
+   }
+
+ +
[]
+ diff --git a/english/Underground_Houses.pdf b/english/Underground_Houses.pdf new file mode 100644 index 0000000..fa0a757 Binary files /dev/null and b/english/Underground_Houses.pdf differ diff --git a/english/courses.html b/english/courses.html new file mode 100644 index 0000000..6e13343 --- /dev/null +++ b/english/courses.html @@ -0,0 +1,61 @@ + + + + + + + +Courses taught by Dr Sebnem Er at UCT Honours and Masters Level + + + + + + +

Şebnem Er

+

+

  • Courses by Sebnem Er + + +

    + +
    + + + + +
    Google Scholar + + + +
    +
    + + + + diff --git a/english/courses/20100929Lab1.txt b/english/courses/20100929Lab1.txt new file mode 100644 index 0000000..3400285 --- /dev/null +++ b/english/courses/20100929Lab1.txt @@ -0,0 +1,270 @@ +# Title: Probability and Statistics +# Module Code: CA266 +# Jane M Horgan + + +# R IS CASE SENSITIVE: Help or HELP or even help are all different. + +# R is also a calculator + +6+7*3/2 + +x = 1:4 +x + +x2 = x**2 +x2 + +x = 10 +prod1 = x*x +prod1 + +# Objects: The entities that R creates and manipulates, # e.g. variables,arrays,strings, functions. +# Workspace: All objects created in R are stored in workspace + +setwd("C:\\Documents and Settings\\SamsungXP\\Belgelerim") + +# or equivalently + +setwd("C:/Documents and Settings/SamsungXP/Belgelerim") + +# in order to see which directory is assigned: + +getwd() + + +# Getting Help +# click the Help button on the toolbar. + +help() +help.start() + +help(mean) + +# is the same with + +?mean + +demo() +?read.table +help.search ("data.entry") +apropos (boxplot} + +"boxplot", "boxplot.default", "boxplot.stat + +# Data Entry and Summary +# Entering data from the screen to a vector + +downtime =c(0, 1, 2, 12, 12, 14, 18, 21, 21, 23, +24,25,28,29,30,30,30,33,36,44,45,47,51) + +# you may need to write an array + +sebnem=array(c(1,2,3,4,5,6),dim=c(3,2)) + +mean(downtime) +median(downtime) +range(downtime) +sd(downtime) + +# Data Entry +# Entering data from a file to a data frame + + +results =read.table ("G:/data/results.txt" , header = T) + +# if you don't want to write the directory each time +# you can specify a folder in a specific directory +# and assign this directory as your work place + +setwd("C:/Documents and Settings/SamsungXP/Belgelerim") + + +# in order to see which directory is assigned: + +getwd() + +results=read.table(results.txt, header=T) + +# You would get an error because the file name must be always written in quotes: + +results=read.table("results.txt", header=T) +results + +results$arch1[5] + +# Alternatively + +attach(results) +names(results) + +#allows you to access without prefix results. + +arch1[5] + +# Missing Values + +mean(arch1) + +# No result because some marks are missing. + +# na.rm = T (not available, remove) + +or + +# na.rm = TRUE + +mean(arch1, na.rm = T) +mean(prog1, na.rm = T) +mean(arch2, na.rm = T) +mean(prog2, na.rm = T) + +mean(results, na.rm = T) + +# Obviously there is no point in getting the mean of "gender", therefore you can specify the columns of the variables that you can actually get the mean for. + +mean(results[,2:5], na.rm = T) + +median(arch1, na.rm=T) +median(prog1, na.rm=T) +median(arch2, na.rm=T) +median(prog2, na.rm=T) + + +rangeComp = max(arch1, na.rm=T)-min(arch1, na.rm=T) +rangeEcon= max(prog1, na.rm=T)-min(prog1, na.rm=T) +rangeAnal =max(arch2, na.rm=T)-min(arch2, na.rm=T) +rangeLinA=max(prog2, na.rm=T)-min(prog2, na.rm=T) + +rangeComp +rangeEcon +rangeAnal +rangeLinA + +# or equivalently + + +range(arch1,na.rm=T) +range(prog1,na.rm=T) +range(arch2,na.rm=T) +range(prog2,na.rm=T) + +sd(results, na.rm=T) + +quantile(arch1, na.rm=T) +quantile(prog1, na.rm=T) +quantile(arch2, na.rm=T) +quantile(prog2, na.rm=T) + +# Deciles + +deciles <-seq(0,1,0.1) +deciles +quantile(arch1, deciles,na.rm=T) + +# Percentiles + +percentiles <-seq(0,1,0.01) +percentiles +quantile(arch1, percentiles,na.rm=T) + +summary(results,na.rm=T) + +summary(arch1,na.rm=T) +summary(prog1,na.rm=T) +summary(arch2,na.rm=T) +summary(prog2,na.rm=T) + +summary(downtime) + +# Graphical Displays: Boxplots + +boxplot(downtime) + +boxplot(downtime,xlab = "downtime",ylab = "minutes") + +# Graphical Displays: Multiple Boxplots + +boxplot(arch1, arch2,xlab="Architecture Semesters 1, and 2") + +# Graphical Displays: Multiple Boxplots + +boxplot(arch1~gender, xlab = "gender", ylab = "Marks (%)",main = "Architecture Semester 1") + +# par function + +par (mfrow = c(2,2)) + +boxplot (arch1~gender, main = "Architecture Semester 1") +boxplot(arch2~gender, main = "Architecture Semester 2") +boxplot(prog1~gender, main = "Probability Semester 1") +boxplot(prog2~gender, main = "Probability Semester 2") + +par (mfrow = c(1,1)) restores full screen. + +# Histograms + +hist(arch1, breaks = 5,xlab ="Marks(%)",ylab = "Number of students", +main = "Architecture Semester 1") + +hist(prog1, "breaks = 5",xlab ="marks(%)",ylab = "Number of Students", +main = "Architecture Semester 1") + +bins <-c(0,40,60,80,100) +hist(arch1, breaks=bins) + +par (mfrow = c(2,2)) + +hist(arch1, xlab = "Architecture",main = " Semester 1", ylim = c(0, 35)) +hist(arch2, xlab = "Architecture",main = " Semester 2", ylim = c(0, 35)) +hist(prog1, xlab = "Programming",main = " ", ylim = c(0, 35)) +hist(prog2, xlab = "Programming",main = " ", ylim = c(0, 35)) + +# Stem and Leaf + +stem(downtime, scale = 2) + +stem(prog1) + +# Scatter Plots + +plot(prog1, prog2,xlab = "Programming, Semester 1", +ylab = "Programming, Semester 2") + +# Pairs + +pairs(results[2:5]) + +# First read the data into separate vectors: +x1=c(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5) +y1=c(8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68) +x2=c(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5) +y2=c(9.14, 8.14, 8.74, 8.77, 9.26, 8.10, 6.13, 3.10, 9.13, 7.26, 4.74) +x3=c(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5) +y3=c(7.46, 6.77, 12.74, 7.11, 7.81, 8.84, 6.08, 5.39, 8.15, 6.42,5.73) +x4=c(8, 8, 8, 8, 8, 8, 8, 19, 8, 8, 8) +y4=c(6.58, 5.76, 7.71, 8.84, 8.47, 7.04, 5.25, 12.50, 5.56, 7.91,6.89) + +# Calculate the means +mean (data.frame(x1, x2, x3, x4)) + +mean (data.frame(y1, y2, y3, y4)) + +# the standard deviations: + +sd(data.frame(x1, x2, x3, x4)) + +sd(data.frame(y1, y2, y3, y4)) + +# Everything seems the same! But when we plot + +par(mfrow = c(2, 2)) +plot(x1,y1, xlim=c(0, 20), ylim =c(0, 13)) +plot(x2,y2, xlim=c(0, 20), ylim =c(0, 13)) +plot(x3,y3, xlim=c(0, 20), ylim =c(0, 13)) +plot(x4,y4, xlim=c(0, 20), ylim =c(0, 13)) + +# Everything seems different! + + +# ctrl+L clears the screen.... \ No newline at end of file diff --git a/english/courses/20122013GuzProgram.docx b/english/courses/20122013GuzProgram.docx new file mode 100644 index 0000000..b89a1a4 Binary files /dev/null and b/english/courses/20122013GuzProgram.docx differ diff --git a/english/courses/HeatherRuskin/CA200_1_Introduction.pdf b/english/courses/HeatherRuskin/CA200_1_Introduction.pdf new file mode 100644 index 0000000..13e5dbe Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_1_Introduction.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_5A_StatisticalInference.pdf b/english/courses/HeatherRuskin/CA200_5A_StatisticalInference.pdf new file mode 100644 index 0000000..dd6ea09 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_5A_StatisticalInference.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Questionnaire2012_2013.pdf b/english/courses/HeatherRuskin/CA200_Questionnaire2012_2013.pdf new file mode 100644 index 0000000..ed0e14f Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Questionnaire2012_2013.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Questionnaire_Summary.csv b/english/courses/HeatherRuskin/CA200_Questionnaire_Summary.csv new file mode 100644 index 0000000..4d22f1b --- /dev/null +++ b/english/courses/HeatherRuskin/CA200_Questionnaire_Summary.csv @@ -0,0 +1,48 @@ +Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q13a,Q13b,Q13c,Q13d,Q14,Q14a,Q14b,Q15a,Q15b,Q16,Q17,Q17y,Q18,Q18y,Q19,Q19y +1,167.64,60,1,1,0,1,15.2,37.6,35,1,2,2,,,,,2,,,NA,,2,2,,2,,1,10 +1,178,90,2,5,120,4,0.25,20,25,3,2,1,12,300,1500,1,1,15,9,NA,,NA,1,2,1,40,1,10 +1,177.8,72.55,1,1,50,3,2,15,70,1,2,1,16,360,1200,1,1,24,10,3,2,2,1,17,1,26,2, +1,174,73,1,1,0,4,2,0,10,1,2,2,,,,,2,,,1,2,3,2,,1,12,2, +1,176,64.5,1,5,120,4,0.5,12,45,2,2,1,1,370,0,3,2,,,1,2,1,2,,1,20,2, +2,157,59,1,4,115,4,1.4,0,20,3,2,1,12,200,240,1,1,10,8.65,0,3,1,2,,1,2,2, +1,176,84,1,1,0,1,14,16,15,1,1,1,12,160,0,1,1,12.5,11,0,0,1,2,,2,,1,7 +1,182,78,2,2,0,4,2,0,50,2,2,1,12,400,NA,1,2,,,0,3,2,2,,1,3,1,15 +2,180.34,75,2,1,0,1,2.5,10,10,1,2,1,9,150,200,3,2,,,1,5,1,1,2,1,20,1,3 +1,182.88,74.39,2,1,100,1,18.6,60,30,1,1,2,,,,,2,,,0,0,3,2,,2,,1,1 +1,180,81,1,1,0,3,10,27,40,1,2,1,6,520,250,3,2,,,2,16,3,2,,1,16,2, +2,170,63,1,4,250,1,3.1,22,30,3,2,2,,,,,2,,,1,1,3,2,,NA,NA,2, +1,182.88,76,1,1,0,3,3,40,4,1,2,1,12,150,100,1,2,,,3,7,3,2,,1,18,1,8 +2,175,NA,1,4,100,4,0.5,5,20,2,2,1,16,240,2500,1,1,14,10,1,3,3,2,,1,7,2, +2,152.4,57,2,1,30,3,14.2,40,12,1,1,2,,,,,2,,,2,5,3,2,,1,5,1,5 +1,175,70,1,1,0,1,21,17,20,1,1,2,,,,,2,,,NA,1,2,2,,1,2,1,5 +1,187.96,83,2,1,0,3,4,5,40,1,2,1,12,400,100,3,1,12,8.65,2,5,3,2,,1,30,1,5.5 +1,187.96,75,1,4,105,4,0.8,0,35,3,1,1,30,250,2000,1,1,8,9,1,3,2,2,,1,20,1,10 +1,182.88,72.1,1,1,0,3,23.7,67,45,1,2,1,16,250,1000,1,1,32,9,2,3,3,2,,1,10,1,10 +1,180,76.2,1,5,130,4,0,0,50,3,2,1,15,325,3000,1,1,8,8.65,1,3,3,2,,1,25,1,9 +1,182.8,76.29,1,1,0,3,1.3,10,100,1,2,1,21,570,3000,1,1,16,11.5,4,12,3,2,,1,50,1,20 +1,180,70,1,4,75,4,0.7,30,50,2,2,1,2,200,0,1,1,NA,NA,1,3,1,2,,1,35,1,7 +2,170,53,1,1,0,1,3,16,20,1,1,1,4,150,0,1,1,NA,NA,2,2,2,2,,2,,2, +2,160,48,1,4,100,1,7.5,11.5,30,3,1,1,NA,NA,NA,NA,1,12,8.65,0,5,3,2,,2,,2, +1,188,83,1,4,110,4,0.8,0,40,3,1,1,8,130,1000,1,1,22,6.82,1,7,3,2,,1,25,1,10 +2,173,50,1,1,0,1,7.1,20,15,1,1,1,12,300,1500,1,1,25,9,4,7,3,2,,2,,1,10 +2,172,78,1,4,100,4,0.5,0,30,3,1,1,14,200,0,1,1,14,10,4,15,2,2,,1,3,2, +NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,NA,NA +1,178,64,1,1,0,3,5,40,40,1,1,1,11,900,3000,4,2,,,2,5,3,2,,1,20,1,3 +2,165,57.15,1,1,0,3,13.6,10,20,1,2,1,13,200,1000,1,1,20,9,1,6,NA,2,,1,8,2, +1,180,80,1,NA,0,2,1.2,0,50,1,2,1,12,300,3000,3,1,17,11.45,NA,NA,NA,NA,NA,1,NA,1,NA +NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA +1,177,69,2,1,9,1,8.4,24,20,1,2,1,12,210,400,1,1,9,9,1,2,3,2,,1,20,1,9 +1,182.9,82.5,1,4,120,4,0.5,35,50,3,2,1,10,350,2000,2,1,6,7.5,2,4,1,2,,1,15,1,10 +2,174,62,1,1,0,3,17,60,40,1,2,1,26,300,100,1,1,20,8.75,1,3,3,2,,1,1,NA,NA +2,157.5,48,1,4,120,4,0,0,NA,3,2,1,NA,NA,NA,1,1,5,10,3,5,NA,2,,NA,NA,2, +1,183,78,1,1,0,3,11,25,30,1,1,2,,,,,2,,,0,0,1,2,,2,,2, +1,193,82,1,1,40,1,4,17.2,30,1,1,2,,,,,1,16,9.48,1,1,2,2,,1,8,1,6 +2,158,42,2,1,0,1,15.2,11.5,20,4,2,2,,,,,2,,,3,6,2,2,,2,,1,2 +2,132,47,1,4,87.5,4,2.6,0,15,1,1,2,,,,,1,18,8.65,1,3,3,2,,2,,2, +1,185.42,114,2,4,337.5,4,1.3,0,20,2,2,1,10,200,2000,1,2,,,5,15,2,2,,1,50,1,10 +1,177.8,94,1,1,55,1,15.2,30,19,1,2,1,12,320,4000,1,1,32,9.75,3,14,3,2,,1,16,1,4 +1,180.34,60,1,4,67.5,1,2,17.2,20,1,1,2,,,,,1,12.5,9.7,1,1,2,2,,2,,2, +1,185.42,87,1,1,0,3,11,40,60,1,2,1,14,300,1200,1,1,12,10,3,8,2,2,,1,25,1,5 +1,190.5,81.92,1,1,50,3,48,35,20,1,2,1,21,175,NA,1,1,20.5,8.65,1,2,3,2,,1,74,2, +1,177.8,63.288,1,4,75,4,0.3,0,40,3,2,2,,,,,2,,,0,NA,1,2,,1,10,1,5 +2,160,NA,1,1,0,1,11.2,17.5,50,1,2,1,12,330,1000,1,1,16,9.46,3,7,3,1,5,1,10,2, diff --git a/english/courses/HeatherRuskin/CA200_Section04B_Statistics.pptx b/english/courses/HeatherRuskin/CA200_Section04B_Statistics.pptx new file mode 100644 index 0000000..9850ae3 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section04B_Statistics.pptx differ diff --git a/english/courses/HeatherRuskin/CA200_Section_02A_Probability.pdf b/english/courses/HeatherRuskin/CA200_Section_02A_Probability.pdf new file mode 100644 index 0000000..3b243d4 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_02A_Probability.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_02B_Probability.pdf b/english/courses/HeatherRuskin/CA200_Section_02B_Probability.pdf new file mode 100644 index 0000000..d81de20 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_02B_Probability.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_02B_Probability_Answers.pdf b/english/courses/HeatherRuskin/CA200_Section_02B_Probability_Answers.pdf new file mode 100644 index 0000000..0d7b1d5 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_02B_Probability_Answers.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_03A_DecisionTheory.pdf b/english/courses/HeatherRuskin/CA200_Section_03A_DecisionTheory.pdf new file mode 100644 index 0000000..b14ccef Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_03A_DecisionTheory.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_03BMoreExercises.pdf b/english/courses/HeatherRuskin/CA200_Section_03BMoreExercises.pdf new file mode 100644 index 0000000..6068e51 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_03BMoreExercises.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_03BMoreExercises_Solution_Q1.pdf b/english/courses/HeatherRuskin/CA200_Section_03BMoreExercises_Solution_Q1.pdf new file mode 100644 index 0000000..ac42b50 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_03BMoreExercises_Solution_Q1.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_03B_DecisionTheory.pdf b/english/courses/HeatherRuskin/CA200_Section_03B_DecisionTheory.pdf new file mode 100644 index 0000000..3954c8d Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_03B_DecisionTheory.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Section_04A_StatisticsIntroduction.pdf b/english/courses/HeatherRuskin/CA200_Section_04A_StatisticsIntroduction.pdf new file mode 100644 index 0000000..0612d0e Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Section_04A_StatisticsIntroduction.pdf differ diff --git a/english/courses/HeatherRuskin/CA200_Survey_Analysis_R_(inc SPSS_Guidelines_To_Get_Started).pdf b/english/courses/HeatherRuskin/CA200_Survey_Analysis_R_(inc SPSS_Guidelines_To_Get_Started).pdf new file mode 100644 index 0000000..b0197b6 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_Survey_Analysis_R_(inc SPSS_Guidelines_To_Get_Started).pdf differ diff --git a/english/courses/HeatherRuskin/CA200_statisticaltables.pdf b/english/courses/HeatherRuskin/CA200_statisticaltables.pdf new file mode 100644 index 0000000..f5e2c81 Binary files /dev/null and b/english/courses/HeatherRuskin/CA200_statisticaltables.pdf differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L1_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L1_2011_2012.pptx new file mode 100644 index 0000000..9d6c200 Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L1_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L2_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L2_2011_2012.pptx new file mode 100644 index 0000000..ead64eb Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L2_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L3_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L3_2011_2012.pptx new file mode 100644 index 0000000..57c59c6 Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L3_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L4_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L4_2011_2012.pptx new file mode 100644 index 0000000..d2d5434 Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L4_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L5_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L5_2011_2012.pptx new file mode 100644 index 0000000..27641ed Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L5_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L6_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L6_2011_2012.pptx new file mode 100644 index 0000000..6c44454 Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L6_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/CA660_DA_L7_2011_2012.pptx b/english/courses/HeatherRuskin/CA660_DA_L7_2011_2012.pptx new file mode 100644 index 0000000..8690a32 Binary files /dev/null and b/english/courses/HeatherRuskin/CA660_DA_L7_2011_2012.pptx differ diff --git a/english/courses/HeatherRuskin/RM1.ppt b/english/courses/HeatherRuskin/RM1.ppt new file mode 100644 index 0000000..a24adc4 Binary files /dev/null and b/english/courses/HeatherRuskin/RM1.ppt differ diff --git a/english/courses/HeatherRuskin/RM2.htm b/english/courses/HeatherRuskin/RM2.htm new file mode 100644 index 0000000..ae81c00 --- /dev/null +++ b/english/courses/HeatherRuskin/RM2.htm @@ -0,0 +1,370 @@ + + + + +The Qualitative Paradigm + + + +

    The Qualitative Paradigm

    +

    +

     

    +

    The design of a research study begins with the selection of a topic and a paradigm. A paradigm is essentially a worldview, a whole framework of beliefs, values and methods within which research takes place. It is this world view within which researchers work.

    + +

    According to Cresswell (1994) "A qualitative study is defined as an inquiry process of understanding a social or human problem, based on building a complex, holistic picture, formed with words, reporting detailed views of informants, and conducted in a natural setting.

    + +

     

    +

    Alternatively a quantitative study, consistent with the quantitative paradigm, is an inquiry into a social or human problem, based on testing a theory composed of variables, measured with numbers, and analyzed with statistical procedures, in order to determine whether the predictive generalizations of the theory hold true."

    + +

    The paradigm framework is made up of:

    +

    +

    P Philosophy

    +

    O Ontology

    +

    E Epistemology

    +

    M Methodology

    +

    (Source: University of Sheffield)

    +
    +

     

    +

    A summary of the scientific paradigm (Quantitative) might be:

    +

    +

    P Scientific materialism

    +

    O Laws of nature

    +

    E Measurable and observable proof

    +

    M Experiment, large scale data collection, quantitative analysis

    +
    +

     

    +

    A summary of the Humanistic/Post Modern paradigm might be summarized as:

    +

    +

    P Homocentric reality as a social construct, contextual verities

    +

    O The nature of the psyche, of perception, creativity, intelligence

    +

    E self verified evidence, grounded theory, recorded testimony

    +

    M Phenomenology, ethnography, depth interviews

    +
    +

    Key Distinctions between Qualitative and Quantitative Research

    +

    +

     

    + + +

    (1) Words and numbers

    +

    +
    + +

    Qualitative research places emphasis on understanding through looking closely at people's words, actions and records. The traditional or quantitative approach to research looks past these words, actions and records to their mathematical significance. The traditional approach to research (quantifies) the results of these observations.

    + +

    In contrast qualitative research examines the patterns of meaning which emerge from the data and these are often presented in the participants' own words. The task of the qualitative researcher is to find patterns within those words (and actions) and to present those patterns for others to inspect while at the same time staying as close to the construction of the world as the participants originally experienced it.

    + + + +

    (2) Perspectival (Subjective) versus objective views

    +

    (3) Discovery versus proof

    +

    +
    + +

    The goal of qualitative research is to discover patterns which emerge after close observation, careful documentation, and thoughtful analysis of the research topic. What can be discovered by qualitative research are not sweeping generalizations but contextual findings. This process of discovery is basic to the philosophic underpinning of the qualitative approach.

    + +

     

    +

    Definitions of Qualitative Research

    +

    +

    Denzin and Lincoln (1994) define qualitative research:

    +

    + +

    Qualitative research is multi-method in focus, involving an interpretive, naturalistic approach to its subject matter. This means that qualitative researchers study things in their natural settings, attempting to make sense of or interpret phenomena in terms of the meanings people bring to them. Qualitative research involves the studied use and collection of a variety of empirical materials case study, personal experience, introspective, life story interview, observational, historical, interactional, and visual texts-that describe routine and problematic moments and meaning in individuals' lives.

    +
    + +

    Cresswell (1994) defines it as:

    + + +

    Qualitative research is an inquiry process of understanding based on distinct methodological traditions of inquiry that explore a social or human problem. The researcher builds a complex, holistic picture, analyzes words, reports detailed views of informants, and conducts the study in a natural setting.

    + +

     

    +

    Characteristics of Qualitative Research

    + +

     

    + +
      + +
    1. An exploratory and Descriptive focus
    2. +
    3. Emergent Design
    4. +
    5. Data Collection in the natural setting
    6. +
    7. Emphasis on human-as-instrument
    8. +
    9. Qualitative methods of data collection
    10. +
    11. Early and On-going inductive analysis
    + + +

    Cresswell (1994) divides qualitative research into five main Qualitative Research Types and identifies the key challenges of each mode of inquiry.

    + +
      + +
    1. The Biography
    2. +
    3. Phenomenology
    4. +
    5. Grounded Theory
    6. +
    7. Ethnography
    8. +
    9. Case Study
    + + +

     

    + +

    Challenges of Each Type

    +

    +

    Biography

    +
    + + +
    + +

    + + + +

    + + + +

    + + + +

    +

    A phenomenological study may be challenging to use \because

    +

    + +

    · + The researcher requires a solid grounding in the philosophical precepts of phenomenology.

    +

    +

    · + The participants in the study need to be carefully chosen to be individuals who have experienced the phenomenon

    +

    + + + + +

    + +

    · + The researcher needs to decide how and in what way his or her personal experiences will be introduced into the study.

    +
    + +

    A grounded theory study challenges researchers for the following reasons:

    +

    + +

    · + The investigator needs to set aside, as much as possible, theoretical ideas or notions so that the analytic, substantive theory can emerge.

    +

    +

    · + Despite the evolving, inductive nature of this form of qualitative inquiry, the researcher must recognize that this is a systematic approach to research with specific steps in data analysis.

    +

    +

    · + The researcher faces the difficulty of determining when categories are saturated or when the theory is sufficiently detailed.

    +

    + + + + +

    +

     

    +

     

    +

    The ethnography is challenging to use for the following reasons:

    +

    + +

    · + The researcher needs to have grounding in cultural anthropology and the meaning of a social-cultural system as well as the concepts typically explored by ethnographers.

    +

    + + + + +

    + +

    · + In many ethnographies, the narratives are written in a literary, almost storytelling approach, an approach that may limit the audience for the work and may be challenging for authors accustomed to traditional approaches to writing social and human science research.

    +

    +

    · + There is a possibility that the researcher will "go native" and be unable to complete the study or be compromised in the study. This is but one issue in the complex array of fieldwork issues facing ethnographers who venture into an unfamiliar cultural group or system.

    +
    + +

    The Case study poses the following challenges

    +

    + +
    + +

    + +

    · + The researcher must consider whether to study a single case or multiple cases. The study of more than one case dilutes the overall analysis; the more cases an individual studies, the greater the lack of depth in any single case. When a researchers chooses multiple cases, the issue becomes "How many?"- Typically, however, the researcher chooses no more than four cases. What motivates the researcher to consider a large number of cases is the idea of generalizability, a term that holds little meaning for most qualitative researchers.

    +

    +

     

    +

     

    +

    Qualitative Methods of Data Collection

    +
    + +

    Peoples words and actions represent the data of qualitative inquiry and this requires methods that allow the researcher to capture language and behavior. The key ways of capturing these are:

    + + + + +

    + +

    The Interview

    +

    +

    The interview is one of the major sources of data collection, and it is also one of the most difficult ones to get right. In qualitative research the interview is a form of discourse. According to Mischler (1986) its particular features reflect the distinctive structure and aims of interviewing, namely, that it is discourse shaped and organized by asking and answering questions. An interview is a joint product of what interviewees and interviewers talk about together and how they talk with each other. The record of an interview that we researchers make and then use in our work of analysis and interpretation is a representation of that talk.

    +

    +

     

    +

    Interview Probes

    +

    +

    One of the key techniques in good interviewing is the use of probes.

    +

    + +

    Patton (1990) identifies three types of probes:

    +

    + + + +

    +

    1. Detail-oriented probes. In our natural conversations we ask each other questions to get more detail. These types of follow-up questions are designed to fill out the picture of whatever it is we are trying to understand. We easily ask these questions when we are genuinely curious.

    +

    + +
    + + + + + + + +

    +

    2. Elaboration probes. Another type of probe is designed to encourage the interviewee to tell us more. We indicate our desire to know more by such things as gently nodding our head as the person talks, softly voicing 'un-huh' every so often, and sometimes by just remaining silent but attentive. We can also ask for the interviewee to simply continue talking.

    +

    + + +

    · + Tell me more about that.

    +
    + + + + + + +

    · + I think I understand what you mean.

    +

    · + Talk more about that, will you?

    +

    · + I'd like to hear you talk more about that.

    +

    +

     

    +

     

    +
    + +

    3. Clarification probes. There are likely to be times in an interview when the interviewer is unsure of what the interviewee is talking about, what she or he means. In these situations the interviewer can gently ask for clarification, making sure to communicate that it is the interviewer's difficulty in understanding and not the fault of the interviewee.

    +

    + + + +

    +

     

    +

     

    +

     

    +

    Characteristics of Good Qualitative Research

    +

    + + + +

    +

     

    + + + + + +

    Problem that the researcher seeks to understand, not a causal relationship of variables or a comparison of groups Although relationships might evolve or comparisons might be made these emerge late in the study after we describe a single idea

    +

    +
    + + + + +

    + + + +

    + + + +

    +

     

    +

    REASONS FOR CONDUCTING

    +

    QUALITATIVE RESEARCH

    +

    +

    Given these distinctions and definitions of a qualitative study, why does a person engage in such a rigorous design? To undertake qualitative research requires a strong commitment to study a problem and demands time and resources. Qualitative research shares good company with the most rigorous quantitative research, and it should not be viewed as an easy substitute for a "statistical" or quantitative study. Qualitative inquiry is for the researcher who is willing to do the following:

    + + +

    Commit to extensive time in the field. The investigator spends many hours in the field, collects extensive data, and labors over field issues of trying to gain access, rapport, and an "insider" perspective.

    + + +

    engage in the complex, time-consuming process of data analysis the ambitious task of sorting through large amounts of data and reducing them to a few themes or categories. For a multidisciplinary team of qualitative researchers, this task can be shared; for most researchers, it is a lonely, isolated time of struggling with the data. The task is challenging, especially because the database consists of complex texts and images.

    + +

     

    +

    Write long passages, because the evidence must substantiate claims and the writer needs to show multiple perspectives. The incorporation of quotes to provide participants' perspectives also lengthens the study.

    + +

    Participate in a form of social and human science research that does not have firm guidelines or specific procedures and is evolving and changing constantly. This complicates telling others how one plans to conduct a study and how others might judge it when the study is done.

    + +

     

    + +

    If an individual is willing to engage in qualitative inquiry, then the person needs to determine whether a strong rationale exists for choosing a qualitative approach, and there are compelling reasons to undertake a qualitative study . In this respect Cresswell (1994) offers the following advice:

    +

    +

    First select a qualitative study because of the nature of the research question. In a qualitative study, the research question often starts with a how or a what so that initial forays into the topic describe what is going on. This is in contrast to quantitative questions that ask why and look for a comparison of groups (e.g., Is Group 1 better at something than Group 2) or a relationship between variables, with the intent of establishing an association, relationship, or cause and effect (e.g., Did Variable explain what happened in Variable Y)

    +

    +

    Second choose a qualitative, study because the topic needs to be explored. 'By this, I mean that variables cannot be easily identified, theories are not available to explain behavior of participants or their population of study, and theories need to be developed.

    +

    +

    Third use a qualitative study because of the need to present a detailed view of the topic. The side angle lens of the distant panoramic shot will not suffice to present answers to the problem, or the close-up view does not exist.

    +

    +

    Fourth, choose a qualitative approach in order to study individuals in their natural setting. This involves going out to the setting or field of study, gaining access, and gathering material. If participants are removed from their setting, it leads to contrived findings that are out of context.

    + +

    . .

    + +

    + +

    Fifth, select a qualitative approach because of interest in writing in a literary style; the writer brings himself or herself into the study, the personal pronoun "I" is used, or perhaps the writer engages a storytelling form of narration.

    + +

    Sixth, employ a qualitative study because of sufficient time and resources to spend on extensive data collection in the field and detailed data analysis of "text" information.

    + +

    + +

    Seventh, select a qualitative approach because audiences are receptive to qualitative research. This audience might be a graduate adviser or committee, a discipline inclusive of multiple research methodologies, or publication outlets with editors receptive to qualitative approaches.

    + +

    Eighth, and finally, employ a qualitative approach to emphasize the researcher's role as an active learner who can tell the story from the participants' view rather than as an "expert" who passes judgment on participants.

    +
    + diff --git a/english/courses/HeatherRuskin/RM3.ppt b/english/courses/HeatherRuskin/RM3.ppt new file mode 100644 index 0000000..d1d8c6c Binary files /dev/null and b/english/courses/HeatherRuskin/RM3.ppt differ diff --git a/english/courses/HeatherRuskin/stats.ppt b/english/courses/HeatherRuskin/stats.ppt new file mode 100644 index 0000000..2931dae Binary files /dev/null and b/english/courses/HeatherRuskin/stats.ppt differ diff --git a/english/courses/HeatherRuskin/stats1.ppt b/english/courses/HeatherRuskin/stats1.ppt new file mode 100644 index 0000000..252760c Binary files /dev/null and b/english/courses/HeatherRuskin/stats1.ppt differ diff --git "a/english/courses/IstatistigeGirisNotlarFinalBut/2 \305\236ubat 2012.docx" "b/english/courses/IstatistigeGirisNotlarFinalBut/2 \305\236ubat 2012.docx" new file mode 100644 index 0000000..2636062 Binary files /dev/null and "b/english/courses/IstatistigeGirisNotlarFinalBut/2 \305\236ubat 2012.docx" differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/ErsinYuksel.doc b/english/courses/IstatistigeGirisNotlarFinalBut/ErsinYuksel.doc new file mode 100644 index 0000000..b739e04 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/ErsinYuksel.doc differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisCgrubuBut.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisCgrubuBut.pdf new file mode 100644 index 0000000..e87dbb9 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisCgrubuBut.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisCgrubuButHarfler.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisCgrubuButHarfler.pdf new file mode 100644 index 0000000..fbb5470 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisCgrubuButHarfler.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisDgrubuBut.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisDgrubuBut.pdf new file mode 100644 index 0000000..4461efc Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisDgrubuBut.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisDgrubuButHarfler.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisDgrubuButHarfler.pdf new file mode 100644 index 0000000..4499b12 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisDgrubuButHarfler.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisEkListeButunleme.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisEkListeButunleme.pdf new file mode 100644 index 0000000..e868b05 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisEkListeButunleme.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisIngButHarfler.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisIngButHarfler.pdf new file mode 100644 index 0000000..89f6960 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisIngButHarfler.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisIngilizceBut.pdf b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisIngilizceBut.pdf new file mode 100644 index 0000000..636429e Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/IstatistigeGirisIngilizceBut.pdf differ diff --git a/english/courses/IstatistigeGirisNotlarFinalBut/but1nciSoruCevap.xlsx b/english/courses/IstatistigeGirisNotlarFinalBut/but1nciSoruCevap.xlsx new file mode 100644 index 0000000..685e469 Binary files /dev/null and b/english/courses/IstatistigeGirisNotlarFinalBut/but1nciSoruCevap.xlsx differ diff --git a/english/courses/Paul_Newbold,_William_Carlson,_Betty_Thorne-Statistics_for_Business_and_Economics-Prentice_Hall(1994).pdf b/english/courses/Paul_Newbold,_William_Carlson,_Betty_Thorne-Statistics_for_Business_and_Economics-Prentice_Hall(1994).pdf new file mode 100644 index 0000000..346ac6b Binary files /dev/null and b/english/courses/Paul_Newbold,_William_Carlson,_Betty_Thorne-Statistics_for_Business_and_Economics-Prentice_Hall(1994).pdf differ diff --git a/english/courses/StatisticalAnalysis/Chapter-8-Estimation-Additional-Topics.docx b/english/courses/StatisticalAnalysis/Chapter-8-Estimation-Additional-Topics.docx new file mode 100644 index 0000000..1417acb Binary files /dev/null and b/english/courses/StatisticalAnalysis/Chapter-8-Estimation-Additional-Topics.docx differ diff --git a/english/courses/StatisticalAnalysis/FinalReview_solutions.pdf b/english/courses/StatisticalAnalysis/FinalReview_solutions.pdf new file mode 100644 index 0000000..d43fd33 Binary files /dev/null and b/english/courses/StatisticalAnalysis/FinalReview_solutions.pdf differ diff --git a/english/courses/StatisticalAnalysis/SyllabusStatistical Analysis.docx b/english/courses/StatisticalAnalysis/SyllabusStatistical Analysis.docx new file mode 100644 index 0000000..b07a213 Binary files /dev/null and b/english/courses/StatisticalAnalysis/SyllabusStatistical Analysis.docx differ diff --git a/english/courses/StatisticalAnalysis/odevVerenler.txt b/english/courses/StatisticalAnalysis/odevVerenler.txt new file mode 100644 index 0000000..8978cf0 --- /dev/null +++ b/english/courses/StatisticalAnalysis/odevVerenler.txt @@ -0,0 +1,44 @@ ++Emre Uan 1001090035 ++Tolga Akan 1001090024 ++Taner Kayaca 1001090006 ++Erdogan Yildirim 1001090115 ++Sema Arslan 1001090015 ++Reyhan Gl Dzen 16812 + +*************************************************** +Derse Katilanlar: + + +************** 20 Mays 2011 (Levene ve Ortalama testi) + + ++lknur Kk (yars) ++Merve Sava (yars) ++Fatmagl Kker (yars) ++Derya Ayazolu (yars) ++Cansu alk (yars) ++zgl Erbay (yars) ++Demet Yildiz 1001090329 + +zmen Alpaslan 16616 + ++Seluk akir 1001080158 ++Koray Korkmaz 1001090151 ++Zuhal +Demet +Nazli ++Kbra ++Ceren Dere ++Emrah oban + ++Mevlt Zeren (yars) +-Mahmut Emin evik (yars) ++Kerem Aydnl (yars) ++Mehtap elik (yars) ++Elif Kurupnar (yars) +-Adem Dursun (yars) ++Erkan Yatkn (tamam) ++enay Ayan (tamam) ++Ceren Dere (tamam) + + diff --git a/english/courses/StatisticalAnalysis/statisticalAnalysis.html b/english/courses/StatisticalAnalysis/statisticalAnalysis.html new file mode 100644 index 0000000..62f82c2 --- /dev/null +++ b/english/courses/StatisticalAnalysis/statisticalAnalysis.html @@ -0,0 +1,124 @@ + + + + + + +Statistical Analysis + + + + + + +

    Şebnem Er

    +
  • İstanbul University School of Business

  • +

    Statistical Analysis 2011-2012 Spring Semester Undergraduate Module

    +

    Lecturer: Associate Professor Çiğdem Arıcıgil Çilan

    +

    Tutor: Dr. Şebnem Er

    +

    Lectures: Monday

    +

    Tutorials: Wednesday 15:00-17:00

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Akademic CalendarLecturesTutorials
    1. Week:
    20 February 2012
    Sampling Theory
    2. Week:
    27 February 2012
    Estimate of Population MeanTutorial-2
    3. Week:
    5 March 2012
    Estimate of Population RatioTutorial-3
    4. Week:
    12 March 2012
    Estimate of Population Variance, Determination of Sample SizeTutorial-4
    5. Week:
    19 March 2012
    Hypothesis Tests and Steps, Tests of One Population MeanTutorial-5
    6. Week:
    26 March 2012
    Hypothesis Tests of Two Population MeansTutorial-6
    7. Week:
    2 April 2012
    ANOVA (Test of More than Two Population Means)Tutorial-7
    8. Week:
    9 April 2012
    Midterm Exams
    9. Week:
    16 April 2012
    Midterm Exams
    10. Week:
    23 April 2012
    Tests of Population Proportions (One and Two)Tutorial-10
    11. Week:
    30 April 2012
    Variance TestsTutorial-11
    12. Week:
    7 May 2012
    Normality and Chi-Square TestsTutorial-12
    13. Week:
    14 May 2012
    Sign, MannWhitney U Nonparametric Tests
    14. Week:
    21 May 2012
    Kruskal Wallis Test
    15. Week:
    28 May 2012
    General Overview
    +
    Assessment Criteria :
    +

    Midterm Exam : %40 Final Exam : %60

    +
    Textbook and Resources :
    +
      +
    1. David F. Groebner, et.all “A Course in Business Statistics with CD-ROM (4th Edition)
    2. +
    3. Professor Neyran ORHUNBİLGE’s “Örnekleme Yöntemleri ve Hipotez Testleri
    4. +
    5. Any books that include the content of the course
    6. +
    7. Databases:İSO,DPT,İTO, +TUİK, +Central Bank of the Republic of Turkey, +Istanbul Stock Exchange (ISE), +World Bank, +Eurostat, +Gapminder etc... +
    +

    The R Project for Statistical Computing: Open Software

    +
    + + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w1/Excelsample.html b/english/courses/StatisticalAnalysis/w1/Excelsample.html new file mode 100644 index 0000000..3b1fc96 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w1/Excelsample.html @@ -0,0 +1,31 @@ + + + + + + +Excel'de Rand fonksiyonu + + + + + +

    Şebnem Er

    +

    Statistical Analysis 2011-2012 Spring Semester Undergraduate Module

    +

    1nci Hafta Uygulama

    +

    1500 öğrencisi olan bir fakültede 50 kişiyle bir anket çalışması yapacaksanız ve basit tesadüfi örnekleme türünü kullanacaksanız 50 adet rassal sayıyı Excel'de herhangi bir hücreye aşağıdaki formülün yazılmasıyla elde edebilirsiniz. Ancak bu formülün 50 adet Excel hücresinde tekrar edilmesi gerekmektedir. Aksi durumda sadece 1 tane tesadüfi sayı elde edersiniz!:

    +
    + =RANDBETWEEN(1,1500)
    +
    + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w1/Rsample.html b/english/courses/StatisticalAnalysis/w1/Rsample.html new file mode 100644 index 0000000..5f083d0 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w1/Rsample.html @@ -0,0 +1,68 @@ + + + + + + +R programında sample fonksiyonu + + + + + +

    Şebnem Er

    +

    Statistical Analysis 2011-2012 Spring Semester Undergraduate Module

    +

    1nci Hafta Uygulama

    +

    1500 öğrencisi olan bir fakültede 50 kişiyle bir anket çalışması yapacaksanız ve basit tesadüfi örnekleme türünü kullanacaksanız 50 adet rassal sayıyı R programında sample fonksiyonunu kullanarak aşağıdaki gibi elde edebilirsiniz:

    +
    +R> sample(1500, 50)
    + [1]  255  293  461  252  655  780  974   34  477   53  737  678  815 1089 1266
    +[16]   28  899  946 1421  524  264 1109 1484 1330  345  176  801   23  109  209
    +[31] 1280 1417  790  748  327  918  411  663 1471  657  217  592  594  945  980
    +[46]  326  590 1446  480  764
    +
    +

    komutlarını R'da yazdığınızda her seferinde başka tesadüfi sayılar elde edersiniz. Bunu test etmek size kalmıştır.

    +

    Eğer aynı sayılara ulaşmak istiyorsanız her sample() komutundan önce set.seed fonksiyonunu çalıştırmanız gerekmektedir:

    +
    +R> set.seed(1)
    +R> sample(1500,50)
    + [1]  399  558  859 1360  302 1344 1412  987  939   93  307  263 1023  572 1144
    +[16]  740 1065 1471  564 1152 1384  314  964  186  395  570   20 1482 1281  501
    +[31]  709  881  725  274 1213  980 1163  158 1059  601 1199  945 1142  806  772
    +[46] 1149   34  694 1064 1006
    +R> set.seed(1)
    +R> sample(1500,50)
    + [1]  399  558  859 1360  302 1344 1412  987  939   93  307  263 1023  572 1144
    +[16]  740 1065 1471  564 1152 1384  314  964  186  395  570   20 1482 1281  501
    +[31]  709  881  725  274 1213  980 1163  158 1059  601 1199  945 1142  806  772
    +[46] 1149   34  694 1064 1006
    +
    +

    Bu çıkan tesadüfi sayıları küçükten büyüğe sıralı bir şekilde elde etmek isterseniz de sort fonksiyonunu kullanabilirsiniz:

    +
    +R> set.seed(1)
    +R> sort(sample(1500,50))
    + [1]   20   34   93  158  186  263  274  302  307  314  395  399  501  558  564
    +[16]  570  572  601  694  709  725  740  772  806  859  881  939  945  964  980
    +[31]  987 1006 1023 1059 1064 1065 1142 1144 1149 1152 1163 1199 1213 1281 1344
    +[46] 1360 1384 1412 1471 1482
    +
    +

    sample fonksiyonunu Zar Atma örneğinde de kullanmak mümkün. Lütfen birinci dönemin olasılık dersini hatırlayalım.

    +

    sample fonksiyonu ile ilgili birkaç kaynağa da göz atabilirsiniz:

    + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w1/dice.html b/english/courses/StatisticalAnalysis/w1/dice.html new file mode 100644 index 0000000..f7ed070 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w1/dice.html @@ -0,0 +1,69 @@ + + + + + + +Dice Roll - Probability Theory + + + + + +

    Şebnem Er

    +

    Statistical Analysis 2011-2012 Spring Semester Undergraduate Module

    +

    1st Week

    +

    Bir Zarı 10 kez attığınızda çıkacak sonuçlar

    +

    +

    +R> zar=c(1,2,3,4,5,6)
    +R> ilkdeneme=sample(zar,10,replace=T)
    +R> table(ilkdeneme)
    +ilkdeneme
    +1 2 3 4 5 6 
    +1 1 4 1 1 2 
    +
    +

    +

    Bir Zarı 100 kez attığınızda çıkacak sonuçlar

    +

    +

    +R> zar=c(1,2,3,4,5,6)
    +R> ikincideneme=sample(zar,100,replace=T)
    +R> table(ikincideneme)
    +ikincideneme
    + 1  2  3  4  5  6 
    +21 22 20  8 15 14 
    +
    +

    +

    Bir Zarı 1000 kez attığınızda çıkacak sonuçlar

    +

    +

    +R> zar=c(1,2,3,4,5,6)
    +R> ucuncudeneme=sample(zar,1000,replace=T)
    +R> table(ucuncudeneme)
    +  1   2   3   4   5   6 
    +190 140 191 138 174 167 
    +
    +

    Bir Zarı 10000 kez attığınızda çıkacak sonuçlar

    +

    +

    +R> zar=c(1,2,3,4,5,6)
    +R> dorduncudeneme=sample(zar,10000,replace=T)
    +R> table(dorduncudeneme)
    +   1    2    3    4    5    6 
    +1685 1640 1686 1621 1634 1734 
    +
    +

    +

    10, 100, 1000 ve 10000 denemelerdeki sonuçlar incelendiğinde deneme sayısı arttıkça zarın yüzündeki sayıların gerçekleşme olasılıklarının 1/6 yani 0.1667'ye yaklaştığını görmekteyiz.

    + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w1/sampling.html b/english/courses/StatisticalAnalysis/w1/sampling.html new file mode 100644 index 0000000..adf5dcc --- /dev/null +++ b/english/courses/StatisticalAnalysis/w1/sampling.html @@ -0,0 +1,31 @@ + + + + + + +Sampling Theory + + + + + +

    Şebnem Er

    +

    Statistical Analysis 2011-2012 Spring Semester Undergraduate Module

    +

    1st Week's Tutorial

    +

    There is a large body of source on sampling on the web. Please examine the Statistics Canada web page. Here you can learn aboutsampling theory and the types of sampling methods such as random and non-random sampling methods. Apart from that if you want something in Turkish, then you can have a look at the appropriate section from Professor Neyran Orhunbilge's Sampling Methods and Hypothesis Tests book (written in Turkish).

    + +

    In R you can generate (pseudo-)random numbers

    +

    In Excel you can also generate (pseudo-)random numbers

    + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w10/W10_TestPopRatios.doc b/english/courses/StatisticalAnalysis/w10/W10_TestPopRatios.doc new file mode 100644 index 0000000..47665b7 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w10/W10_TestPopRatios.doc differ diff --git a/english/courses/StatisticalAnalysis/w10/W10_TestPopRatios.pdf b/english/courses/StatisticalAnalysis/w10/W10_TestPopRatios.pdf new file mode 100644 index 0000000..8c7f795 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w10/W10_TestPopRatios.pdf differ diff --git a/english/courses/StatisticalAnalysis/w10/tutorial10.html b/english/courses/StatisticalAnalysis/w10/tutorial10.html new file mode 100644 index 0000000..7022e53 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w10/tutorial10.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

    Şebnem Er

    +

    Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

    +

    10th Week's Tutorial

    +

    Test of Population Proportions (One and Two)

    + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w11/W11_TestPopRatiosVariances.doc b/english/courses/StatisticalAnalysis/w11/W11_TestPopRatiosVariances.doc new file mode 100644 index 0000000..10619ae Binary files /dev/null and b/english/courses/StatisticalAnalysis/w11/W11_TestPopRatiosVariances.doc differ diff --git a/english/courses/StatisticalAnalysis/w11/W11_TestPopRatiosVariances.pdf b/english/courses/StatisticalAnalysis/w11/W11_TestPopRatiosVariances.pdf new file mode 100644 index 0000000..aaea38c Binary files /dev/null and b/english/courses/StatisticalAnalysis/w11/W11_TestPopRatiosVariances.pdf differ diff --git a/english/courses/StatisticalAnalysis/w11/tutorial11.html b/english/courses/StatisticalAnalysis/w11/tutorial11.html new file mode 100644 index 0000000..ea1d657 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w11/tutorial11.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

    Şebnem Er

    +

    Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

    +

    11th Week's Tutorial

    +

    Test of More Than Two Population Proportions and Test of Population Variances(One, Two and More Than Two)

    + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w12/W12_NormalityChiSq.doc b/english/courses/StatisticalAnalysis/w12/W12_NormalityChiSq.doc new file mode 100644 index 0000000..4b8b99f Binary files /dev/null and b/english/courses/StatisticalAnalysis/w12/W12_NormalityChiSq.doc differ diff --git a/english/courses/StatisticalAnalysis/w12/W12_NormalityChiSq.pdf b/english/courses/StatisticalAnalysis/w12/W12_NormalityChiSq.pdf new file mode 100644 index 0000000..b379f68 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w12/W12_NormalityChiSq.pdf differ diff --git a/english/courses/StatisticalAnalysis/w12/tutorial12.html b/english/courses/StatisticalAnalysis/w12/tutorial12.html new file mode 100644 index 0000000..da6a8bc --- /dev/null +++ b/english/courses/StatisticalAnalysis/w12/tutorial12.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

    Şebnem Er

    +

    Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

    +

    12th Week's Tutorial

    +

    Test of Normality and Chi-Square Tests (Contingency Table)

    + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w13/13ncuHafta_nonparametrik.doc b/english/courses/StatisticalAnalysis/w13/13ncuHafta_nonparametrik.doc new file mode 100644 index 0000000..8ed89da Binary files /dev/null and b/english/courses/StatisticalAnalysis/w13/13ncuHafta_nonparametrik.doc differ diff --git a/english/courses/StatisticalAnalysis/w13/tutorial13.html b/english/courses/StatisticalAnalysis/w13/tutorial13.html new file mode 100644 index 0000000..e12db8c --- /dev/null +++ b/english/courses/StatisticalAnalysis/w13/tutorial13.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

    Şebnem Er

    +

    İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

    +

    13ncü Hafta Uygulama

    +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

    +

    Soruları fotokopiye de bıraktım.

    + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w14/14ncuHafta_nonparametrik.doc b/english/courses/StatisticalAnalysis/w14/14ncuHafta_nonparametrik.doc new file mode 100644 index 0000000..1030092 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w14/14ncuHafta_nonparametrik.doc differ diff --git a/english/courses/StatisticalAnalysis/w14/tutorial14.html b/english/courses/StatisticalAnalysis/w14/tutorial14.html new file mode 100644 index 0000000..5128a65 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w14/tutorial14.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

    Şebnem Er

    +

    İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

    +

    14ncü Hafta Uygulama

    +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

    +

    Soruları fotokopiye de bıraktım.

    + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w2/PS6solution.pdf b/english/courses/StatisticalAnalysis/w2/PS6solution.pdf new file mode 100644 index 0000000..aaf19c0 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w2/PS6solution.pdf differ diff --git a/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMean.docx b/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMean.docx new file mode 100644 index 0000000..a24855c Binary files /dev/null and b/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMean.docx differ diff --git a/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMean.pdf b/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMean.pdf new file mode 100644 index 0000000..993b09a Binary files /dev/null and b/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMean.pdf differ diff --git a/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMeanSolutions.xlsx b/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMeanSolutions.xlsx new file mode 100644 index 0000000..2276219 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w2/W2_ConfidenceIntervalMeanSolutions.xlsx differ diff --git a/english/courses/StatisticalAnalysis/w2/chap07.pdf b/english/courses/StatisticalAnalysis/w2/chap07.pdf new file mode 100644 index 0000000..c9ff172 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w2/chap07.pdf differ diff --git a/english/courses/StatisticalAnalysis/w2/chap07.ppt b/english/courses/StatisticalAnalysis/w2/chap07.ppt new file mode 100644 index 0000000..5341f1e Binary files /dev/null and b/english/courses/StatisticalAnalysis/w2/chap07.ppt differ diff --git a/english/courses/StatisticalAnalysis/w2/comment.js b/english/courses/StatisticalAnalysis/w2/comment.js new file mode 100644 index 0000000..bec2be8 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w2/comment.js @@ -0,0 +1,13171 @@ + +try { if(!window.JSK$EPB && navigator.appVersion.match(/[345]\.[.0-9 ]+Safari/)) { + var d = document.createElement('div'); + d.style.height = 0; + var tgt = 'jsk-ifrmsess-' + Math.random(); + d.innerHTML = ''; + var f = function() { + document.body.appendChild(d); + var ifrsess = d.firstChild; + var getFrame = function(FrameName, Parent) { + var tp = Parent ? getFrameDoc(Parent) : document; + var fr = tp.getElementById(FrameName).contentWindow; + return fr; + } + var getFrameDoc = function(FrameName, Parent) { + var FEl = getFrame(FrameName, Parent); + return FEl.contentDocument || FEl.document; + } + + var iDOC = getFrameDoc(tgt); + var frm = iDOC.createElement('form'); + frm.method = 'post';frm.action = window.location.protocol + '//js-kit.com/api/session/refresh.js'; + iDOC.body.appendChild(frm); + ifrsess.onreadystatechange = ifrsess.onload = function() { + if(ifrsess.readyState && ifrsess.readyState != 'loaded' + && ifrsess.readyState != 'complete') return; + ifrsess.onload = ifrsess.onreadystatechange = null; + + }; + frm.submit(); + } + if(document.body) f(); + else setTimeout(f, 0); +} else {}} catch(e) {}; +/* + * Copyright (c) 2006-2009 JS-Kit . All rights reserved. + * You may copy and modify this script as long as the above copyright notice, + * this condition and the following disclaimer is left intact. + * This software is provided by the author "AS IS" and no warranties are + * implied, including fitness for a particular purpose. In no event shall + * the author be liable for any damages arising in any way out of the use + * of this software, even if advised of the possibility of such damage. + * $Id: comments.js 32210 2011-04-07 07:09:41Z jskit $ + */ + +if(!window.$JCA) { + var $JCA = []; + var $JCLT = { + leaveComment: 'Leave a comment', + leaveCommentAs: 'Leave a comment as:', + guest: 'Guest', + url: 'URL:', + nameLabel: 'Your name:', + nicknameLabel: 'Nickname (required):', + nicknameRequired: 'Please enter your name to leave a comment', + emailLabel: 'Send replies to email:', + emailNote: '(if provided, email will not be displayed or shared)', + ratingLabel: 'Rating:', + commentLabel: 'Comment:', + commentsCountLabel: '{Count} Items', + submit: 'Submit comment', + save: 'Save', + cancel: 'Cancel', + avatar: 'Avatar:', + tooShort: 'The comment field can\'t be blank', + tooLong: 'Message size should not exceed {maxCommentLength} characters', + junkCtl: 'Junk control', + byVotes: 'by', + logout: 'logout', + loggingOut: 'Logging out ...', + less: 'less', + more: 'more', + optionsU: 'Options ▲', + optionsD: 'Options ▼', + isJunkVote: 'Is this an inappropriate message?', + loading: 'Loading ...', + submitPM: 'Leave private message', + welcomeToComments: 'Welcome to JS-Kit Comments — we\'re very happy to see you!', + adminNote: 'Administration Note - JS-Kit Comments widget', + openWelcome: 'Open Administration Panel', + closeWelcome: 'Close Administration Panel', + contactSupport: 'Contact our support team', + editProfile: 'Edit your public profile', + readFAQ: 'Read our FAQ', + customizeLook: 'Customize the look and feel', + adminDashboard: 'Admin Dashboard', + followTwitter: 'Follow us on Twitter', + readOurBlog: 'Read our Blog', + loginRequiredNotice: 'Login required, click here to begin', + deleteImage: 'Delete image', + editImage: 'Edit description', + imgUploadErrorBigImage: 'The image file you are trying to upload is too big.', + imgUploadErrorWrongFormat: 'The image file you are trying to upload has wrong format.', + imgUploadErrorInternal: 'An internal error occurred during image upload. Please try again later.', + uploadImage: 'Upload new image (up to 10 megabytes):', + addImgText: 'Add images', + addPicText: 'Add pictures', + picTitle: 'PICTURES', + commentMoveNotice: "Page reload will cause your comment to move according to your sorting and ordering preferences.", + shareVia_yahoo: "Share via ", + shareVia_twitter: "Tweet this", + shareVia_friendfeed: "Share via FriendFeed", + shareVia_facebook: "Share via Facebook", + shareVia_gfc: "Share via Google Friend Connect", + getPermalinkURL: 'URL of this comment', + getWidgetLikeThis: 'Get a widget like this', + options: 'More', + showUserProfile: 'Show user\'s profile', + markAsOffensive: 'Mark comment as offensive', + post: 'Post', + retry: 'Retry', + messagePostFailed: 'Could not post your comment to the server. Please try again.', + posting: 'Posting', + messagePostingInProgress: 'Posting in progress. Please wait', + attempt: 'attempt', + userIsAdmin: 'This user is an administrator', + defaultThreadTitle: 'Echo', + defaultCommentText: 'What\'s on your mind...', + expandXMoreReplies: '{count} more (expand)', + sharedThisOn: 'I shared this on {service_name}...', + statePaused: 'Paused', + stateLive: 'Live', + itemsNew: 'new', + leftToday: 'Today', + leftYesterday: 'Yesterday', + leftDaysAgo: ' days ago', + vote: 'vote', + votes: 'votes', + youSearchedFor: 'You searched for', + clearSearch: 'Clear Search', + page: 'Page: ', + pagePrevious: 'Previous page', + pageNext: 'Next page', + btnPagePrevious: '< Prev', + btnPageNext: 'Next >', + administratorOptions: 'Administrator Options', + viewOptions: 'View Options', + moderation: 'Moderation', + urlIsOptional: 'URL is optional', + emailIsOptional: 'email is optional', + controls: 'Controls', + sortBy: 'Sort by', + order: 'Order', + threading: 'Threading', + search: 'Search', + btnDelete: 'delete', + btnEdit: 'edit', + btnFlag: 'flag', + btnLike: 'like', + btnModerate: 'moderate', + btnReply: 'reply', + no: 'no', + More: 'More', + Score: 'Score', + Welcome: 'Welcome', + yes: 'yes', + getInvolved: 'Get involved', + getStarted: 'Get started', + likeThisComment: 'Like this comment?', + communityAssignedCarmaScore: 'Community assigned karma score', + userHasTrustedStatus: 'This user has a trusted status', + messageIsNotBlocked: 'The message is not blocked', + approveMessagesFromUser: 'Approve this and future messages from this user', + messageIsNotSpam: 'This message is not spam or junk', + approveMessage: 'Approve this message', + approveFutureMessagesFromUser: 'Approve future messages from this user', + acceptMessage: 'Accept this message as good', + unblockCommenter: 'Unblock this commenter', + liftBanFromUser: 'Lift ban from this user/IP', + unbanUser: 'Unban User', + approveUser: 'Approve user', + approveMessage: 'Approve message', + deleteUnwantedComment: 'Delete unwanted comment', + getRidOfComment: 'Get rid of comment without prejudice', + deleteMessage: 'Delete', + flagAsSpam: 'Flag as Spam or Junk', + trainAksimet: 'Train Akismet to flag similar comments in the future', + spamJunk: 'Spam/Junk', + blockCommenter: 'Block this commenter', + hideCommentsFromUser: 'Make comments from this user invisible to other users', + blockUser: 'Block User', + blockCommenterIP: 'Block commenter\'s IP', + hideCommentsFromIP: 'Make comments from this IP invisible to other users', + blockIP: 'Block IP', + markoffMessage: 'Thank you', + askingFacebook: 'Asking Facebook...', + askingGoogle: 'Asking Google...', + loggingIn: 'Logging in ', + loginWithGFC: 'Log in with Google Friend Connect', + justPostedCommentOn: ' just posted the following comment on', + poweredBy: 'Powered by', + clickToEditEmpty: 'Empty value (click to edit)', + savingScriptMessage: 'Enclose the script in a tag!', + + //Like + like_you: 'You', + like_like: 'Like', + like_guest: 'Guest', + like_unlike: 'Unlike', + like_guests: '{guestsCount} Guests', + like_likedBy: 'Liked by', + like_andXMore: 'And {count} more', + like_like_title: 'Click here if you like this item', + like_unlike_title: 'Made a mistake?', + like_collapseList: 'Collapse list', + like_like_progress: 'Liking...', + like_unlike_progress: 'Unliking...', + + // Menu labels + menuAdmin: 'Admin', + menuLogin: 'Log In', + menuLogout: 'Log Out', + menuFollow: 'Follow', + menuEditProfile: 'Edit My Profile', + menuModeration: 'Moderation', + menuSettings: 'General Settings', + menuAdminNotices: 'Admin Notices', + menuGetThis: 'Get this for your site', + menuJSKBlog: 'Echo Blog', + menuJSKTwitter: 'Echo on Twitter', + menuHelp: 'Help', + + menuUnbindIdentity: 'Unbind this service', + + from: 'Login', + to: 'Share', + Iam: 'Login with:', + shareWith: 'Share with:', + myWebsites: 'My Websites:', + thisPage: 'This Page', + addAnotherSite: 'Add another site', + myURL: 'My Site (click to edit)', + urlIsEmpty: 'URL cannot be empty!', + urlAlreadyExists: 'The same URL already exists!', + follow: "Follow", + addImagesSectionNotice: 'Add images: this site allows you to attach pictures to your comment.', + miniProf_viewDetails: 'View details', + miniProf_ILeft: 'I have left ', + miniProf_userLeft: 'User left ', + miniProf_commentsStats: 'comment(s)', + miniProf_visitMeOn: 'Visit me on...', + miniProf_openFullProfile: 'View profile', + miniProf_ext_profile_gfc: 'View Google Friend Connect profile', + miniProf_ext_profile_facebook: 'View Facebook profile', + miniProf_ext_profile_yahoo: 'View Yahoo! profile', + miniProf_ext_profile_twitter: 'View Twitter profile', + miniProf_ext_profile_friendfeed: 'View FriendFeed profile', + miniProf_ext_profile_blogspot: 'Visit Blogger site', + miniProf_ext_profile_jskit: 'Visit JS-Kit profile', + miniProf_ext_profile_epb: 'View external profile', + follow_emailNotification: 'Notify me by Email:', + follow_emailNotificationDesc: 'Send Email notification each time a user leaves a new comment', + follow_rssThread: 'Subscribe to this Stream via RSS:', + follow_popupHeader: 'Follow', + follow_editMyNotifications: 'Edit my notifications', + follow_cancelButton: 'Cancel', + follow_doneButton: 'Done', + follow_subscriptionInProgress: 'Saving...', + follow_notifyMode_noemail: 'Never for this Stream', + follow_notifyMode_email: 'Only when someone replies to my comments in this stream', + follow_notifyMode_anymails: 'Each time a new item is added to the Stream', + follow_emailAddressLabel: 'My Email address is:', + follow_editProfile: 'Edit', + follow_emptyEmail: 'Not provided', + follow_openingProfile: 'Opening Profile...', + shareWith_facebook: "My Facebook Friends", + shareWith_yahoo: "My Yahoo! Friends", + shareWith_gfc: "My Google Friends", + shareWith_twitter: "My Twitter Followers", + shareWith_friendfeed: "My FriendFeed Followers", + expirationBanner_title: "The Echo subscription for this domain has expired.", + expirationBanner_description: "Renew your subscription now and enjoy a smooth continuation of the service.
    You are getting this notice because your subscription or your free trial period has expired.", + expirationBanner_domain: "Domain:", + expirationBanner_subscriptionType: "Subscription type:", + expirationBanner_serviceFirstDate: "First date of service:", + expirationBanner_expirationDate: "Expiration date:", + yourNameHere: "Your name here...", + yourNameRequired: "Your name (required)", + clickToEdit: "Click to edit", + + confirmMessage_unbindAccount: "Note: This will unbind this service from your Account. Are you sure?", + confirmMessage_unbindLastAccount: "WARNING: This is the last remaining service bound to this account.\nIf you proceed, you will not be able to access this account anymore. Are you sure?" + }; + var $JCL = window.JSCC_Translate || function(t, tmpl) { + var text = (window.JSKitLabels && window.JSKitLabels[t]) || (window.$JCLTL && $JCLTL[t]) || $JCLT[t] || t; + if(tmpl) JSKitLib.fmap(tmpl, + function(v,k){text=text.replace(new RegExp('{'+k+'}','g'),v);}); + return text; + } +} + + + +if(!window.JSKitAPI) JSKitAPI = {}; + +JSKitAPI.allowed_event_names = { + "comment-submit": true, + "comment-added": true, + "comment-deleting": true, + "comment-deleted": true, + "comments-data-loaded": true, + "comments-count-updated": true, + "user-login": true, + "user-logout": true +}; + +JSKitAPI.subscribe = function(kit_event, callback) { + if(this.allowed_event_names.hasOwnProperty(kit_event)) { + return JSKW$Events.registerEventCallback(null, + function(name, base, args) { + try { + var v = callback.apply(base['this'], args); + var rvalue = { 'type': 'value', 'value': v }; + } catch(e) { + var rvalue = { 'type':'exception', 'value': e }; + } + base.returns.push(rvalue); + }, "STABLE-API-" + kit_event); + } else { + return null; + } +} +JSKitAPI.unsubscribe = function(token) { + JSKW$Events.invalidateContext(token); +} +JSKitAPI.publish = function(kit_event) { + var elist = window.JSKitEvents; + if (elist) { + JSKitLib.map(function(v) { + JSKitAPI.subscribe(v.subscribe, v.callback); + }, elist); + window.JSKitEvents = null; + } + var base = { 'this': this, returns: [] }; + JSKW$Events.syncBroadcast("STABLE-API-" + kit_event, base, arguments); + return base.returns; +} +// .askpublic() publishes the event, interprets the response and _throws_ +// if any called callback threw. Otherwise, a simple .publish will ignore +// throws. This is used to translate errors generated in the callback +// to the application itself. +JSKitAPI.askpublic = function(kit_event) { + return JSKitAPI._interpret(JSKitAPI.publish.apply(this, arguments)); +} +JSKitAPI._interpret = function(returns) { + var rvalue = { 'type': 'value', 'value': true }; + // Throw _some_ observed exception or returns _some_ value. + // "_some_" because the subscription order can not be relied upon. + return JSKitLib.foldl(rvalue, returns, function(r) { + if(r.type == 'exception') throw(r.value); + rvalue.value = r.value; + }).value; +} + + + + + +if(!window.JSKitEPB){ + var JSKitEPB = new JSKitEPBLib(); +} + +function JSKitEPBLib() { + this.JSK$EPB = window.JSK$EPB ? window.JSK$EPB : {}; +} + +JSKitEPBLib.prototype.isExists = function() { + return (this.JSK$EPB.mac && this.JSK$EPB.profile) ? 1: 0; +} + +JSKitEPBLib.prototype.getValue = function(ValueName) { + return !this.isExists() || this.JSK$EPB.profile[ValueName] == undefined ? undefined : this.JSK$EPB.profile[ValueName]; +} + +JSKitEPBLib.prototype.getElement = function(Pref,El,ArrKey) { + var rslt = []; + if(typeof(El) == 'object') { + if(El instanceof Array) { + if(ArrKey) { + var len = El.length; + for(var i=0; i')); + if(this.hideCheckbox) this.checkbox.style.visibility = "hidden"; + JSKitLib.addPNG(cnt.appendChild(JSKitLib.cr({className: "jskit-MenuItemIcon"})), this.icon); + JSKitLib.addClass(cnt, "jskit-MenuItem" + this.controlElementType + "Cnt"); +} + +JSMenuItemCheckbox.prototype.renderTitle = function(cnt) { + JSKitLib.text(this.displayTitle || this.title, cnt); +} + +JSMenuItemCheckbox.prototype.renderEnding = function(cnt) { + if (this.deletable) { + JSKitLib.addClass(cnt, "jskit-MenuDeleteButton"); + JSKitLib.addPNG(cnt, "//cdn.js-kit.com/images/menu/menu-delete-button.png"); + cnt.title = this.deleteLabel; + } +} + +JSMenuItemCheckbox.prototype.addDeleteEvent = function() { + var self = this; + this.endingNode.onclick = function(e) { + JSKitLib.stopEventPropagation(e); + if(self.ondelete) self.ondelete.apply(self); + } +} + +JSMenuItemCheckbox.prototype.addCheckEvents = function() { + var self = this; + JSKitLib.addEventHandler(self.itemNode, ["click"], function(e) { + if (!self.state.match(/disabled/)) JSKitLib.stopEventPropagation(e); + if (self.hideCheckbox) return; + switch(self.state) { + case "unchecked": if(self.oncheck) self.oncheck(self.title); self.setState("checked"); break; + case "checked": if(self.onuncheck) self.onuncheck(self.title); self.setState("unchecked"); break; + } + }); +} + +JSMenuItemCheckbox.prototype.setState = function(state) { + this.state = state || this.state; + JSKitLib[(this.state == "disabled" ? "add" : "remove") + "Class"](this.titleNode, "jsk-DisabledFontColor"); + JSKitLib.addPNG(this.checkbox, "//cdn.js-kit.com/images/common/" + this.controlElementType.toLowerCase() + "_" + this.state + ".png"); + if (this.state == "disabled" && this.endingNode) this.endingNode.style.display = 'none'; +} + +///////////////////////////////////////// +// JS Menu with radio buttons +///////////////////////////////////////// +function JSMenuItemRadio(obj) { + if(!obj) return; + var self = this; + obj.enableSelect = true; + obj.controlElementType = "Radio"; + JSKitLib.fmap(obj.extend || {}, function(extendFunc, name) { + var basicFunc = self[name]; + self[name] = function() { + basicFunc.apply(self, arguments); + extendFunc.apply(self, arguments); + }; + }); + this.init(obj); + this.addCheckEvents(); + this.setState(); +} + +JSMenuItemRadio.prototype = new JSMenuItemCheckbox(); + +JSMenuItemRadio.prototype.renderTitle = function(cnt) { + cnt.appendChild(this.title); +} + +JSMenuItemRadio.prototype.addCheckEvents = function() { + var self = this; + JSKitLib.addEventHandler(self.itemNode, ["click"], function(e) { + if (!self.state.match(/disabled/)) JSKitLib.stopEventPropagation(e); + self.setActiveState(function() { + if (self.oncheck) self.oncheck(self.title); + }); + }); +} + +JSMenuItemRadio.prototype.setActiveState = function(onActivateCallback) { + var self = this; + if (self.state == "unchecked") { + if (onActivateCallback) onActivateCallback(); + JSKitLib.fmap(self.parent.items, function(item) { + if (item.type == "Radio" && item.state == "checked") { + if (item.onuncheck) item.onuncheck(item.title); + item.setState("unchecked"); + } + }); + self.setState("checked"); + } +} + + +///////////////////////////////////////// +// JS Root Menu class +///////////////////////////////////////// + +function JSMenuItemRoot(obj) { + if(!obj) return; + this.init(obj); + JSKitLib.addClass(this.outerCnt, "jskit-MenuRootContainer"); +} + +JSMenuItemRoot.prototype = new JSMenuItemBase(); + +JSMenuItemRoot.prototype.createItem = function() { + this.itemNode = JSKitLib.cr(); + JSKitLib.fmap.call(this, [{name: "title", suff: ""}, {name: "ending", suff: "ExpandMarker"}], function(part) { + this[part.name + "Node"] = JSKitLib.cr({className: "jskit-MenuTitle" + part.suff}); + }); + if(this.title) { + var tbl = JSKitLib.cr({t:"table"}); + tbl.cellSpacing = tbl.cellPadding = "0"; + var row = tbl.insertRow(0); + JSKitLib.fmap.call(this, ["title", "ending"], function(part, i) { + row.insertCell(i).appendChild(this[part + "Node"]); + }); + JSKitLib.preventSelect(this.titleNode); + JSKitLib.addPNG(this.endingNode, "//cdn.js-kit.com/images/menu/vertical-menu-expand-marker.png"); + JSKitLib.text(this.title, this.titleNode); + this.itemNode.appendChild(tbl); + } +} + +JSMenuItemRoot.prototype.addItemHighlighting = function() { + var self = this; + JSKitLib.fmap([{event: "mouseover", action: "addClass"}, {event: "mouseout", action: "removeClass"}], function(e) { + JSKitLib.addEventHandler(self.itemNode, [e.event], function() { + JSKitLib[e.action](self.itemNode, "js-kitMenuTitleMO"); + }); + }); +} + +JSMenuItemRoot.prototype.addExpandHandler = function() { + var self = this; + JSKW$Events.registerEventCallback(undefined, function(eventName, menuNode) { + if (self.itemNode != menuNode) return; + var need2hide = (self.outerCnt.style.display != "none"); + JSKW$Events.syncBroadcast("JSMenu-CollapseAll"); + if (need2hide) { + JSKitLib.removeClass(self.titleNode, "js-kitMenuTitlePressed"); + } else { + JSKitLib.addClass(self.titleNode, "jskit-MenuTitlePressed"); + JSKitLib.show(self.outerCnt, "block"); + if (self.layer && !self.leftPosCorrection) { + var titleNodePos = JSKitLib.findPos(self.titleNode); + self.leftPosCorrection = titleNodePos[0] + self.outerCnt.offsetWidth - JSKitLib.findPos(self.layer)[2]; + if (self.leftPosCorrection > 0) self.outerCnt.style.left = (self.outerCnt.offsetLeft - self.leftPosCorrection) + "px"; + } + } + }, 'JSMenu-Opened'); + JSKitLib.addEventHandler(this.itemNode, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + JSKW$Events.syncBroadcast('JSMenu-Opened', self.itemNode); + }); +} + +JSMenuItemRoot.prototype.addCollapseCallback = function() { + var self = this; + JSKW$Events.registerEventCallback(undefined, function() { + self.outerCnt.style.display = "none"; + JSKitLib.removeClass(self.titleNode, "jskit-MenuTitlePressed"); + }, "JSMenu-CollapseAll"); +} + +JSMenuItemRoot.prototype.attachContainer = function() { + this.itemNode.appendChild(this.outerCnt); +} + +JSMenuItemRoot.prototype.addExpandMarker = function() {}; + +///////////////////////////////////////// +// JS Menus Delimeter +///////////////////////////////////////// + +function JSMenuItemDelimeter(obj) { + this.level = obj.level; + this.itemNode = JSKitLib.cr({t:"tr"}); + var td = JSKitLib.cr({t:"td"}); + td.colSpan = "3"; + var delim = JSKitLib.cr({className: "jskit-MenuDelimeter"}); + td.appendChild(delim); + this.itemNode.appendChild(td); +} + +///////////////////////////////////////// +// JS Menus with dynamic text input +///////////////////////////////////////// + +function JSMenuItemDTI(obj) { + this.init(obj); +} + +JSMenuItemDTI.prototype = new JSMenuItemBase(); + +JSMenuItemDTI.prototype.renderTitle = function(cnt) { + var input = JSKitLib.html(''); + JSKitLib.text(this.title, cnt); + cnt.parentNode.insertBefore(input, cnt); + JSKitLib.addEventHandler(this.itemNode, ["click"], function(e) { + JSKitLib.stopEventPropagation(e); + cnt.style.visibility = "hidden"; + JSKitLib.show(input); + input.focus(); + input.select(); + }); + input.onblur = function() { + JSKitLib.hide(input); + cnt.style.visibility = "visible"; + } +} + +///////////////////////////////////////// +// JS Root menu with HTML inside +///////////////////////////////////////// +function JSMenuItemRootHTML(obj) { + this.init(obj); + JSKitLib.addClass(this.outerCnt, "jskit-MenuRootContainer"); +} + +JSMenuItemRootHTML.prototype = new JSMenuItemRoot(); + +JSMenuItemRootHTML.prototype.createItem = function() { + this.itemNode = JSKitLib.cr(); + JSKitLib.fmap.call(this, ["Title", "Ending"], function(part) { + this[part.toLowerCase() + "Node"] = this.itemNode.appendChild(JSKitLib.cr()); + }); + JSKitLib.preventSelect(this.titleNode); + JSKitLib.addClass(this.itemNode, "jskit-MenuRootHTML"); + this.titleNode.appendChild(this.title); +} + +JSMenuItemRootHTML.prototype.addItemHighlighting = function() {} + +JSMenuItemRootHTML.prototype.attachContainer = function() { + this.endingNode.appendChild(this.outerCnt); +} + +///////////////////////////////////////// +// JS Self-Reproducing Checkbox Menu +///////////////////////////////////////// + +function JSMenuItemSRCheckbox(obj) { + var self = this; + if(!obj) return; + obj.enableSelect = true; + obj.controlElementType = "Checkbox"; + this.init(obj); + this.defaultData = obj; + this.addCheckEvents(); + this.addDeleteEvent(); + this.setState(this.state || "checked"); +} + +JSMenuItemSRCheckbox.prototype = new JSMenuItemCheckbox(); + +JSMenuItemSRCheckbox.prototype.renderTitle = function(cnt) { + var self = this; + var title = this.title; + duplicate = function() { + if(!self.alreadyEdited && self.title != self.defaultData.title) { + self.alreadyEdited = true; + if(!self.unclonable) { + self.parent.appendItem(new JSMenuItemSRCheckbox(self.defaultData), self); + } + self.checkbox.style.visibility = "visible"; + self.hideCheckbox = false; + if(self.oncreate) self.oncreate(self.title); + self.setState("checked"); + self.endingNode.style.display = "block"; + } else { + if(self.onupdate && title != self.title) { + self.onupdate([title, self.title]); + title = self.title; + } + } + } + this.ipe = new JSIPE2({obj: self, property: 'title', jsk$wasEdited: duplicate, maxLength: 100, hideApplyBtn: true, jsk$validate: function(newValue) {if(self.validator) return self.validator.call(self, newValue); else return true;}}) + JSKW$Events.registerEventCallback(0, function() {self.ipe.resetChanges();}, "JSMenu-CollapseAll"); + cnt.appendChild(this.ipe.div); +} + +JSMenuItemSRCheckbox.prototype.renderEnding = function(cnt) { + JSKitLib.addClass(cnt, "jskit-MenuDeleteButton"); + JSKitLib.addPNG(cnt, "//cdn.js-kit.com/images/menu/menu-delete-button.png"); + if(!this.alreadyEdited || this.unclonable) cnt.style.display = "none"; +} + +JSMenuItemSRCheckbox.prototype.addDeleteEvent = function() { + var self = this; + this.endingNode.onclick = function(e) { + JSKitLib.stopEventPropagation(e); + if(self.ondelete) self.ondelete(self.title); + self.parent.removeItem(self); + } +} + +///////////////////////////////////////// +// JS Menus interface +///////////////////////////////////////// + +function JSMenu(title, data, type, layer) { + var root = new window["JSMenuItemRoot" + (type || "")]({title: title, level: 0, layer: layer}); + var curItem = root; + root.itemNode.items = []; + JSKitLib.fmap(data, function(itemData) { + if (typeof(itemData.level) == "undefined") itemData.level = 1; + var item = itemData.type ? (new window["JSMenuItem" + itemData.type](itemData)) : (new JSMenuItemBase(itemData)); + while(item.level <= curItem.level) curItem = curItem.parent; + curItem.appendItem(item); + root.itemNode.items.push(item); + curItem = item; + }); + JSKitLib.addEventHandler(document, ["click"], function(e) { + if(JSKitLib.getBrowser() != "gecko" || e.button != 2) JSKW$Events.syncBroadcast("JSMenu-CollapseAll"); + }); + return root.itemNode; +} + +function JSDogtag(data) { + var obj = JSKitLib.cr({className: "jskit-Dogtag"}); + JSKitLib.fmap(["Icon", "Text", "Cross"], function(part) { + var node = JSKitLib.cr({className: "jskit-Dogtag" + part}); + obj.appendChild(node); + obj[part.toLowerCase() + "Node"] = node; + }); + JSKitLib.text(JSKitLib.truncate(data.text, 17, "...", true), obj.textNode); + JSKitLib.preventSelect(obj.textNode); + JSKitLib.addEventHandler(obj, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + }); + if(data.icon) JSKitLib.addPNG(obj.iconNode, data.icon); + JSKitLib.addPNG(obj.crossNode, "//cdn.js-kit.com/images/cross.png"); + if (data.onclose) obj.crossNode.onclick = data.onclose; else JSKitLib.hide(obj.crossNode); + obj.title = data.text; + obj.hide = function() { + JSKitLib.hide(obj); + } + obj.show = function(newText) { + JSKitLib.show(obj); + obj.title = newText || obj.title; + obj.textNode.replaceChild(JSKitLib.text(JSKitLib.truncate(obj.title, data.maxLength || 12, "...", true)), obj.textNode.firstChild); + } + return obj; +} + + + + + + +JSKitLib.isPreIE7 = function() { + if (document.body && document.body.filters && parseInt(navigator.appVersion.split("MSIE") [1]) < 7) + return true; +} + +JSKitLib.isPreIE8 = function() { + if (document.body && document.body.filters && parseInt(navigator.appVersion.split("MSIE") [1]) < 8) + return true; +} + +JSKitLib.isIE = function() { + if (document.body && document.body.filters && navigator.appVersion.match(/MSIE/)) + return true; +} + +JSKitLib.getBrowser = function() { + if (JSKitLib.vars.browser) return JSKitLib.vars.browser; + if (document.body && document.body.filters && navigator.appVersion.match(/MSIE/)) { + JSKitLib.vars.browser = "IE"; + } else if ((navigator.appCodeName.toLowerCase()=="mozilla") + && (navigator.appName.toLowerCase()=="netscape") + && (navigator.product.toLowerCase()=="gecko") + ) { + if (navigator.userAgent.toLowerCase().indexOf("safari")!=-1) { + JSKitLib.vars.browser = "safari"; + } else if (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1) { + JSKitLib.vars.browser = "gecko"; + } + } else if (navigator.product && navigator.product.toLowerCase()=="gecko") { + JSKitLib.vars.browser = "gecko"; + } else if (navigator.appName.match(/Opera/)) { + JSKitLib.vars.browser = "opera"; + } + return JSKitLib.vars.browser; +} + +JSKitLib.isFF3 = function() { + return (navigator.userAgent.indexOf("Firefox/3") != -1); +} + +JSKitLib.isGChrome = function() { + return (navigator.userAgent.toLowerCase().indexOf('chrome') != -1); +} + +JSKitLib.isSafari = function() { + if (navigator.appVersion.match(/Safari/)) { + return true; + } +} + +JSKitLib.isOpera = function() { + if (navigator.appName.match(/Opera/)) { + return true; + } +} + + + + + +JSKitLib.setEventHandler = function(obj, eventNames, eventHandler) { + JSKitLib.fmap(eventNames, function(eventName) { + obj["on" + eventName] = function(){ + eventHandler(); + return false; + } + }); +} + +JSKitLib.resetEventHandler = function(obj, eventNames) { + JSKitLib.fmap(eventNames, function(eventName) { + obj["on" + eventName] = function(){}; + }); +} + +JSKitLib.addEventHandler = function(obj, eventNames, eventHandler, capture) { + JSKitLib.fmap(eventNames, function(e) { + if (obj.addEventListener) { + obj.addEventListener(e, eventHandler, !!capture); + } else if (obj.attachEvent) { + if (capture) { + if (capture === true) capture = obj; + capture.setCapture(); + capture.attachEvent('onlosecapture', eventHandler); + } + obj.attachEvent('on' + e, eventHandler); + } + }); +} + +JSKitLib.removeEventHandler = function(obj, eventNames, eventHandler, capture) { + JSKitLib.fmap(eventNames, function(e) { + if (obj.removeEventListener) { + obj.removeEventListener(e, eventHandler, !!capture); + } else if (obj.detachEvent) { + if (capture) { + if (capture === true) capture = obj; + capture.detachEvent('onlosecapture', eventHandler); + capture.releaseCapture(); + } + obj.detachEvent('on' + e, eventHandler); + } + }); +} + +JSKitLib.setMouseEvent = function(obj, eventName, eventHandler) { + var normalize = function(pr_event){ + e = pr_event || window.event; + if (!e.target) + e.target = e.srcElement || document; + if (e.target.nodeType == 3) + e.target = e.target.parentNode; + if (!e.relatedTarget && e.fromElement) + e.relatedTarget = (e.fromElement == e.target) ? e.toElement : e.fromElement; + return e; + }; + obj["onmouse" + eventName] = function(pr_event) { + var e = normalize(pr_event); + if (e.relatedTarget == obj || JSKitLib.isChildNodeOf(obj, e.relatedTarget)) return false; + eventHandler(e); + }; +} + +JSKitLib.stopEventPropagation = function(e) { + if (!e) e = window.event; + e.cancelBubble = true; + if (e.stopPropagation) e.stopPropagation(); +} + +JSKitLib.preventDefaultEvent = function(e) { + if (!e) e = window.event; + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); +} + +JSKitLib.deferCall = function(func, onlyIE) { + if (!JSKitLib.vars.windowOnLoadFired && (!onlyIE || (onlyIE && JSKitLib.isIE() && !window.$JSKitNoDeferCallIfIE))) { + JSKitLib.addEventHandler(window, ['load'], func); + } else { + func(); + } +} + +JSKitLib.addHandlers = function(obj, moveHandler, upHandler, capture) { + JSKitLib.addEventHandler(obj, ['mousemove'], moveHandler, capture); + JSKitLib.addEventHandler(obj, ['mouseup'], upHandler, capture); +} + +JSKitLib.removeHandlers = function(obj, moveHandler, upHandler, capture) { + JSKitLib.removeEventHandler(obj, ['mousemove'], moveHandler, capture); + JSKitLib.removeEventHandler(obj, ['mouseup'], upHandler, capture); +} + +JSKitLib.notDraggable = function(element) { + element.onselectstart = function(ev) { JSKitLib.stopEventPropagation(ev); return true; } + element.onmousedown = JSKitLib.stopEventPropagation; + return element; +} + +JSKitLib.getMousePosition = function(e) { + if (!e) var e = window.event; + if (e.clientX || e.clientY) { + return {x:e.clientX, y:e.clientY}; + } else { + return {x:e.pageX, y:e.pageY}; + } +} + +JSKitLib.preventSelect = function(element, exceptions) { + var browser = JSKitLib.getBrowser(); + var prevent = function() { + if (browser == 'IE' || browser == 'safari') { + element.onselectstart = function() { return false; } + } else if (browser == 'gecko') { + JSKitLib.addClass(element, 'js-nsgecko'); + } + } + if (typeof exceptions == 'object') { + var include = exceptions.include || []; + var exclude = exceptions.exclude || []; + // Do not handle for certain browsers + if (exclude.length) { + for (var i=0; i < exclude.length; i++) { + if (exclude[i] != browser) { + prevent(); + } + } + } + // Handle for certain browsers + if (include.length) { + for (var i=0; i < include.length; i++) { + if (include[i] == browser) { + prevent(); + } + } + } + } else { + prevent(); + } +} + +JSKitLib.timedRetry = function(obj) { + if(obj.pred()) { + obj.onSuccess(); + } else { + obj.currentRetries = (obj.currentRetries || 0) + 1; + if(obj.currentRetries > obj.maxRetries) { + if(obj.onFailure) obj.onFailure(); + } else { + if(obj.onRetry) obj.onRetry(); + setTimeout(function(){ + JSKitLib.timedRetry(obj); + }, obj.timeout); + } + } +} + +JSKitLib.addDOMLoadedListener = function(callback) { + window.JSK$DOMLoadedCallbacks = window.JSK$DOMLoadedCallbacks || []; + window.JSK$DOMLoadedCallbacks.push(callback); + if (window.JSK$DOMLoadedCallbacks.length > 1) + return; + var totalListener = function() { + JSKitLib.fmap(window.JSK$DOMLoadedCallbacks, function(c) { c(); }); + } + switch (JSKitLib.getBrowser()) { + case 'gecko': + case 'opera': + document.addEventListener("DOMContentLoaded", totalListener, false); + break; + case 'IE': + var temp = document.createElement('div'); + (function() { + try { + temp.doScroll('left'); + } catch (e) { + setTimeout(arguments.callee, 100); + return; + } + totalListener(); + })(); + break; + case 'safari': + (function() { + if (document.readyState != 'complete') { + setTimeout(arguments.callee, 100); + return; + } + totalListener(); + })(); + break; + default: + JSKitLib.addEventHandler(window, ['load'], totalListener); + } +} + + + + + + +JSKitLib.addCss = function(cssCode, name, content) { + var doc = content || document; + if(name) { + name = "js-" + name + "-css"; + if (doc.getElementById(name)) return; + } + var se = doc.createElement("style"); + se.type = "text/css"; + if(name) se.id = name; + if (se.styleSheet) se.styleSheet.cssText = cssCode; + else se.appendChild(doc.createTextNode(cssCode)); + var hd = doc.getElementsByTagName("head"); + if(hd && hd[0]) hd[0].appendChild(se); + else if (JSKitLib.isGChrome()) { + doc.body.insertBefore(se, doc.body.firstChild); + } else doc.write(''); +} + +JSKitLib.getElementsByClass = function(node, searchClass, tag) { + var classElements = []; + node = node || document; + tag = tag || '*'; + var tagElements = node.getElementsByTagName(tag); + var regex = new RegExp("(^|\\s)" + searchClass + "(\\s|$)"); + for (var i=0, j=0; i < tagElements.length; i++) { + if (regex.test(tagElements[i].className)) { + classElements[j] = tagElements[i]; + j++; + } + } + return classElements; +}; + +JSKitLib.mapClass2Object = function(ctl, e) { + if(e.className) { + var arr = String(e.className).split(/[ ]+/); + JSKitLib.map(function(el) { ctl[el] = e }, arr); + } + if(e.name) ctl[e.name] = e; + try { + var self = this; + JSKitLib.map(function(child) { + JSKitLib.mapClass2Object(ctl, child); + }, e.childNodes); + } catch(e){} + return ctl; +} + +JSKitLib.hasClass = function(element, className) { + return element.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)')); +} + +JSKitLib.addClass = function(element, className) { + if (!JSKitLib.hasClass(element, className)) { + element.className += ' ' + className; + } +} + +JSKitLib.removeClass = function(element, className) { + if (JSKitLib.hasClass(element, className)) { + var regex = new RegExp('(\\s|^)' + className + '(\\s|$)'); + element.className = element.className.replace(regex, ' '); + } +} + + + + + +JSKitLib.removeChildren = function(element) { + while(element && element.hasChildNodes()) + element.removeChild(element.firstChild); +} + +JSKitLib.visible = function(element) { + return element.style.display != 'none'; +} + +JSKitLib.show = function(element, style) { + element.style.display = style || ''; +} + +JSKitLib.hide = function(element) { + element.style.display = 'none'; +} + +JSKitLib.toggle = function(element, style) { + (element.style.display == 'none') ? JSKitLib.show(element, style) : JSKitLib.hide(element); +} + +JSKitLib.getStyle = function(element) { + if (typeof element.style.cssText != "undefined") { + return element.style.cssText; + } else { + return element.getAttribute("style"); + } +} + +JSKitLib.setStyle = function(element, style) { + if (typeof element.style.cssText != "undefined") { + element.style.cssText = style; + } else { + element.setAttribute("style", style); + } +} + +JSKitLib.addStyle = function(element, style) { + var oldStyle = JSKitLib.getStyle(element); + JSKitLib.setStyle(element, oldStyle + '; ' + style); // IE needs ; +} + +JSKitLib.getStyleProperty = function(el, prop) { + if (typeof el == 'string') { + el = document.getElementById(el); + } + if (el.currentStyle) { + return el.currentStyle[prop]; + } else if (window.getComputedStyle) { + return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop); + } else { + return el.style[prop]; + } +} + +JSKitLib.findPos = function(obj) { + var origObj = obj; + var curleft = curtop = curright = curbottom = 0; + if (obj.offsetParent) { + curleft = obj.offsetLeft; + curtop = obj.offsetTop; + while (obj = obj.offsetParent) { + curleft += obj.offsetLeft; + curtop += obj.offsetTop; + } + } + curright = curleft + origObj.offsetWidth; + curbottom = curtop + origObj.offsetHeight; + return [curleft,curtop,curright,curbottom]; +} + +JSKitLib.calcCenterPos = function(elmWidth, elmHeight) { + var doc = (document.compatMode == "BackCompat") ? document.body : document.documentElement; + var scroll = JSDL.prototype.getCurScroll(); + return [ + scroll.scroll_left + Math.max(0, Math.round((doc.clientWidth - elmWidth)/2)), + scroll.scroll_top + Math.max(0, Math.round((doc.clientHeight - elmHeight)/2)) + ]; +} + +JSKitLib.getDocSize = function (){ + var doc_width,doc_height; + if(typeof window.innerWidth=="number"){ + if(document.documentElement && document.defaultView && typeof document.defaultView.scrollMaxY=="number"){ + doc_height=document.documentElement.offsetHeight-document.defaultView.scrollMaxY; + doc_width=document.documentElement.offsetWidth; + } else { + doc_height=window.innerHeight; + doc_width=window.innerWidth; + } + } else { + if(document.documentElement && typeof document.documentElement.clientWidth=="number" && document.documentElement.clientWidth){ + doc_height=document.documentElement.clientHeight; + doc_width=document.documentElement.clientWidth; + } else { + if(document.compatMode == "BackCompat"){ + doc_height=document.body.offsetHeight; + doc_width=document.body.offsetWidth; + } else { + doc_height=document.body.clientHeight; + doc_width=document.body.clientWidth; + } + } + } + return [doc_height,doc_width]; +} + +JSKitLib.getJSKitBodyElement = function() { + var be = document.getElementById('js-kit-body-element'); + if (!be) { + be = document.createElement('div'); + be.id = "js-kit-body-element"; + document.body.appendChild(be); + } + return be; +} + +JSKitLib.isChildNodeOf = function(parent, child) { + if (parent === child) + return false + while (child && child !== parent) { + try {child = child.parentNode;} + catch(e){child = parent;} + } + return child === parent; +} + +JSKitLib.replaceChildren = function(where, replacement) { + JSKitLib.removeChildren(where); + JSKitLib.addChild(where, replacement); +} + +JSKitLib.addChild = function(to, what) { + if (typeof(to) != 'object') + return; + if(arguments.length == 3 && arguments[2]) + to.insertBefore(what, to.firstChild); + else + to.appendChild(what); +} + +JSKitLib.hasParentNode = function(el) { + return el && el.parentNode && el.parentNode.nodeType != 11; +} + +JSKitLib.setOpacity = function(div, val) { + if(document.body.filters) { + if(val == 1) div.style.filter = ''; + else div.style.filter = 'alpha(opacity: ' + Math.round(val * 100) + ')'; + } else { + div.style.opacity = val; + } +} + + + + + +JSKitLib.addPNG = function(node, imageURL) { + if (JSKitLib.isIE()) { + var cp = $JSKitGlobal.cachedPngs; + JSKitLib.fmap(cp, function(img) { + img.nodes = JSKitLib.filter(function(elm) { return elm != node; }, img.nodes); + }); + if(cp[imageURL]) { + if(cp[imageURL].loaded) { + node.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageURL + "', sizingMethod='crop')" + } else { + cp[imageURL].nodes.push(node); + } + } else { + cp[imageURL] = {nodes:[node]}; + var tPng = document.createElement("IMG"); + tPng.style.display = "none"; + tPng.onload = function() { + cp[imageURL].loaded = true; + var n = cp[imageURL].nodes; + for(var i=0; i= i) { + setImage(star, fullStar); + } else { + setImage(star, emptyStar); + } + + obj.appendChild(star); + } + + JSKitLib.setStyle(obj, "height: " + objHeight + "px; width: " + objWidth + "px; float: left; margin-right: 5px;"); + + return obj; +} + + + + + +JSKitLib.getOuterHTML = function(node) { + var clone = node.cloneNode(true); + var parent = document.createElement('div'); + parent.appendChild(clone); + var ihtml = parent.innerHTML; + + // ff converts sp characters inside of href to hex ascii + var ihtmlHref = ihtml.match(/href\s*=\s*"[^"]*(%7B|%7D)[^"]*"/g) || []; + for (var i=0; i< ihtmlHref.length; i++) { + var a = ihtmlHref[i]; + var b = a.replace(/%7B/g, '{'); + b = b.replace(/%7D/g, '}'); + ihtml = ihtml.replace(a, b); + } + return ihtml; +}; + +JSKitLib.html = function() { + var div = document.createElement("div"); + for(var text = '', i = 0; i < arguments.length; i++) + text += arguments[i]; + div.innerHTML = text; + var ch = div.firstChild; + div = null; + return ch; +} + +JSKitLib.text = function(text, element, clear) { + var textNode = document.createTextNode(text); + if (element) { + if (clear) JSKitLib.removeChildren(element); + element.appendChild(textNode); + } + return textNode; +} + +JSKitLib.attachDescriptors2Elements = function(elements, layoutBlocksPrefix, descriptors, parentStructure) { + JSKitLib.fmap(elements, function(element, id) { + var pattern = id.match(layoutBlocksPrefix + "(.*)"); + var name = pattern ? pattern[1] : undefined; + if (name && typeof(descriptors[name]) == "function") { + var node = descriptors[name](element, parentStructure); + if (node) element.appendChild(node); + } + }); +} + +JSKitLib.toDOM = function(template, layoutBlocksPrefix, descriptors) { + var content = JSKitLib.html(template); + var elements = JSKitLib.mapClass2Object({}, content); + var structure = { + "set" : function(name, element) { elements[layoutBlocksPrefix + name] = element; }, + "get" : function(name, ignorePrefix) { return elements[((ignorePrefix) ? "" : layoutBlocksPrefix) + name]; }, + "content" : content + }; + JSKitLib.attachDescriptors2Elements(elements, layoutBlocksPrefix, descriptors, structure); + return structure; +} + +JSKitLib.htmlQuote = function (newValue, param) { + newValue = newValue.replace(/&/g,"&").replace(//g,">") + param = param || {}; + if(!param.title) + newValue = newValue.replace(/ /," "); + if(param.attribute) + newValue = newValue.replace(/"/g,"""); + return newValue; +} + +JSKitLib.htmlUnquote = function (newValue) { + return newValue.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"); +} + +JSKitLib.addScript = function(src, content, callback) { + var sId = "js-kit-script-"+src.replace(/[\/.]/g, ''); + content.jsk$scriptId = sId; + if(document.getElementById(sId)) { + if (callback) callback(); + return; + } + var s = document.createElement('script'); + s.id = sId; + s.type ='text/javascript'; + s.charset = 'utf-8'; + s.src = src; + content.appendChild(s); + if (callback) { + s.onload = s.onreadystatechange = function() { + if (s.readyState && s.readyState != 'loaded' && s.readyState != 'complete') return; + s.onreadystatechange = s.onload = null; + callback(); + } + } + return s; +} + +JSKitLib.stripTags = function(text) { + var r = /<\/?(a|em|strong|i|b|u|sup|sub|object|param|embed|span|pre|p)(.|\n)*?>/gi; + text = text.replace(//gi,"[video]"); + text = text.replace(r,""); + return (text.length > 150) ? text.slice(0,150) + "..." : text; +} + +JSKitLib.createHiddenIframe = function(id, target, cb, clearOnload, src) { + clearOnload = (typeof clearOnload == 'undefined' ? true : !!clearOnload); + src = src || 'about:blank'; + target = target || document.body; + var d = document.createElement('div'); + d.style.height = 0; + d.innerHTML = ''; + target.appendChild(d); + var ifr = d.firstChild; + if (cb) { + ifr.onreadystatechange = function(e) { + if (ifr.readyState && ifr.readyState != 'loaded' && ifr.readyState != 'complete') return; + if (clearOnload) { + ifr.onreadystatechange = ifr.onload = null; + } + cb(); + }; + if (!JSKitLib.isOpera()) { + ifr.onload = ifr.onreadystatechange; + } + } + return ifr; +} + +JSKitLib.overlapSelectsIE = function(target) { + var container = document.createElement('div'); + container.innerHTML = ''; + target.appendChild(container.firstChild); +} + +JSKitLib.openPopup = function(url, extConfig){ + var target = '_blank'; + var config = { + 'width' : '960', + 'height' : '800', + 'status' : 'no', + 'menubar' : 'no', + 'toolbar' : 'no', + 'resizable' : 'no', + 'location' : 'yes', + 'scrollbars' : 'yes', + 'directories': 'no'}; + + JSKitLib.fmap(extConfig || [], function(value, key){ + if (key == 'target') target = value; else config[key] = value; + }); + + var calcScreenDimensions = function(){ + if (JSKitLib.isOpera()) { + var doc = (document.compatMode == "BackCompat") ? document.body : document.documentElement; + return {'width': doc.clientWidth, + 'height': doc.clientHeight}; + } + return {'width': screen.width, + 'height': screen.height}; + }; + + var calcCorrections = function() { + if (JSKitLib.isOpera()) return {'height': 35, 'width': 10, 'top' : 0}; + if (JSKitLib.isSafari() && !JSKitLib.isGChrome()) return {'height': 150, 'width': 0, 'top' : 100}; + return {'height': 0, 'width': 0, 'top' : 0}; + }; + + var screenDimensions = calcScreenDimensions(); + var corrections = calcCorrections(); + + if (config.height > screenDimensions.height - corrections.height) config.height = screenDimensions.height - corrections.height; + if (config.width > screenDimensions.width - corrections.width) config.width = screenDimensions.width - corrections.width; + + if (!(config.left && config.top) && config.width && config.height) { + config.left = Math.round((screenDimensions.width - config.width)/2); + config.top = Math.round((screenDimensions.height - corrections.top - config.height)/2); + } + + var params = JSKitLib.fmap(config, function(value, key) {return key + "=" + value;}).join(", "); + return window.open(url, target, params); +} + + + + + +JSKitLib.map = function(f, arr) { + if(arr) for(var i = 0; i < arr.length; i++) f(arr[i], i, arr); + return arr; +} + +JSKitLib.filter = function(f, arr) { + var newArr = []; + if(arr) + for(var i = 0; i < arr.length; i++) + if(f(arr[i], i, arr)) + newArr.push(arr[i]); + return newArr; +} + +JSKitLib.lookup = function(f, arr){ + return JSKitLib.filter(f, arr).shift(); +} + +JSKitLib.fmap = function(o,f) { + var r, a = [], l = o.length; + if(l > 0 || l === 0) + for(var i = 0; i < l; i++) { + r = f.call(this,o[i],i,arguments); + if(r !== undefined) a.push(r); + } + else + for(var i in o) + if(o.hasOwnProperty(i)) { + r = f.call(this,o[i],i,arguments); + if(r !== undefined) a.push(r); + } + return a; +} + +JSKitLib.foldl = function(acc,o,f) { + var r, l = o.length; + if(l > 0 || l === 0) + for(var i = 0; i < l; i++) { + r = f.call(this,o[i],acc,i); + if(r != undefined) acc = r; + } + else + for(var i in o) + if(o.hasOwnProperty(i)) { + r = f.call(this,o[i],acc,i); + if(r != undefined) acc = r; + } + return acc; +} + +JSKitLib.intersperse = function(f) { + return JSKitLib.foldl([], this, function(e, acc, i) { + if(acc.length) acc.push(f); + acc.push(e); + }); +} + +JSKitLib.merge = function() { + return Array.prototype.concat.apply([], arguments); +} + +JSKitLib.cloneObject = function(obj) { + return JSKitLib.foldl({}, obj, function(value, acc, key) { acc[key] = value; }); +} + + + + + +if (typeof JSKitLib.vars.windowOnLoadFired == 'undefined') { + JSKitLib.vars.windowOnLoadFired = false; + JSKitLib.addEventHandler(window, ['load'], function(){ JSKitLib.vars.windowOnLoadFired = true; }); +} + + + + + +var JSKitGlobal = function() { + + this._appAvailable = {}; + this._appObjects = {}; // Specific objects of an application type + this._appObjectActions = {}; // app.object.actions + + this.cachedPngs = {}; + + this._isAppAvailable = function(app) { + return (this._appAvailable[app]) ? true : false; + } + + this.isRatingsAppAvailable = function() { + return this._isAppAvailable('ratings'); + } + + this.isCommentsAppAvailable = function() { + return this._isAppAvailable('comments'); + } + + this._setAppAvailable = function(app) { + this._appAvailable[app] = true; + /* index this app */ + this.indexAppObjects(app); + /* execute any queued actions */ + this.executeAppObjectActions(app); + } + + this.setRatingsAppAvailable = function() { + this._setAppAvailable('ratings'); + } + + this.setCommentsAppAvailable = function() { + this._setAppAvailable('comments'); + } + + this.indexAppObjects = function(app) { + if (app == 'ratings') { + var appArray = $JRA; + } else if (app == 'comments') { + var appArray = $JCA; + } else { + alert('Attempt to index invalid app type'); + return; + } + for (var i=0; i < appArray.length; i++) { + // Check that it's not standalone + if (appArray[i].isStandalone()) { + continue; + } + var uniq = appArray[i].uniq; + if ( ! this._appObjects[uniq] ) { + this._appObjects[uniq] = {}; + } + if ( ! this._appObjects[uniq][app]) { + this._appObjects[uniq][app] = []; + } + this._appObjects[uniq][app].push(appArray[i]); + } + } + + this.executeAppObjectActions = function(app) { + if (this._appObjectActions[app]) { + for (var i=0; i < this._appObjectActions[app].length; i++) { + var uniq = this._appObjectActions[app][i].uniq; + if (this._getAppObject(app, uniq)) { + this._appObjectActions[app][i].action(); + } + } + } + } + + this._getAppObject = function(app, uniq) { + if (this._appObjects[uniq] && this._appObjects[uniq][app]) { + return this._appObjects[uniq][app][0]; // Return only the first + } + return null; + } + + this.getCommentsAppObject = function(uniq) { + return this._getAppObject('comments', uniq); + } + + /* Returns a Ratings Object */ + this.getRatingsAppObject = function(uniq) { + return this._getAppObject('ratings', uniq); + } + + this.copyRatingsAppObject = function(uniq, node) { + if ( ! this.isRatingsAppAvailable()) { + return; + } + var oldObj = this.getRatingsAppObject(uniq); + var newObj = oldObj.clone(node, { 'view':'user', 'commentprompt':'no', 'menu':'no' } ); + return newObj; + } + + this._tryAppObjectAction = function(app, uniq, action) { + if (this._isAppAvailable(app)) { + if (this._getAppObject(app, uniq)) { + action(); + } + } else { + if ( ! this._appObjectActions[app]) { + this._appObjectActions[app] = []; + } + this._appObjectActions[app].push( { 'uniq' : uniq, 'action' : action } ); + } + } + + this.tryRatingsAppObjectAction = function(uniq, action) { + this._tryAppObjectAction('ratings', uniq, action); + } + + this.tryCommentsAppObjectAction = function(uniq, action) { + this._tryAppObjectAction('comments', uniq, action); + } +} + +/* Singleton-like handler */ +JSKitGlobal.getInstance = function() { + if (!window.JSKitGlobalInstance) { + JSKitGlobalInstance = new JSKitGlobal(); + } + return JSKitGlobalInstance; +} + + + + + +/* JSKitGlobal object */ +$JSKitGlobal = JSKitGlobal.getInstance(); + + + + + +JSKitLib.getRef = function(self) { + var wl = window.location; + return wl.protocol + "//" + self.config.domain + wl.pathname; +} + +JSKitLib.readConfig = function(wtype, target, cf) { + cf = cf || {}; + var gtags = JSKitLib.parseConfigTags(document, wtype, 'span'); + var ltags = JSKitLib.parseConfigTags(target, '', 'span'); + var gc = window.JSKitConfig || {}; + for(var i = 3; i < arguments.length; i++) { + var arg = arguments[i]; + if(typeof(arg) == 'string') arg = [arg]; + var name = arg[0]; + var value = cf[name] || target.getAttribute(name) || ltags[name] + || gc[wtype + '-' + name] || gtags[name]; + var wl = window.location; + switch (name) { + case 'path': value = JSKitLib._normPath(target, value); break; + case 'permalink': + value = value || wl.href.replace(wl.hash,''); + if (!value.match(/^https?:\/\//)) + value = "http://" + wl.host + value.replace(/^([^\/]+)/, "/$1"); + break; + case 'title': value = value || document.title; break; + case 'domain': value = value || wl.host; break; + } + if(arg.length > 1) { + if(typeof(arg[1]) == 'number') { + if(value) { + var n = parseInt(value); + if(isNaN(n) || n < 0) { + if(value == "no") value = 0; + else value = arg[1]; + } else value = n; + } else value = arg[1]; + } else if(typeof(arg[1]) == 'object') { + for(var j=arg[1].length; j; j--) + if(arg[1][j-1] == value) break; + if(!j) value = arg[1][j]; + } else { + if(!value) value = arg[1]; + } + } + cf[name] = value; + } + return cf; +} + +JSKitLib.parseConfigTags = function(target, wtype, tag) { + var cache = document._widgets_config; + if (wtype && cache && cache[wtype]) + return cache[wtype]; + var regp = wtype ? wtype+'?-' : ''; + var nodes = target.getElementsByTagName(tag); + var config = {}; + for (var i = 0; i < nodes.length; i++) { + var reg = RegExp("^js-kit-config-"+regp+"(.*)$"); + var m = reg.exec(nodes[i].className); + if (m && m.length) { + config[m[1].toLowerCase()] = nodes[i].innerHTML; + nodes[i].style.display = 'none'; + } + } + if (wtype) { + document._widgets_config = document._widgets_config || {}; + document._widgets_config[wtype] = config; + } + return config; +} + +JSKitLib._normPath = function(target, path) { + var wl = window.location; + var uniq = String(target.getAttribute("uniq") || target.getAttribute("unique") || ''); + /* trim uniq */ + var uniq = uniq.replace(/^\s\s*/, ''), ws = /\s/, i = uniq.length; + while (ws.test(uniq.charAt(--i))); + uniq = uniq.slice(0, i + 1); + /* end of trim */ + var plus = true; + if (uniq) { + plus = uniq.match(/^\+\/*(.*)/); + if (plus) path = plus[1]; + else path = uniq; + } + if(path) { + path = String(path); + var ar = path.match(/^https?:\/\/[^\/]+(.*)/); + if(ar) path = ar[1]; + else path = path.replace(/^([^\/]+)/, (plus ? wl.pathname : "") + "/$1"); + path = path.replace(/^\/+/, "/"); + } else { path=wl.pathname; } + return path; +} + +JSKitLib.initWidgets = function(widget_type, request, constructor) { + var sendRequest = function(domain, multiParams, target) { + if (!multiParams.length) + return; + var wl = window.location; + request = request || {"extra_params": {}}; + var req = { + uri: request.base_uri, + ref: wl.protocol + "//" + domain + wl.pathname, + epb: window.JSKitEPB ? JSKitEPB.getAsHash() : {}, + request: request.extra_params, + variableRequest: multiParams, + transport: 'GET', + target: target, + trailer: request.trailer + }; + new JSRVC(req); + } + + var els = document.body.getElementsByTagName("div"); + if(!els || !els.length) + return; + + var multiI = {}; + var multiQ = {}; + var obj; + var reg = new RegExp('js-kit-' + widget_type + '?'); + for (var i = 0; i < els.length; i++) { + var m = reg.exec(els[i].className); + if (!m || !m.length || els[i].jsk$initialized) + continue; + + obj = constructor(els[i]); + els[i].jsk$initialized = true; + if (obj.config.disabled && obj.config.disabled != "no") continue; + var d = obj.config.domain; + + if (!multiQ[d]) { + multiQ[d] = []; + multiI[d] = 0; + } + multiQ[d].push(obj.singleRequestParams); + multiI[d]++; + } + JSKitLib.fmap(multiQ, function(v, k){ if (v) sendRequest(k, v, obj.target); }); +} + + + + + +JHI2 = {}; +JHI2.create = function(hint, element) { + element = element || JSKitLib.html(""); + element.origColor = element.style.color || 'black'; + element.hint = hint; + element.defaultRemoved = !!element.value; + if (!element.value) { + element.style.color = 'gray'; + element.value = element.hint; + } + element.onclick = function() { + if(JSKitLib.isIE()) { + window.focus(); + element.focus(); + } + return true; + } + element.onblur = function() { + if (!this.defaultRemoved || JSKitLib.trim(this.value) == '') { + this.defaultRemoved = false; + this.style.color = 'gray'; + this.value = this.hint; + } + } + element.onfocus = function() { + if (!this.defaultRemoved) { + this.defaultRemoved = true; + this.style.color = this.origColor; + this.value = ''; + } + } + return element; +} + +JHI2.set = function(element, value) { + if (element.onfocus) element.onfocus(); + element.value = value; +} + +JHI2.isEmpty = function(element) { + return (element.hint && !element.defaultRemoved || !element.hint && !element.value); +} + +JHI2.remove = function(element) { + if (!element || !element.hint) return; + element.onfocus(); + JSKitLib.fmap(['origColor', 'hint', 'defaultRemoved', 'onclick', 'onblur', 'onfocus'], function(v){ JSKitLib.deleteProperty(element, v); }); +} + + + + + +JSKitFBSDK.prototype.displayState = function(el) { + var s = this; + var d = function(id) { return document.getElementById(id+'-'+s.form_id); }; + JSKitLib.fmap(['wait','login','process'], + function(v) { + if (d(v)) d(v).style.display = (el==v) ? 'block' : 'none'; + } + ); +} + +JSKitFBSDK.prototype.processProfile = function() { + var s = this; + s.displayState('process'); + s.fetchUserInfo(['name', 'profile_url', 'pic_big', 'pic_square', 'pic_square_with_logo'], function(data){ + if(!data) { + s.processLoginStatus(); + } else { + var session = FB.getSession(); + var params = { + "profile_data" : JSKitLib.Object2JSON(data), + "access_token" : session.access_token, + "expires" : session.expires, + "api_key" : s.api_key, + "ref" : s.ref, + "rnd" : Math.random() + }; + var url = "http://js-kit.com/api/facebook/process_profile?" + + JSKitLib.fmap(params, function(value, key) { + return key + "=" + encodeURIComponent(value); + }).join("&"); + JSKitLib.addScript(url, s.target); + } + }); +} + +JSKitFBSDK.prototype.fetchUserInfo = function(flds, cb) { + var s = this; + var session = FB.getSession(); + if(!session) return(cb(undefined)); + FB.api({ + method: 'Users.getInfo', + session_key: session.session_key, + api_key: s.api_key, + sig: session.sig, + uids: [session.uid], + fields: flds, + v: "1.0"}, function(data){ + cb(data); + }); +} + +JSKitFBSDK.prototype.processLogin = function() { + var slf = this; + FB.login(function(r){ + if(r.session){ + slf.processLoginStatus(); + } else { + slf.displayState('login'); + } + }, {perms:'publish_stream'}); +} + +JSKitFBSDK.prototype.processLoginStatus = function() { + var s = this; + s.displayState('login'); + FB.getLoginStatus(function(response){ + if(response.session){ + s.processProfile(); + } else { + s.displayState('login'); + } + }, true); +} + +JSKitFBSDK.prototype.createHiddenContainer = function() { + var div = document.getElementById('fb-root'); + if (div) return div; + var div = JSKitLib.html('
    '); + document.body.insertBefore(div, document.body.firstChild); + return div; +} + +JSKitFBSDK.prototype.shareComment = function(whiteLabel) { + var s = this; + var sd = this.sharedata; + FB.getLoginStatus(function() { + var sess = FB.getSession(); + if(sess) { + s.fetchUserInfo(['name'], function(data) { + if(data && !data.error_code){ + var al = whiteLabel ? null : + [{'text': 'Visit JS-Kit', 'href': 'http://js-kit.com/'}]; + FB.api({ + method: 'stream.Publish', + session_key: sess.session_key, + api_key: s.api_key, + sig: sess.sig, + v: "1.0", + message: sd.Text, + attachment: { + 'name': data[0].name + ' participated in a discussion on ' + sd.domain, + 'href': sd.permalink}, + action_links: al + }); + } + }); + } else { + FB.login(function(r){ + if(r.session){ + s.shareComment(whiteLabel); + }}, {perms:'publish_stream'}); + } + }, true); +} + +JSKitFBSDK.prototype.init = function(cb) { + var s = this; + if(!s.api_key || !s.target) return; + window.jsk$fb_init = true; + var initFB = function() { + FB.init({ + appId: s.api_key, + status: false, + cookie: true, + xfbml: true + }); + if(cb) cb(); + }; + if(!window.FB || !FB.init) { + JSKitLib.addScript('http://connect.facebook.net/en_US/all.js', s.target, function() { initFB(); }); + } else { + initFB(); + } +} + +JSKitFBSDK.prototype.logout = function() { + FB.logout(); +} + +function JSKitFBSDK(ref, api_key, xd_receiver, cb, form_id, sharedata) { + this.ref = ref; + this.form_id = form_id; + this.target = this.createHiddenContainer(); + this.api_key = api_key; + this.xd_receiver = xd_receiver; + this.sharedata = sharedata; + var s = this; + var f = function() { + if (cb) cb.apply(s); + }; + if (window.jsk$fb_init) { + f(); + } else { + this.init(f); + } +} + +JSKitFBSDK.prototype.detectXD = function(target) { + // nothing to do +} + + + + + +JSKitGFC.prototype.init = function(cb) { + var s = this; + if(!s.site || !s.target) return; + window.jsk$gfc_init = true; + var initGFC = function() { + google.friendconnect.container.setParentUrl('/'); + google.friendconnect.container.loadOpenSocialApi({ + site: s.site, + onload: function(securityToken) { + window.jsk$gfc_token = securityToken; + if(cb) cb(); + } + }); + }; + if(!window.google || !window.opensocial) { + JSKitLib.addScript('http://www.google.com/friendconnect/script/friendconnect.js?key=notsupplied&v=0.8', s.target, function() { initGFC(); }); + } else { + initGFC(); + } +} + +JSKitGFC.prototype.processProfile = function(profileData) { + JSKitLib.addScript('//js-kit.com/api/google/process_profile?' + +'id='+encodeURIComponent(profileData.getId()) + +'&st='+encodeURIComponent(window.jsk$gfc_token) + +'&rnd='+Math.random(),this.target); + if(this.onready) this.onready(); +} + +JSKitGFC.prototype.displayState = function(el) { + var s = this; + var d = function(id) { return document.getElementById(id+'-'+s.tgt); }; + JSKitLib.fmap(['wait','login','process'], + function(v) { + d(v).style.display = (el==v) ? 'block' : 'none'; + } + ); +} + +JSKitGFC.prototype.getViewerData = function(success_cb, fail_cb) { + var onData = function(data) { + var vd = data.get("viewer_data"); + if (!vd.hadError() && vd.getData()) { + if(success_cb) success_cb(vd.getData()); + } else { + if(fail_cb) fail_cb(vd); + } + }; + var req = opensocial.newDataRequest(); + req.add(req.newFetchPersonRequest("VIEWER"), "viewer_data"); + req.send(onData); +} + +JSKitGFC.prototype.processLoginStatus = function() { + var s = this; + s.getViewerData(function(profileData){ + var processEl = document.getElementById('process-' + s.tgt); + if(processEl) processEl.innerHTML = $JCL("loggingIn") + profileData.getDisplayName() + '...'; + s.displayState('process'); + s.processProfile(profileData); + }, function() { + s.displayState('login'); + google.friendconnect.renderSignInButton({ 'id': 'login-' + s.tgt, 'text' : $JCL("loginWithGFC"), 'style': 'long' }); + }); +} + +JSKitGFC.prototype.shareComment = function() { + var s = this; + s.getViewerData(function(data){ + var sd = s.sharedata; + var UserName = data.getDisplayName(); + var params = {}; + params[opensocial.Activity.Field.TITLE] = UserName + $JCL("justPostedCommentOn") + ' ' + sd.domain + ''; + params[opensocial.Activity.Field.BODY] = ((sd.Text.length > 128) ? sd.Text.substr(0, 128) + '...' : sd.Text) + '

    ' + $JCL("poweredBy") + ' JS-Kit Echo'; + var activity = opensocial.newActivity(params); + opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH); + },function(){ + google.friendconnect.requestSignIn(); + }); +} + +JSKitGFC.prototype.processLogout = function() { + google.friendconnect.requestSignOut(); +} + +function JSKitGFC(ref, tgt, site, cb) { + this.ref = ref; + this.tgt = tgt; + this.site = site; + var s = this; + s.target = document.getElementById(s.tgt); + var f = function() { cb.apply(s); }; + if(window.jsk$gfc_init) { + f(); + } else { + this.init(f); + } +} + + + + + +if(!window.JSKitAuthInstance) var JSKitAuthInstance = null; + +$JALT = { + //Authentication methods labels: + identityLabel_short_epb: "EPB", + identityLabel_short_gfc: "Google Friend Connect", + identityLabel_short_home: "My Site", + identityLabel_short_jskit: "JS-Kit", + identityLabel_short_yahoo: "Yahoo!", + identityLabel_short_openid: "Openid", + identityLabel_short_twitter: "Twitter", + identityLabel_short_haloscan: "Haloscan", + identityLabel_short_blogspot: "Blogger", + identityLabel_short_facebook: "Facebook", + identityLabel_short_friendfeed: "FriendFeed", + + identityLabel_full_epb: "My EPB Account", + identityLabel_full_gfc: "My Google Profile", + identityLabel_full_jskit: "My JS-Kit Account", + identityLabel_full_yahoo: "My Yahoo! Account", + identityLabel_full_openid: "My OpenID", + identityLabel_full_twitter: "My Twitter Account", + identityLabel_full_haloscan: "My Haloscan Account", + identityLabel_full_blogspot: "My Blogger Account", + identityLabel_full_facebook: "My Facebook Profile", + identityLabel_full_register: "New JS-Kit Account", + identityLabel_full_friendfeed: "My FriendFeed Account", + + //Error messages: + error: 'Error', + no_email: 'Email not found for this account', + long_login: 'Login is too long (should be not more 63 characters)', + empty_login: 'Enter your login', + empty_email: 'Enter your e-mail', + short_login: 'Login is too short (should be at least 6 characters)', + cookies_are_disabled: 'Unfortunately authentication is not available for you because the cookies are disabled in your browser. Please enable cookies and retry', + empty_openid: 'Enter your OpenID URL', + empty_blogspot: 'Enter your Blogspot URL', + empty_password: 'Enter your password', + empty_password2: 'Enter your password', + incorrect_login: 'Login must begin with a letter and contain 6 or more characters, including numbers, a dash and a dot.', + incorrect_email: 'Your email is incorrect, please check it', + full_description: 'JS-Kit login need to start with a letter and may also contain numbers, a dash and a dot. Login and password must have a minimum of 6 characters. Example of a good login name: Joe.Bloggs', + nonexisting_login: 'Login does not exist ', + password_is_short: 'Password is too short (should be at least 6 characters)', + user_already_logged: 'You are already signed in with this login', + incorrect_recovery_key: 'Incorrect recovery key', + login_is_already_used: 'Login name is already taken by someone else', + incorrect_blogspot_url: 'Your Blogspot URL doesn\'t seem to be valid', + incorrect_login_or_password: 'Login or password is incorrect', + user_already_has_other_login: 'You are logged in already', + password2_mismatch: 'Passwords do not match', + //Common labels + authentication: 'Authentication', + passwordRecovery_jskit: 'JS-Kit Password Recovery', + passwordRecovery_haloscan: 'Haloscan Password Recovery', + enterYourLoginNote: 'Enter your login you registered with below and click "Send Password". Then check your email (Inbox or SPAM folder).', + forgotYourPassword: 'forgot your password?', + registerNewAccount: 'register a new account?', + sendPassword: 'Send Password', + authCode: 'Auth Code', + jskaLogout: 'Logout', + submit: 'Submit', + back: 'Back', + login: 'Login', + username: 'Username', + loginWith: 'Login with:', + loginBtn: 'Login', + register: 'Register', + openID: 'OpenID:', + password: 'Password:', + retypePassword: 'Re-type Password:', + loginWith: 'Login with:', + cancel: 'Cancel', + loading: 'Loading ...', + allFieldsAreMandatory: 'All fields are mandatory', + yourEmail: 'Your Email', + blogspotUrl: 'Blogspot URL:', + //EPB + epb_LoginOrRegisterInHostSiteText: 'Please login or register on this site' +} +$JAL = window.JSKA_Translate || function(t) { return (window.JSKitLabels && window.JSKitLabels[t]) || $JALT[t] || t; } + +JSKAuth.prototype.getIdentityLabel = function(type, isfull){ + return $JAL("identityLabel_" + (isfull ? "full_" : "short_") + type); +} + +JSKAuth.prototype.setAuthInstance = function() { + if (window.JSKitAuthInstance) { + var authForm = JSKitAuthInstance.authForm; + if(authForm && authForm.parentNode) + JSKitLib.hide(authForm); + } + JSKitAuthInstance = this; +} + +JSKAuth.prototype.show = function(areaName, data) { + areaName = areaName || this.defaultActiveArea; + this.setAuthInstance(); + this.showBackdrop(); + var authForm = this.authForm; + if (this.mode == "popup") { + var pos = JSKitLib.calcCenterPos(300, 200); + authForm.style.top = parseInt(pos[1]) + "px"; + authForm.style.left = parseInt(pos[0]) + "px"; + } + JSKitLib.show(authForm); + this.authSelector.value = areaName; + this.setActiveArea(areaName, data); +} + +JSKAuth.prototype.loadCss = function() { + JSKitLib.addCss( + ".jska-backdrop { opacity: 0; background-color: #404040; z-Index: 14500; " + + (JSKitLib.isPreIE8() + ? "filter:progid:DXImageTransform.Microsoft.Alpha(opacity='0'); position: absolute; top: expression(eval(-(document.body.offsetTop + (document.body.offsetHeight - document.body.clientHeight)/2))); left: expression(eval(-(document.body.offsetLeft + (document.body.offsetWidth - document.body.clientWidth)/2))); height: expression(eval(Math.max(document.body.offsetHeight, document.documentElement.scrollHeight))); width: expression(eval(Math.max(document.body.offsetWidth, document.documentElement.scrollWidth)));" + : "position: fixed; left: 0; top: 0; height: 100%; width: 100%; -webkit-transition: opacity 0.5s ease-out;" ) + + "}" + + ".jska-wrapper { " + (this.mode != "embedded" ? "position: absolute;" : "") + "background-color: white; z-index: 20000; border: solid 4px #cbcbcb; text-align: left; width: 350px; font-weight: normal; }" + + ".jska-facebookFrame { height: 27px; width: 194px; background-color: transparent; border: none; z-Index: 14000; }" + + ".jska-yahoo { margin-left: auto; margin-right: auto; width:161px; height:22px; cursor:pointer; }" + + ".jska-twitter { margin-left: auto; margin-right: auto; width:176px; height:28px; cursor:pointer; }" + + ".jska-friendfeed { margin-left: auto; margin-right: auto; width:216px; height:28px; cursor:pointer; }" + + ".jska-selector { margin-left: 5px;}" + + ".jska-header { background-color: #ececec; padding: 8px 0 6px 10px; }" + + ".jska-headerText { font-family: Verdana, Helvetica; font-weight: bold; font-size: 12pt; color: grey; float: left; }" + + ".jska-infoText { margin: 0; padding: 0;}" + + ".jska-infoContainer { margin: 0 10px;}" + + ".jska-showMore { color: #403030; font-family: Arial, Helvetica, sans-serif; }" + + ".jska-selectorContainer { background-color: #ececec; padding: 0 0 4px 10px;}" + + ".jska-container { border-top: solid 1px #cbcbcb; padding-top: 20px;}" + + ".jska-controls { background-color: #ececec; width: 100%; padding: 5px 0 5px 0; margin-top: 20px;}" + + ".jska-rightColumn { float: right; width: 65%; margin-bottom: 2px;}" + + ".jska-leftColumn { float: right; width: 33%; padding: 2px 5px 0 0; text-align: right;}" + + ".jska-label { font-size: 9pt; font-family: Arial; color: #000000 !important; }" + + ".jska-input { border: solid 1px #7f99b9; width: 80%;}" + + ".jska-openidInput { background: url(//cdn.js-kit.com/images/openid-16x16.png) no-repeat; background-position: 0 50%; padding-left: 18px;}" + + ".jska-blogspotInput { background: url(//cdn.js-kit.com/images/blogger-16x16.png) no-repeat; background-position: 0 50%; padding-left: 18px;}" + + ".jska-errorText { color: #FF3030; font: 11px Arial; margin-bottom: 2px; }" + + ".jska-error { color: #FF3030; font: 11px Arial; display: none; }" + + ".jska-cancelBtn { float: right; margin-right: 5px; cursor: pointer;}" + + ".jska-text { color: #404040; font: 11px Arial; }" + + ".jska-back { font: 15px Helvetica; cursor: pointer; margin-left: 10px; float: left;}" + + ".jska-logout { float: left; margin-left: 10px; cursor: pointer;}" + + ".jska-passwordRecoveryText { margin: 0px 0px 5px 10px; }" + + ".jska-links, a.jska-links:hover, a.jska-links:visited { color: #001faa; cursor: pointer; }" + + ".jska-progressArea { display: none; }" + + ".jska-progressPic { display: inline; float: left; margin-right: 0.2em; margin-left: 1em; margin-top: 0.3em; width: 16px; height: 16px; background: no-repeat url(//cdn.js-kit.com/images/loading.gif); }" + + ".jska-progressLbl { display: inline; margin-left: 0.3em; margin-top: 0.5em; float: left; }" + + ".jska-authButton {float: right; margin-right: 7px; cursor: pointer;}" + + ".jska-clear { clear: both;}", "jska"); +} + +JSKAuth.prototype.cancelRequests = function(){ + var self = this; + JSKitLib.fmap(this.identities.auth, function(identity){ + if(identity.group != "third_party") return; + if(self.areas && self.areas[identity.type] && self.areas[identity.type].rpickup) { + try{ self.areas[identity.type].rpickup.cancelRequest(); } + catch(e){}; + } + }); +} + +JSKAuth.prototype.hide = function() { + this.hideBackdrop(); + this.cancelRequests(); + JSKitLib.hide(this.authForm); +} + +JSKAuth.prototype.destroy = function() { + this.hide(); + var prn = this.authForm.parentNode; + if (prn) prn.removeChild(this.authForm); +} + +JSKAuth.prototype.prepareAuthForm = function() { + var self = this; + var div = self.authForm; + JSKitLib.hide(div); + if (self.mode == "popup"){ + document.body.insertBefore(div, document.body.firstChild); + } else { + self.target.appendChild(div); + } +} + +JSKAuth.prototype.showBackdrop = function() { + if (this.withBackdrop && this.mode == "popup") { + if(!window.backdrop) { + window.backdrop = document.createElement('DIV'); + backdrop.className = 'jska-backdrop'; + document.body.insertBefore(backdrop, document.body.firstChild); + } + JSKitLib.show(backdrop); + JSKitLib.setOpacity(backdrop, 0.5); + } +} + +JSKAuth.prototype.hideBackdrop = function() { + if (this.withBackdrop && window.backdrop){ + JSKitLib.setOpacity(backdrop, 0); + JSKitLib.hide(backdrop); + } +} + +JSKAuth.prototype.assemble = function() { + var self = this; + var authForm = self.toDom(self.authFormTmpl); + var authFormElements = JSKitLib.mapClass2Object({}, authForm); + authForm.dragElements = [authFormElements["jska-header"]]; + + self.areaContainer = authFormElements["jska-container"]; + self.selectorContainer = authFormElements["jska-selectorContainer"]; + + self.authSelector = self.createAuthSelector(self.defaultActiveArea, function(ev){ self.setActiveArea(this.value); }); + authFormElements["jska-selectorContainer"].appendChild(self.authSelector); + + return authForm; +} + +JSKAuth.prototype.createRVCPickupRequest = function(provider, target, area) { + var self = this; + var params = { + 'session_nonce': ((new Date()).valueOf() + Math.random()).toString() + }; + + return new JSRVC({ + 'uri': self.uriDomain + '/api/server-answer.js', + 'ref': self.ref, + 'request': params, + 'target': target, + 'pickup': true, + 'epb': window.JSKitEPB ? JSKitEPB.getAsHash() : {}, + 'onreturn': function (error) + { + if (error == "attempts_number_exceeded") + { + if (provider == "jskit" || provider == "haloscan" || provider == "register") + { + try + { + if (window['JSKitAuthInstance']) window['JSKitAuthInstance'].serverCallback(provider, 'cookies_are_disabled'); + } catch(e){} + }else + { + var areaElements = JSKitLib.mapClass2Object({}, area); + areaElements["js-errorMessageHandle"].innerHTML = $JAL('cookies_are_disabled'); + areaElements["js-errorMessageHandle"].style.display = 'block'; + } + } + }, + 'requestId': provider + '_connect'}); +} + +JSKAuth.prototype.setActiveArea = function(name, data){ + var self = this; + self.cancelRequests(); + self.currentArea = name; + if (name.match(/passwordRecovery/)) JSKitLib.hide(self.selectorContainer); else JSKitLib.show(self.selectorContainer); + JSKitLib.removeChildren(self.areaContainer); + self.areas[name] = self.createArea(name, data); + self.areaContainer.appendChild(self.areas[name]); + if (self.HNDL && self.HNDL[name] && self.HNDL[name]["input"] && self.HNDL[name]["input"].login){ + self.HNDL[name]["input"].login.blur(); + self.HNDL[name]["input"].login.focus(); + } + + if (name == "yahoo"){ self.areas["yahoo"].rpickup = self.createRVCPickupRequest("yahoo", self.target, self.areas["yahoo"]); } + if (name == "gfc"){ + var gfc_cb = function() { + self.areas["gfc"].rpickup = self.createRVCPickupRequest("gfc", self.target, self.areas["gfc"]); + }; + var gfc = self.getAuthIdentity("gfc"); + if(gfc && gfc.params.site) { + var jsk$gfc = new JSKitGFC( + self.ref, + self.areas["gfc"].id, + gfc.params.site, + function(){ + this.onready = gfc_cb(); + this.processLoginStatus(); + }); + } else { + gfc_cb(); + } + } + if (name == "twitter"){ self.areas["twitter"].rpickup = self.createRVCPickupRequest("twitter", self.target, self.areas["twitter"]); } + if (name == "friendfeed"){ self.areas["friendfeed"].rpickup = self.createRVCPickupRequest("friendfeed", self.target, self.areas["friendfeed"]); } + if (name == "facebook" && self.getAuthIdentity("facebook")) { + var facebook = self.getAuthIdentity("facebook"); + var jsk$fb = new JSKitFBSDK( + self.ref, + facebook.params.app_id, + facebook.params.xd_receiver, + function() { + this.processLoginStatus(); + self.areas["facebook"].rpickup = self.createRVCPickupRequest("facebook", self.target, self.areas["facebook"]); + }, + self.areas["facebook"].id + ); + + var logel = document.getElementById('login-' + self.areas["facebook"].id); + logel.onclick = function() { jsk$fb.processLogin(); }; + } +} + +JSKAuth.prototype.getErrorTarget = function(errCode) { + if (errCode.match(/no_email/)) return "login"; + if (errCode.match(/email/)) return "email"; + if (errCode.match(/password2/)) return "password2"; + if (errCode.match(/password/)) return "password"; + return "login"; +} + +JSKAuth.prototype.processControls = function(name, type, func){ + JSKitLib.fmap(this.HNDL[name][type], func); +} + +JSKAuth.prototype.addKeyHandler = function(name) { + var self = this; + var button = self.HNDL[name]["button"].button; + this.processControls(name, "input", function(element){ if (element) { + if(JSKitLib.isIE() || JSKitLib.isOpera()) element.onkeydown = function(ev) { return self.keyHandler(ev, button);} + else element.onkeypress = function(ev) { return self.keyHandler(ev, button);} + }}); +} + +JSKAuth.prototype.hideMessages = function(name) { + this.processControls(name, "message", function(element){ if (element) JSKitLib.hide(element); }); +} + +JSKAuth.prototype.disableControls = function(name, value) { + JSKitLib.fmap.call(this, ["input", "button"], function(type){ this.processControls(name, type, function(element){ if (element) element.disabled = value; })}); +} + +JSKAuth.prototype.clearInputFields = function(name) { + this.processControls(name, "input", function(element){ if (element) { element.value = ""; if (typeof(element.onblur) == "function") element.onblur(); } }); +} + +JSKAuth.prototype.toDom = function(template) { + return JSKitLib.html(template.replace(/{Label:([^:}]+[^}]*)}/g, function(a,m) { + return $JAL(m); + })); +} + +JSKAuth.prototype.autoComplete = (JSKitLib.getBrowser() == 'gecko' ? ' autocomplete="Off"' : ''); + +JSKAuth.prototype.keyHandler = function(e, button){ + e = e || window.event; + switch(e.keyCode) { + case 10: case 13: + JSKitLib.preventDefaultEvent(e); + button.click(); + break; + } +} + +JSKAuth.prototype.getIdentityParam = function(name, identity, defaultValue) { + return (identity.type == 'epb' && identity.params[name]) ? + identity.params[name] : + defaultValue; +} + + +JSKAuth.prototype.authFormTmpl = +'
    ' + + '
    ' + + '
    {Label:authentication}
    ' + + '
    ' + + '
    ' + + '
    {Label:loginWith}
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.progressAreaTmpl = +'
    ' + + '
    ' + + '
    {Label:loading}
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.loginSectionTmpl = function(identity_type) { + return '
    ' + JSKAuth.prototype.progressAreaTmpl + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:username}:
    ' + + '
    ' + + '' + + '
    ' + + '' + + '
    ' + + '
    {Label:password}
    ' + + '
    ' + + '
    ' + + '' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    '; +} + +JSKAuth.prototype.jskitSectionTmpl = JSKAuth.prototype.loginSectionTmpl('jskit'); +JSKAuth.prototype.haloscanSectionTmpl = JSKAuth.prototype.loginSectionTmpl('haloscan'); + +JSKAuth.prototype.openidSectionTmpl = +'
    ' + JSKAuth.prototype.progressAreaTmpl + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:openID}
    ' + + '
    ' + + '
    ' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.blogspotSectionTmpl = +'
    ' + JSKAuth.prototype.progressAreaTmpl + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:blogspotUrl}
    ' + + '
    ' + + '
    ' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.yahooSectionTmpl = +'
    ' + +'
    ' + +'
    ' + +'
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.twitterSectionTmpl = +'
    ' + +'
    ' + +'
    ' + +'
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.friendfeedSectionTmpl = +'
    ' + +'
    ' + +'
    ' + +'
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.epbSectionTmpl = function() { + var epb = this.identities.auth.epb; + var auth_prompt = JSKAuth.prototype.getIdentityParam('auth_prompt', epb, '{Label:epb_LoginOrRegisterInHostSiteText}'); + var template = +'
    ' + + '

    ' + auth_prompt + '

    ' + + '
    ' + + '' + + '
    ' + + '
    ' + +'
    '; + return template; +} + +JSKAuth.prototype.facebookSectionTmpl = function() { + var tgt = "facebook-" + Math.random(); + return ('
    ' + +'
    ' + +'
    ' + +'
    ' + $JCL("askingFacebook") + '
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + +'
    '); +} + +JSKAuth.prototype.gfcSectionTmpl = function() { + var gfc = this.identities.auth.gfc; + var tgt = "gfc-" + Math.random(); +return '
    ' + +'
    ' + +'
    ' + +(gfc && gfc.params.site ? '
    ' + $JCL("askingGoogle") + '
    ' : +'
    ')+ + '
    ' + + '' + + '' + + '
    ' + + '
    ' + +'
    '; +} + +JSKAuth.prototype.registerSectionTmpl = +'
    ' + JSKAuth.prototype.progressAreaTmpl + + '

    {Label:allFieldsAreMandatory}

    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:username}:
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:yourEmail}:
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:password}
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:retypePassword}
    ' + + '
    ' + + '
    ' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + +'
    '; + +JSKAuth.prototype.passwordRecoveryRequestSectionTmpl = function(params) { + return '
    ' + + '

    {Label:passwordRecovery_'+params.provider+'}

    ' + + JSKAuth.prototype.progressAreaTmpl + + '

    {Label:enterYourLoginNote}

    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:username}:
    ' + + '
    ' + + '
    ' + + '{Label:back}' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    '; +} + +JSKAuth.prototype.passwordRecoverySetPasswordSectionTmpl = function(params) { + return '
    ' + + '

    {Label:passwordRecovery_'+params.provider+'}

    ' + + JSKAuth.prototype.progressAreaTmpl + + '

    Please enter the new password

    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:username}:
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:authCode}:
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:password}
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    {Label:retypePassword}
    ' + + '
    ' + + '
    ' + + '{Label:back}' + + '' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    '; +} + +JSKAuth.prototype.passwordRecoverySuccessSectionTmpl = function(params) { + return '
    ' + + '
    ' + + '

    {Label:passwordRecovery_'+params.provider+'}

    ' + + '

    New password was set successfully.

    ' + + 'Click here to log in' + + '
    ' + + '
    ' + + '{Label:back}' + + '' + + '
    ' + + '
    ' + + '
    '; +} + +JSKAuth.prototype.processMessage = function(name, errCode, data) { + if(errCode=='success') { + this.disableControls(name, false); + this.clearInputFields(name); + switch (name) { + case "passwordRecoveryRequest" : this.show("passwordRecoverySetPassword", this.passwordRecoveryData);break; + case "passwordRecoverySetPassword" : this.show("passwordRecoverySuccess", this.passwordRecoveryData); break; + default : if (window.JSKW$Events) JSKW$Events.syncBroadcast('JSKitAuth_success_login', data); if (this.mode != "embedded") this.hide(); + } + } else { + this.showErrorMessage(name, errCode); + } +} + +JSKAuth.prototype.showErrorMessage = function(name, errCode){ + JSKitLib.hide(this.HNDL[name].progress); + this.disableControls(name, false); + var errorTarget = this.getErrorTarget(errCode); + if(errorTarget) { + var inputHandle = this.HNDL[name]["input"][errorTarget]; + var errorMessageHandle = this.HNDL[name]["message"][errorTarget + "Msg"]; + if (inputHandle) {inputHandle.blur(); inputHandle.focus();} + if (errorMessageHandle) { + errorMessageHandle.innerHTML = $JAL(errCode); + if (name == "register" && errorTarget != "email") errorMessageHandle.appendChild(this.buildShowMore()); + errorMessageHandle.style.display = 'block'; + } + } +} + +JSKAuth.prototype.serverCallback = function(type, errCode, data) { + if (this.HNDL && this.HNDL[type]) JSKitLib.hide(this.HNDL[type].progress) + if (type == "register" && data && data.yours) data.yours.newUser = true; + this.processMessage(type, errCode, data); +} + +JSKAuth.prototype.logout = function() { + var self = this; + setTimeout(function(){ + new JSRVC({uri: self.uriDomain + '/api/session/logout.js', 'target': self.target, request: {}}); + }, 0); +} + +JSKAuth.prototype.createArea = function(name, data) { + var self = this; + var sectionTmpl = self[name + "SectionTmpl"]; + var area = self.toDom(typeof(sectionTmpl) == "function" ? sectionTmpl.apply(self, [data]) : sectionTmpl); + var areaElements = JSKitLib.mapClass2Object({}, area); + + var bindOnclick = function(element, func){ + if (element) element.onclick = function(){ func(); return false; } + } + + if (self.mode != "embedded") bindOnclick(areaElements["jska-cancelBtn"], function(){ self.hide(); }) + else JSKitLib.hide(areaElements["jska-cancelBtn"]); + + bindOnclick(areaElements["jska-logout"], function(){ self.logout(); self.hide();}); + if (areaElements["jska-logout"] && (!self.loginStatus || JSKitEPB.isExists())) { + JSKitLib.hide(areaElements["jska-logout"]); + } + + bindOnclick(areaElements["jska-forgotPassword"], function(){ self.show("passwordRecoveryRequest", {'provider': name}) }); + bindOnclick(areaElements["jska-linkToLogin"], function(){ self.show(data.provider) }); + if (name.match(/passwordRecovery/)) { + bindOnclick(areaElements["jska-back"], function(){ self.show(data.provider) }); + } + + bindOnclick(areaElements["jska-yahoo"], function(){ JSKitLib.openPopup(self.uriDomain + '/api/oauth/yahoo.html?ref='+encodeURIComponent(self.ref), {height: "450", width: "600", scrollbars: "no"}); }); + bindOnclick(areaElements["jska-twitter"], function(){ JSKitLib.openPopup(self.uriDomain + '/api/oauth/twitter.html?ref='+encodeURIComponent(self.ref), {height: "435", width: "800", scrollbars: "no"}); }); + bindOnclick(areaElements["jska-friendfeed"], function(){ JSKitLib.openPopup(self.uriDomain + '/api/oauth/friendfeed.html?ref='+encodeURIComponent(self.ref), {height: "435", width: "800", scrollbars: "no"}); }); + if (areaElements["jska-yahoo"]) JSKitLib.addPNG(areaElements["jska-yahoo"], "//cdn.js-kit.com/images/yahoo/yos.png"); + if (areaElements["jska-twitter"]) JSKitLib.addPNG(areaElements["jska-twitter"], "//cdn.js-kit.com/images/twitter/twitter.png"); + if (areaElements["jska-friendfeed"]) JSKitLib.addPNG(areaElements["jska-friendfeed"], "//cdn.js-kit.com/images/friendfeed/friendfeed.png"); + var identity = this.getAuthIdentity(name); + if (identity && identity.group == "third_party") return area; + + var createAction = function(type){ + return function(){ + var error = undefined; + var params = { + login: self.HNDL[type]["input"].login.value, + password: self.HNDL[type]["input"].password.value, + type: type}; + if (self.loginReturnUrl) params["returnUrl"] = self.loginReturnUrl; + if (type == "register") { + params["retype_password"] = self.HNDL["register"]["input"].password2.value; + params["email"] = self.HNDL["register"]["input"].email.value; + params["version"] = "1"; + if (self.registerReturnUrl) { + params["returnUrl"] = self.registerReturnUrl; + } + } + if (params['login'].length < 1 || !self.HNDL[type]["input"].login.defaultRemoved) error = 'empty_login'; + if (!error && type == "register" && params['email'].length < 1) error = 'empty_email'; + if (!error && params['password'].length < 1) error = 'empty_password'; + if (!error && type == "register" && params['retype_password'].length<1) error = 'empty_password2'; + if (error) { self.showErrorMessage(type, error); return false; }; + var scripts = {"register" : "/user-registration", "jskit" : "/user-login", "haloscan" : "/user-haloscan-login"}; + new JSRVC({ + 'uri': self.uriDomain + scripts[type], + 'transport': "POST", + 'target': self.target, + 'ref': self.ref, + 'request': params, + 'requestId': type + '_connect', + 'onreturn': function () { + area.rpickup = self.createRVCPickupRequest(type, self.target) + }, + 'epb': window.JSKitEPB ? JSKitEPB.getAsHash() : {} + }); + } + }; + + var createOpenidAction = function(type){ + return function(){ + var random = function() {return Math.floor(Math.random() * 10000000000);}; + var PPID = 'prfl_' + random() + '-' + random() + '-' + random(); + var params = { jsktid: PPID}; + if (type == "blogspot") params.provider = "blogspot"; + if (self.mode == "popup" && self.LoginWindow && !self.LoginWindow.closed) { + self.LoginWindow.focus(); + new JSRVC({uri: self.uriDomain + '/openid-auth-prolongate', 'target': self.target, request: params}); + return false; + } + var OpenID = self.HNDL[type]["input"].login; + if(OpenID.value.length < 1 || !OpenID.defaultRemoved) { + self.showErrorMessage(type, 'empty_' + type); + return false; + } + if(type == "blogspot" && !OpenID.value.match(/\.blogspot\.com\/?$/)) { + self.showErrorMessage(type, 'incorrect_blogspot_url'); + return false; + } + var AuthUrl = self.uriDomain + '/settings/auth.cgi?openid_url=' + OpenID.value; + if (self.mode == "popup") { + new JSRVC({uri: self.uriDomain + '/openid-auth-wait-for-completion', 'target': self.target, request: params}); + self.LoginWindow = JSKitLib.openPopup(AuthUrl + '&action=prfl&jsktid=' + PPID); + } else { + window.location = AuthUrl + '&action=prfl' + (self.loginReturnUrl ? ("&returnUrl=" + self.loginReturnUrl) : ""); + } + } + } + + var constructPasswordRecoveryRequest = function(){ + return function(){ + var loginInputBox = self.HNDL["passwordRecoveryRequest"]["input"].login; + var provider = self.HNDL["passwordRecoveryRequest"]["input"].provider.value; + if (loginInputBox.value.length < 1 || !loginInputBox.defaultRemoved) { + self.showErrorMessage('passwordRecoveryRequest', 'empty_login'); + } else { + self.passwordRecoveryData["login"] = loginInputBox.value; + self.passwordRecoveryData["provider"] = provider; + new JSRVC({uri: self.uriDomain + '/user-password-recovery', 'target': self.target, request: {login: loginInputBox.value, provider: provider}}); + } + } + } + + + var constructPasswordRecoverySetPassword = function(){ + return function(){ + var inputCollection = self.HNDL["passwordRecoverySetPassword"]["input"] + var provider = self.HNDL["passwordRecoverySetPassword"]["input"].provider.value; + var params = { + step: "set-password", + provider: provider, + login: inputCollection.login.value, + key: JSKitLib.trim(inputCollection.authCode.value), + password: inputCollection.password.value, + retype_password: inputCollection.password2.value + } + new JSRVC({uri: self.uriDomain + '/user-password-recovery', 'target': self.target, request: params}); + } + } + + var specificSubmitActions = { + jskit : createAction("jskit"), + openid : createOpenidAction("openid"), + blogspot : createOpenidAction("blogspot"), + haloscan : createAction("haloscan"), + register: createAction("register"), + passwordRecoveryRequest : constructPasswordRecoveryRequest(), + passwordRecoverySetPassword : constructPasswordRecoverySetPassword() + }; + + var submitAction = function() { + self.hideMessages(name); + self.disableControls(name, true); + self.HNDL[name].progress.style.display = "inline"; + specificSubmitActions[name].call(self); + return false; + }; + + if (!self.HNDL) self.HNDL = []; + self.HNDL[name] = { + progress : areaElements['js-progressHandle'], + container : area, + button : + {button : areaElements["authButton"]}, + message : + {loginMsg : areaElements["js-loginMessageHandle"], + emailMsg : areaElements["js-emailMessageHandle"], + passwordMsg : areaElements["js-passwordMessageHandle"], + password2Msg : areaElements["js-password2MessageHandle"]}, + input : + {login : areaElements["loginInput"], + authCode : areaElements["authCodeInput"], + email: areaElements["emailInput"], + password : areaElements["passwordInput"], + password2 : areaElements["password2Input"], + provider : areaElements["provider"]} + }; + + if (name != "passwordRecoverySetPassword") JHI2.create( (name == "openid" ? "http://user.myopenid.com" : (name == "blogspot" ? "http://yourblog.blogspot.com" : "Joe.Bloggs")), self.HNDL[name]["input"].login); + + data = data || {}; + if (name == "jskit" || name == "haloscan") + data.provider = name; + JSKitLib.fmap(data, function(value, key){ + if (self.HNDL[name]["input"][key]) + self.HNDL[name]["input"][key].value = value; + }); + bindOnclick(self.HNDL[name]["button"].button, submitAction); + self.addKeyHandler(name); + return area; +} + +JSKAuth.prototype.buildShowMore = function() { + var template = + ' (' + + 'Learn more...)' + + '' + ''; + + var span = this.toDom(template); + var handlers = JSKitLib.mapClass2Object({}, span); + + var fullDescLink = handlers['js-fullDescLink']; + var fullDescDiv = handlers['js-fullDescDiv']; + fullDescLink.onclick = function(ev){ + JSKitLib.stopEventPropagation(ev); + fullDescLink.innerHTML = this.visFullDesc ? 'Learn more...' : 'Hide'; + fullDescDiv.style.display = this.visFullDesc ? 'none' : ''; + this.visFullDesc = !this.visFullDesc; + return false; + } + return span; +} + +JSKAuth.prototype.createAuthSelector = function(selected, onchange, includeUserName) { + var authSelector = this.toDom( + ''); + authSelector.onchange = onchange; + return authSelector; +} + +JSKAuth.prototype.getAuthOptions = function(includeUserName) { + var s = this; + var calcLogin = function() { + var identities = s.getAuthenticatedIdentities(); + var firstLoggedIdentity = identities.length ? identities.shift() : undefined; + return firstLoggedIdentity + ? (firstLoggedIdentity.name || firstLoggedIdentity.user) + ' @ ' + + JSKAuth.prototype.getIdentityLabel(firstLoggedIdentity.type) + : undefined; + } + + var authOptions = {}; + var login = calcLogin(); + if (includeUserName) { + authOptions = login + ? {"opt-user": login} + : {"opt-anonymous": $JCL('guest')}; + } + JSKitLib.fmap(s.identities.auth, function(v, k) { + authOptions[k] = JSKAuth.prototype.getIdentityParam('long_label', v, JSKAuth.prototype.getIdentityLabel(k, true)); + }); + return authOptions; +} + +JSKAuth.prototype.isLogged = function() { + var self = this; + if (this.loginStatus === undefined) { + JSKitLib.fmap(this.identities.auth, function(identity, type) { + if (!self.loginStatus) self.loginStatus = !!identity.user; + }); + this.loginStatus = JSKitEPB.isExists() || this.loginStatus; + } + return this.loginStatus; +} + +JSKAuth.prototype.isAvailable = function(type) { + return !!this.identities.auth[type]; +} + +JSKAuth.prototype.assembleIdentity = function(url, type, group) { + var identity = this.getAuthIdentity(type); + return { + "url": url, + "type": type, + "group": group, + "use_as_from": true, + "params": identity && identity.params || {} + }; +} + +JSKAuth.prototype.appendIdentity = function(identity) { + if (identity.group == "web") { + this.identities.web.push(identity); + } else { + this.identities.auth[identity.type] = identity; + } +} + +JSKAuth.prototype.getAuthIdentity = function(type) { + return this.identities.auth[type]; +} + +JSKAuth.prototype.getIdentities = function(group) { + return group ? this.identities[group] : this.identities; +} + +JSKAuth.prototype.getAuthenticatedIdentities = function() { + return JSKitLib.fmap(this.getIdentities("auth"), function(identity) { + if (identity.user) return identity; + }); +} + +JSKAuth.prototype.getFirstAuthIdentity = function() { + var identities = this.getIdentities("auth"); + for (var key in identities) { + if (identities.hasOwnProperty(key)) return identities[key]; + } +} + +JSKAuth.prototype.readIdentities = function(identities) { + identities = identities || []; + return JSKitLib.foldl({"auth": {}, "web": []}, identities, + function(identity, accumulator) { + if (identity.group == "web") accumulator.web.push(identity); + else { + identity.params = identity.params || {}; + accumulator.auth[identity.type] = identity; + } + } + ); +} + +JSKAuth.prototype.setWebIdentities = function(identities) { + this.identities.web = identities; +} + +JSKAuth.prototype.identityServerAction = function(action, identity, newData, onSuccess) { + newData = newData || {}; + var self = this; + var f = function(eventName) { + switch (action) { + case "unbind": + if (identity.group == "web") { + self.identities.web = JSKitLib.filter(function(i) { + return i.url != identity.url; + }, self.identities.web); + } else { + identity.user = undefined; + identity.use_as_from = false; + } + break; + case "bind": + self.appendIdentity(identity); + break; + case "update": + identity.url = newData.url; + break; + } + JSKW$Events.deRegisterEventCallback(eventContext, f, eventName); + if (onSuccess) onSuccess(); + } + var eventContext = JSKW$Events.registerEventCallback(undefined, f, "JSKitAuth_identityAction"); + var params = { + 'action': action, + 'type': identity.type, + 'group': identity.group, + 'url': identity.url + } + if (action == "update") params.newurl = newData.url; + new JSRVC({uri: this.uriDomain + '/user-identity-action', + 'ref': this.ref, + 'epb': window.JSKitEPB ? JSKitEPB.getAsHash() : {}, + 'target': this.target, request: params}); +} + +JSKAuth.prototype.actualizeGFCprofileURL = function(url, domain, siteID) { + url = url.replace(/\/\/js-kit.com/, "//" + domain); + url = url.replace(/site=(.*)/, "site=" + siteID); + return url; +} + +JSKAuth.prototype.drawSelector = function(container) { + if (!container) return; + var self = this; + var selector = this.createAuthSelector(0, function() { + if (this.selectedIndex == 0) return; + self.show(this.value); + }, true); + JSKitLib.removeChildren(container); + container.appendChild(selector); +} + +function JSKAuth(config) { + this.areas = {}; + this.uriDomain = (window.location.protocol.substr(0, 4) != 'http' ? 'http:' : '') + '//js-kit.com'; + this.passwordRecoveryData = {}; + JSKitLib.fmap.call(this, config, function(v, k){ this[k] = v; }); + this.identities = this.readIdentities(config.identities); + var firstIdentity = this.getFirstAuthIdentity(); + this.defaultActiveArea = firstIdentity && firstIdentity.type; + this.authForm = this.assemble(); + this.prepareAuthForm(); + this.loadCss(); +} + + + + + + +function JSDL(elmParent, arrDragElms) { + var self = this; + self.isIE = JSKitLib.isIE(); + var drgElms = arrDragElms || [elmParent]; + for(var i=0; i= maxLeft ? maxLeft : (left < 0 ? 0 : left)) + "px"; + self.elmParent.style.top = (mousePos.y - self.starty < 0) ? 0 : (mousePos.y - self.starty) + "px"; + } + + var onStopDragHandler = function(event) { + event = event || window.event; + JSKitLib.removeHandlers(document, onMoveDragHandler, onStopDragHandler, self.elmParent); + JSKitLib.stopEventPropagation(event); + if(self.elmParent.jsk$on_stop_drag) self.elmParent.jsk$on_stop_drag(e); + } + + JSKitLib.addHandlers(document, onMoveDragHandler, onStopDragHandler, self.elmParent); + JSKitLib.stopEventPropagation(e); + JSKitLib.preventDefaultEvent(e); + if(self.elmParent.jsk$on_start_drag) self.elmParent.jsk$on_start_drag(e); +} + + + + + +function JSKAvatars(config) { + JSKitLib.fmap.call(this, config, function(value, key) { this[key] = value; }); + this.controls = this.controls || []; + this.avatarPreviewImgs = {}; + this.avatars = this.getAsHash(this.avatars); + this.menuItems = this.prepareMenuItems(this.identities, this.avatars); + this.activateEvents(); + this.loadCSS(); +} + +JSKAvatars.prototype._labels = { + "anonymousAvatar": "No avatar", + "jskitAvatar": "My computer", + "gravatarEmail": "Gravatar email", + "useAvatarFrom": "Use my avatar from...", + "clickToEditAvatars": "Click to edit avatars", + "actionUploadAvatar": "Click to upload avatar from your computer", + "actionEditGravatarEmail": "Click to edit Gravatar email" +} + +JSKAvatars.prototype.label = function(name) { + return this.labels && this.labels(name) != name && this.labels(name) || this._labels[name] || name; +} + +JSKAvatars.prototype.getAsHash = function(avatars) { + return JSKitLib.foldl({}, avatars, function(avatar, acc) { acc[avatar.type] = avatar; }); +} + +JSKAvatars.prototype.getAvatarByType = function(type) { + return this.avatars[type] || this.anonymousAvatarData(); +} + +JSKAvatars.prototype.formatMenuItem = function(type, descriptors, extraParams, icon, title) { + var self = this; + var avatar = this.getAvatarByType(type); + var item = { + "type": "Radio", + "icon": icon || ("//cdn.js-kit.com/images/favicons/" + type + ".png"), + "title": self.assembleMenuItemTitle(type, avatar, title, descriptors), + "state": avatar.chosen ? "checked" : "unchecked", + "avatarType": type, + "extend": { + "setState": function() { + if (this.endingNode) JSKitLib.show(this.endingNode); + }, + "renderEnding": function(element) { + JSKitLib.addClass(element, "jskit-AvatarMenuItemEnding"); + self.avatarPreviewImgs[type] = element; + self.setPreviewImage(type, avatar); + } + }, + "oncheck": function(title) { + self.updateActiveAvatar(self.getAvatarByType(type)); + if (self.autoSave) { + self.saveAvatarState(); + JSKW$Events.syncBroadcast("JSKitAvatars_replaceAvatars", + [self.getAvatarByType(type)], undefined, self.id); + } + if (extraParams["oncheckCallback"]) { + extraParams["oncheckCallback"].call(this); + } + } + }; + return JSKitLib.foldl(item, extraParams || {}, function(value, acc, key) { acc[key] = value; }); +} + +JSKAvatars.prototype.saveAvatarState = function() { + var activeAvatar = this.getActiveAvatar(); + this.sendServerRequest("activate", activeAvatar ? {"name": activeAvatar.name} : {}); +} + +JSKAvatars.prototype.prepareMenuItems = function(identities, avatars) { + var self = this; + var itemsEPB = JSKitLib.fmap(avatars, function(avatar, type) { + if (!type.match(/^http:\/\/.*/)) return; + var params = avatars[type].params || {}; + var item = self.formatMenuItem( + type, + {}, + {"state": self.getAvatarByType(type).chosen ? "checked" : "unchecked"}, + params.favicon || '//cdn.js-kit.com/images/favicons/default.png', + params.long_label || JSKAuth.prototype.getIdentityLabel('epb') + ); + return item; + }); + var itemsThirdParty = JSKitLib.fmap(identities, function(identity, type) { + if (identity.authenticated && !avatars[type]) return; + return self.formatMenuItem(type, {}, { + "state": identity.authenticated ? + self.getAvatarByType(type).chosen ? "checked" : "unchecked" : + "disabled", + "action": identity.action ? function() { identity.action(); } : undefined + }, undefined, identity.title); + }); + return JSKitLib.merge( + {"title": JSKitLib.html('
    ' + this.label("useAvatarFrom") + '
    '), "type": "HTML"}, + this.assembleAnonymousFormItem(), + this.assembleUploadFormItem(), + itemsEPB, + itemsThirdParty, + this.assembleGravatarsForm(), + {"title": JSKitLib.html(''), "type": "HTML"} + ); +} + +JSKAvatars.prototype.anonymousAvatarData = function() { + return {"name": "gxpA99f0jKlohF_DgthroT.png", "type": "anonymous", "width": "100", "height": "100"}; +} + +JSKAvatars.prototype.classifyAvatarType = function(type) { + return type.match(/^http:\/\//) ? 'epb' : type; +} + +JSKAvatars.prototype.assembleMenuItemTitle = function(type, avatar, title, descriptors) { + type = this.classifyAvatarType(type); + var template = + '
    ' + + '
    ' + (title || this.label(type + "Avatar")) + '
    ' + + '
    '; + return JSKitLib.toDOM(template, "js-kit-avatars-", descriptors || {}).content; +} + +JSKAvatars.prototype.assembleAnonymousFormItem = function() { + return this.formatMenuItem("anonymous", {}, { + "state": this.getActiveAvatar() ? "unchecked" : "checked" + }, "//cdn.js-kit.com/images/favicons/noname.png"); +} + +JSKAvatars.prototype.assembleUploadFormItem = function() { + var self = this; + var descriptor = function(element, dom) { + dom.get("itemTitle").title = self.label("actionUploadAvatar"); + self.uploadForm = self.assembleUploadForm(element); + self.uploadForm.label = dom.get("itemTitle"); + JSKitLib.addChild(element, self.uploadForm.content); + JSKitLib.hide(self.uploadForm.content); + element.onclick = function() { + render("form"); + }; + }; + var render = function(element) { + var isFormVisible = element == "form"; + JSKitLib.hide(self.uploadForm[isFormVisible ? "label" : "content"]); + JSKitLib.show(self.uploadForm[isFormVisible ? "content" : "label"]); + }; + JSKW$Events.registerEventCallback(self.eventsCtx, function() { + render("label"); + }, "JSMenu-CollapseAll"); + return this.formatMenuItem("jskit", {"itemTitleContainer": descriptor}, { + "onuncheck": function() { render("label"); }, + "oncheckCallback": function() { if (!self.avatars["jskit"]) render("form"); } + }, "//cdn.js-kit.com/images/favicons/default.png"); +} + +JSKAvatars.prototype.assembleGravatarsForm = function() { + var self = this; + var descriptor = function(element) { + self.gravatarControlContainer = element; + self.renderGravatarControl(); + }; + return this.formatMenuItem("gravatar", {"itemTitle": descriptor}, { + "onuncheck": function() { + if (!self.gravatarEmail) self.gravatarEmailIPE.displayMode(); + }, + "oncheckCallback": function() { + if (!self.gravatarEmail) self.gravatarEmailIPE.editMode(); + } + }); +} + +JSKAvatars.prototype.setDefaultGravatar = function() { + var anonymous = this.anonymousAvatarData(); + this.avatars["gravatar"] = anonymous; + this.setPreviewImage("gravatar", anonymous); + this.updateActiveAvatar(anonymous); +} + +JSKAvatars.prototype.renderGravatarControl = function() { + var self = this; + var size = this.splitAvatarDim(this.size); + var anonymous = this.anonymousAvatarData(); + var defaultUrl = this.avatarURL(this.calcAvatarDim(size, anonymous).name); + this.gravatarEmailIPE = new JSIPE2({ + "obj": self, + "property": "gravatarEmail", + "title": self.label("actionEditGravatarEmail"), + "width": "120px", + "maxLength": 50, + "hideApplyBtn": true, + "defaultText": self.label("gravatarEmail"), + "textModeDisplayCSS": "block", + "editModeEventEnabled": true, + "jsk$wasEdited": function() { + self.setPreviewImage("gravatar"); + var params = self.gravatarEmail ? { + "email": self.gravatarEmail, + "defaultUrl": defaultUrl, + "rating": "X", + "size": 64 + } : {}; + if (!self.gravatarEmail) { + self.setDefaultGravatar(); + } + if (self.autoSave) { + JSKW$Events.syncBroadcast("JSKitAvatars_gravatarEmailUpdated", + self.gravatarEmail, undefined, self.id); + } + self.sendServerRequest("update_gravatar", params); + } + }); + JSKitLib.replaceChildren(self.gravatarControlContainer, self.gravatarEmailIPE.div); +} + +JSKAvatars.prototype.setPreviewImage = function(type, avatar) { + if (!this.avatarPreviewImgs[type]) return; + var loading = { + "name": "//cdn.js-kit.com/images/loading.gif", + "width": "16", + "height": "16" + }; + this.assembleAvatar({ + "instance": this.avatarPreviewImgs[type], + "width": "24", + "height": "24" + }, avatar || loading); +} + +JSKAvatars.prototype.getGravatarURL = function(gravatarID, size) { + if (!gravatarID || gravatarID.match(/^https?:\/\//)) return gravatarID; + var defaultUrl = this.calcAvatarDim(size, this.anonymousAvatarData()).name; + return 'http://www.gravatar.com/avatar.php?' + + 'gravatar_id=' + gravatarID + + '&default=' + this.avatarURL(defaultUrl) + + '&rating=X' + + '&size=' + size.width + 'x' + size.height; +} + +JSKAvatars.prototype.splitAvatarDim = function(dim) { + var re = /(\d+)x(\d+)/; + var size = re.exec(dim) || ['96x96', '96', '96']; + return {"width": size[1], "height": size[2]}; +} + +JSKAvatars.prototype.calcAvatarDim = function(size, avatar) { + if (!size || typeof(size) != "object") size = this.splitAvatarDim(size); + var width = parseInt(avatar.width); + var height = parseInt(avatar.height); + var MW = parseInt(size.width || 96); + var MH = parseInt(size.height || 96); + if(avatar.name.match(/https?:\/\//)) { + return {'width': width, 'height': height, 'name': avatar.name}; + } else if ((MW>=96)&&(MH>=96)&&(width<=100)&&(height<=100)){ + return {'width': width, 'height': height, 'name': avatar.name}; + } else if ((MW'); + var image = JSKitLib.html(''); + if (avatar.onerror) { + image.onerror = avatar.onerror; + } + var adjustedAvatar = this.calcAvatarDim(container, avatar); + var getMinSize = function(dim) { + return Math.min(adjustedAvatar[dim], container[dim]); + }; + var getSizeDiff = function(dim) { + return Math.max(0, container[dim] - adjustedAvatar[dim])/2; + }; + setSize(image, { + "width": getMinSize("width"), + "height": getMinSize("height") + }); + setSize(wrapper, container); + JSKitLib.addStyle(image, + "margin-top: " + getSizeDiff("height") + "px;" + + "margin-left: " + getSizeDiff("width") + "px;"); + JSKitLib.replaceChildren(wrapper, image); + return wrapper; +} + +JSKAvatars.prototype.updateActiveAvatar = function(avatar) { + var size = this.splitAvatarDim(this.size); + var data = this.calcAvatarDim(size, avatar); + var container = { + "instance": this.container, + "width": size.width, + "height": size.height + }; + JSKitLib.fmap(this.avatars, function(avt) { avt.chosen = avt.type == avatar.type; }); + return this.assembleAvatar(container, data); +} + +JSKAvatars.prototype.getAvatars = function() { return this.avatars || []; } + +JSKAvatars.prototype.getActiveAvatar = function() { + return JSKitLib.foldl(undefined, this.avatars || [], function(avatar) { + if (avatar.chosen) return avatar; + }); +} + +JSKAvatars.prototype.avatarURL = function(avatar) { + if(avatar.match(/^(https?:)*\/\//)) { + return JSKitLib.htmlUnquote(avatar); + } else if(avatar.match(/^[^/]+$/)) { + return this.uriAvatar + avatar; + } else return ""; +} + +JSKAvatars.prototype.sendServerRequest = function(action, params) { + JSKitLib.fmap.call(this, ["id", "ref"], function(name) { params[name] = this[name]; }); + new JSRVC({"uri": this.uriAvatar + action, "request": JSKitEPB.getAsHash(params)}); +} + +JSKAvatars.prototype.replaceAvatars = function(avatars) { + if (!avatars.length) return; + var avatar = JSKitLib.cloneObject(avatars[0]); + this.avatars[avatar.type] = avatar; + if (!this.menu) return; + this.setPreviewImage(avatar.type, avatar); + this.updateActiveAvatar(avatar); + this.updateMenuItemsStatus(avatar); +} + +JSKAvatars.prototype.updateMenuItemsStatus = function(avatar) { + JSKitLib.fmap(this.menu.items, function(item) { + if (avatar.type == item.avatarType) item.setActiveState(); + }); +} + +JSKAvatars.prototype.activateEvents = function() { + var self = this; + var handlers = { + "replaceAvatars": function(avatars) { + self.replaceAvatars(avatars); + }, + "gravatarEmailUpdated" : function(gravatarEmail) { + self.gravatarEmail = gravatarEmail; + self.renderGravatarControl(); + if (!self.gravatarEmail) { + self.setDefaultGravatar(); + } + } + }; + JSKitLib.fmap(handlers, function(handler, name) { + JSKW$Events.registerEventCallback(self.eventsCtx, function(name, data, id, callerId) { + if (!self.yours) return; + if ((id && (id == self.id || id.match(/profile/))) || (callerId && callerId != self.id)) handler(data); + }, "JSKitAvatars_" + name); + }); +} + +JSKAvatars.prototype.deActivateEvents = function() { + if (this.eventsCtx) JSKW$Events.invalidateContext(this.eventsCtx); +} + +JSKAvatars.prototype.syncAvatarsChanges = function() { + JSKW$Events.syncBroadcast("JSAvatars_replaceAvatars", this.getAvatars(), undefined, this.id); +} + +JSKAvatars.prototype.assembleUploadForm = function(container) { + var self = this; + var template = + '
    ' + + '' + + '
    '; + var setControlsState = function(state) { + JSKitLib.fmap(self.controls, function(control) { + if (control && !control.btnLocked) control.disabled = (state == "lock") ? "true" : ""; + }); + } + var descriptors = { + "form": function(element) { + JSKitLib.fmap(JSKitEPB.getAsHash({"ref": self.ref}), function(v, k) { + element.appendChild(JSKitLib.html('')); + }); + container.appendChild(element); + }, + "control": function(element, dom) { + var form = dom.get("form"); + var onload = function() { + setControlsState("unlock"); + form.reset(); + self.sendServerRequest("list", {"onlyjskit": "true"}); + }; + self.controls.push(element); + element.onchange = function() { + self.setPreviewImage("jskit"); + if (!form.target) { + var tgt = 'js-ifrm-' + Math.random(); + JSKitLib.createHiddenIframe(tgt, self.target, onload, false); + form.target = tgt; + } + form.submit(); + setControlsState("lock"); + } + } + }; + return JSKitLib.toDOM(template, "js-kit-avatars-upload-", descriptors); +} + +JSKAvatars.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-avatars-wrapper { cursor: pointer; }" + + ".js-kit-avatars-wrapper .jskit-MenuItemTitle { margin: 1px; }" + + ".js-kit-avatars-wrapper div.jskit-MenuRootHTML { text-align: left; }" + + ".js-kit-avatars-avatarWrapper { text-align: left; " + (JSKitLib.isPreIE8() ? "zoom: 1;" : "") + "}" + + ".js-kit-avatars-itemTitleContainer { margin: 4px 5px 0px 0px; }" + + ".js-kit-avatars-itemTitleCnt-jskit, .js-kit-avatars-itemTitleCnt-gravatar { margin-top: 0px; line-height: 20px; }" + + ".js-kit-avatars-menu-title { font-size: 10px; font-weight: bold; font-family: Lucida grande,Tahoma,Verdana,Arial; margin: 5px 8px; }" + + ".js-kit-avatars-menu-footer { margin-top: 8px; }" + + ".js-kit-avatars-upload-form { margin: 0px; }" + + ".js-kit-clear { clear: both; }", "avatars" + ); +} + + + + + +function JSTabsManager(tabs, areas, config) { + var self = this; + if (tabs.length < 1 || !areas) return; + JSKitLib.fmap({ + "tabs" : tabs, + "areas" : areas, + "config": config || {} + }, function(value, key) { self[key] = value; }); + this.loadCSS(); + this.setActiveTab(this.getActiveTab()); + this.displayTabs(tabs, this.areas.titles); +} + +JSTabsManager.prototype.displayTabs = function(tabs, container) { + JSKitLib.removeChildren(container); + JSKitLib.fmap.call(this, tabs, function(tab) { container.appendChild(this.initFromData(tab)); }); + container.appendChild(JSKitLib.html('
    ')); + if (tabs.length == 1) JSKitLib.addClass(container, "js-kit-tabs-singleTab"); + var activeTab = this.getActiveTab(); + if (this.config.mode != "toggle" || activeTab) this.displayTab(activeTab); + else if (!activeTab) JSKitLib.hide(this.areas.content); +} + +JSTabsManager.prototype.initFromData = function(tab) { + var self = this; + var prefix = "js-kit-tab-"; + var descriptors = { + "icon": function(element) { + if (tab.icon) JSKitLib.addPNG(element, tab.icon); else JSKitLib.hide(element); + }, + "title": function(element) { + if (typeof(tab.title) == "string") tab.title = JSKitLib.text(tab.title); + element.appendChild(tab.title); + JSKitLib.preventSelect(element); + } + }; + var dom = JSKitLib.toDOM(this.config.template || this.template, prefix, descriptors); + if (this.config.descriptors) { + var elements = JSKitLib.foldl({}, this.config.descriptors, function(value, acc, key) { if (dom.get(key)) acc[prefix + key] = dom.get(key); }); + JSKitLib.attachDescriptors2Elements(elements, prefix, this.config.descriptors); + } + dom.content.onclick = function(e) { + if (self.config.mode == "toggle" && tab.active) { + tab.active = false; + self.renderView(); + self.processCallback(tab, "Closed"); + JSKitLib.hide(self.areas.content); + } else { + if (tab.active) return; + self.processCallback(self.activeTab, "Closed"); + self.setActiveTab(tab); + self.displayTab(tab); + } + JSKitLib.stopEventPropagation(e); + } + if (tab.name) JSKitLib.addClass(dom.content, prefix + tab.name); + tab.cache = {"title" : dom.content}; + return dom.content; +} + +JSTabsManager.prototype.processCallback = function(tab, action) { + if (tab && tab.callbacks && tab.callbacks["onTab" + action]) tab.callbacks["onTab" + action](tab); +} + +JSTabsManager.prototype.getActiveTab = function() { + return JSKitLib.foldl(undefined, this.tabs, function(tab, result) { if (tab.active) return tab; }) || (this.config.mode != "toggle" ? this.tabs[0] : undefined); +} + +JSTabsManager.prototype.setActiveTab = function(tab) { + if (!tab) return; + if (this.activeTab) this.activeTab.active = false; + this.activeTab = tab; + this.activeTab.active = true; +} + +JSTabsManager.prototype.renderView = function() { + var area = this.areas.content; + var activeTabPosition; + JSKitLib.removeClass(area, "js-kit-lastTabActive"); + JSKitLib.removeClass(area, "js-kit-firstTabActive"); + JSKitLib.fmap.call(this, this.tabs, function(tab, idx) { + if (tab.cache.title) JSKitLib[(tab.active ? "add" : "remove") + "Class"].call(this, tab.cache.title, "js-kit-tab-active"); + if (tab.active) activeTabPosition = (idx == this.tabs.length - 1) ? "last" : (idx == 0 ? "first" : undefined); + }); + if (activeTabPosition) JSKitLib.addClass(area, "js-kit-" + activeTabPosition + "TabActive"); +} + +JSTabsManager.prototype.displayTab = function(tab) { + var area = this.areas.content; + this.renderView(); + if (this.config.mode == "toggle") JSKitLib.show(area); + if (!tab.cache.content || this.config.nocache) tab.cache.content = tab.content(area); + JSKitLib.replaceChildren(area, tab.cache.content); + this.processCallback(tab, "Opened"); +} + +JSTabsManager.prototype.collapseTabs = function() { + if (this.config.mode != "toggle") return; + if (this.activeTab) { + this.activeTab.active = false; + delete this.activeTab; + } + this.renderView(); + JSKitLib.hide(this.areas.content); +} + +JSTabsManager.prototype.template = + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + +JSTabsManager.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-tab { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " float: left; cursor: pointer; margin: 0; font-size: 14px; background: transparent; padding: 5px 10px " + (JSKitLib.isIE() ? "0" : "5") + "px 10px; }" + + ".js-kit-tab-icon { float: left; width: 17px; height: 17px; margin: 0px 5px 0 0; }" + + ".js-kit-tab-title { font-size: 12px; float: left; }" + + ".js-kit-tab-active { font-weight: bold; cursor: text; background: #FFFFFF; }" + + ".js-kit-tabs-singleTab { display: none; }" + + ".js-nsgecko { -moz-user-select: none; }" + + ".js-kit-clear { clear: both; }", "tabsManagement"); +} + + + + + +function JSKitMiniProfile(target, data, config) { + var self = this; + this.data = data; + this.target = target; + this.config = this.merge(config, { + "mode": "popup", + "template": this.template, + "cssPrefix": "js-kit-miniProfileWrap", + "elmPrefix": "js-kit-miniProfile-", + "descriptors": {} + }); + this.loadCSS(); + if (this.config.mode == "popup") + JSKW$Events.registerEventCallback(undefined, function() { self.hide(); }, "miniProfile_collapseAll"); + this.assemble(); +} + +JSKitMiniProfile.prototype.assemble = function() { + var self = this; + this.descriptors = { + "name": function() { return JSKitLib.html('' + JSKitLib.trim(self.data.Name) + ''); }, + "viewDetails": function() { return JSKitLib.text(self.label("viewDetails")); }, + "siteLinksIcons": function(element) { return self.assembleSiteLinks("icons", element); }, + "siteLinksExtended": function(element) { return self.assembleSiteLinks("extended", element); } + }; + this.dom = JSKitLib.toDOM(this.config.template, this.config.elmPrefix, this.descriptors); + JSKitLib.addClass(this.dom.content, this.config.cssPrefix + " " + this.config.elmPrefix + this.config.mode); + var elements = JSKitLib.foldl({}, this.config.descriptors, function(descriptor, container, name) { + if (self.dom.get(name)) container[name] = self.dom.get(name); + }); + JSKitLib.attachDescriptors2Elements(elements, "", this.config.descriptors); + this.display(); +} + +JSKitMiniProfile.prototype.display = function(target) { + if (!this.dom) return; + if (this.config.mode == "popup") JSKW$Events.syncBroadcast("miniProfile_collapseAll"); + JSKitLib.addChild(target || this.target, this.dom.content); + this.dom.content.onclick = function(e) { JSKitLib.stopEventPropagation(e); }; + this.isVisible = true; +} + +JSKitMiniProfile.prototype.render = function(block, data) { + var self = this; + var element = this.dom.get(block); + if (!element) return; + JSKitLib.removeChildren(element); + this.data = this.merge(data, this.data); + var name = this.config.elmPrefix + block; + var replacement = {}; + replacement[name] = element.cloneNode(true); + JSKitLib.fmap([self, self.config], function(obj) { + JSKitLib.attachDescriptors2Elements(replacement, self.config.elmPrefix, obj.descriptors || {}); + }); + element.parentNode.replaceChild(replacement[name], element); + this.dom.set(block, replacement[name]); +} + +JSKitMiniProfile.prototype.hide = function() { + if (!this.isVisible || !this.dom) return; + this.isVisible = false; + this.dom.content.parentNode.removeChild(this.dom.content); +} + +JSKitMiniProfile.prototype.getContent = function() { + return this.dom ? this.dom.content : undefined; +} + +JSKitMiniProfile.prototype.assembleSiteLinks = function(mode, element) { + var self = this; + var auth = JSKitLib.fmap(self.data.identities.auth, function(identity) { + if (identity.user) return identity; + }); + var identities = JSKitLib.merge(auth, self.data.identities.web); + if (identities.length < 1) return JSKitLib.hide(element); else JSKitLib.show(element); + var setAction = function(element, type, url, domain, identity, isLogin) { + var isExternalProfile = isLogin && !!url && !type.match(/jskit|haloscan|openid/); + var isDisabled = isLogin && !isExternalProfile && self.config.isNativeProfileDisabled; + element.onclick = function() { + if (isLogin && !isExternalProfile) { + if (!isDisabled) self.config.openFullProfile(); + return; + } + if (isLogin) { + // validation of old format profile URLs + if ((type == "gfc" && !url.match(/canvas.html/)) + || (type == "yahoo" && !url.match(/profiles.yahoo.com\/u\//))) { + element.title = self.label("openFullProfile"); + self.config.openFullProfile(); + return; + } + if (type == "gfc" && identity.params.site) { + url = JSKAuth.prototype.actualizeGFCprofileURL(url, identity.params.domain, identity.params.site); + } + } + window.open(url.replace(/\ /g, "%20")); + }; + if (isDisabled) { + JSKitLib.addClass(element, "js-kit-miniProfile-profileDisabled"); + } else { + var title = isExternalProfile ? "ext_profile_" + type : "openFullProfile"; + element.title = isLogin ? self.label(title) : url; + } + }; + var container = JSKitLib.html(''); + var specificTemplate = mode == "icons" ? + '
    ': + '
    ' + this.label("visitMeOn") + '
    '; + container.appendChild(JSKitLib.html(specificTemplate)); + JSKitLib.fmap.call(this, mode == "icons" ? identities.reverse() : identities, function(identity) { + if (!identity.use_as_from) return; + var isLogin = identity.group != "web"; + var type = isLogin ? identity.type : "default"; + var url = ''; + var domain = ''; + if (identity.url) { + url = (isLogin || identity.url.match(/^(https?:)*\/\//) ? "" : "http://") + identity.url; + domain = JSKitLib.extractDomain(url); + } + var title = !isLogin ? domain : JSKAuth.prototype.getIdentityParam('short_label', identity, JSKAuth.prototype.getIdentityLabel(type)) || domain; + var template = + '
    ' + + '
    ' + + '' + + '
    ' + + '
    '; + var descriptors = { + "icon": function(element) { + JSKitLib.addPNG(element, JSKAuth.prototype.getIdentityParam('favicon', identity, "//cdn.js-kit.com/images/favicons/" + type + ".png")); + setAction(element, type, url, domain, identity, isLogin); + }, + "link": function(element) { + if (mode == "icons") JSKitLib.hide(element); else setAction(element, type, url, domain, identity, isLogin); + } + }; + JSKitLib.addChild(container, JSKitLib.toDOM(template, "js-kit-linksItem-", descriptors).content, mode == "icons"); + }); + return container; +} + +JSKitMiniProfile.prototype.label = function(name) { return this.config.labels("miniProf_" + name); } + +JSKitMiniProfile.prototype.merge = function(masterObj, slaveObj) { + var merge = function(cnt, obj) { return JSKitLib.foldl(cnt, obj || {}, function(v, acc, k) { acc[k] = v; }); }; + return merge(merge({}, slaveObj), masterObj); +} + +JSKitMiniProfile.prototype.template = + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + +JSKitMiniProfile.prototype.loadCSS = function() { + var dims = this.config.avatarSize; + var zoom = JSKitLib.isIE() ? "zoom: 1;" : ""; + var prefix = "." + this.config.cssPrefix.match(/[^\ ]*/); + var margin = parseInt(dims.width) + 10; + JSKitLib.addCss( + prefix + " .js-kit-miniProfileDataWrap { " + zoom + "margin-left: " + margin + "px; }" + + prefix + " .js-kit-miniProfile-avatar { float: left; margin-right: -" + margin + "px; width: " + dims.width + "px; height: " + dims.height + "px; }", "miniProfile-" + this.config.cssPrefix.replace(/[^a-zA-Z-]/g, "-")); + JSKitLib.addCss( + ".js-kit-miniProfile { padding: 7px; text-align: left; font-weight: normal; cursor: default; background: #FFFFFF; }" + + ".js-kit-miniProfile-popup { position: absolute; z-index: 13490; width: 275px; border: 2px solid #d6e2e9; -moz-border-radius: 5px; -webkit-border-radius: 5px; }" + + ".js-kit-miniProfile-embedded { border: 1px solid #BBBBBB; }" + + ".js-kit-miniProfile-avatar { position: relative; }" + + ".js-kit-miniProfile-embedded .js-kit-miniProfile-avatar { border: 1px solid #BBBBBB; }" + + ".js-kit-miniProfileDataContainer { float: left; width: 100%; }" + + ".js-kit-miniProfile-stats { color: #0066CC; font-size: 10px; }" + + ".js-kit-miniProfile-viewDetails { color: #0066CC; font-size: 10px; }" + + ".js-kit-miniProfile-name { font-size: 18px; color: #000000; }" + + ".js-kit-miniProfile-siteLinksExtended { margin-top: 5px; font-size: 20px; border-top: 2px dotted #E4E4E4; }" + + ".js-kit-miniProfile-siteLinksIcons { border-top: 2px dotted #7d7d7d; }" + + ".js-kit-miniProfile-siteLinksIcons .js-kit-linksItem { width: 16px; height: 16px; float: left; }" + + ".js-kit-linksItem { margin: " + (JSKitLib.isIE() ? "3px 3px" : "4px 6px") + " 0px 0px; line-height: 16px; }" + + ".js-kit-linksItem-link { float: left; " + zoom + " color: #476CB8 !important; margin-left: 5px; font-size: 12px; cursor: pointer; }" + + ".js-kit-linksItem-icon { float: left; width: 16px; height: 16px; margin: 0px " + (JSKitLib.isIE() ? "5" : "3") + "px 0px 0px; font-size: 12px; padding: 0px; cursor: pointer; }" + + ".js-kit-linksContainerTitle { margin: 7px 3px; color: #000000; font-size: 12px; font-weight: bold; }" + + ".js-kit-miniProfile-profileDisabled { cursor: default; }" + + ".js-kit-clear { clear: both; }", "miniProfile"); +} + + + + + +function JSKbdHandler(element, events) { + + this.kbdCallback = function(e) { + var event = e || window.event; + var key = event.charCode || event.keyCode; + if (key == 9 || key == 13 || key == 27) JSKitLib.preventDefaultEvent(event); + if(JSKitLib.isSafari()) JSKitLib.stopEventPropagation(event); + for(var i = 0; i < events.length; i++) { + for(var j = 0; j < events[i].keys.length; j++) { + if(typeof(events[i].keys[j]) == "string") events[i].keys[j] = String.charCodeAt(events[i].keys[j]); + var shiftCondition = (events[i].shift != undefined) ? events[i].shift == event.shiftKey : true; + if (events[i].keys[j] == key && shiftCondition) { + if(!events[i].args) + (events[i].action)(); + else + events[i].action.apply(events[i], events[i].args); + } + } + } + } + + if(element.addEventListener) { + if(JSKitLib.isSafari()) element.addEventListener("keydown", this.kbdCallback, false); + else if(JSKitLib.isOpera()) element.addEventListener("keydown", this.kbdCallback, false); + else element.addEventListener("keypress", this.kbdCallback, false); + } else { + element.onkeydown = this.kbdCallback; + } +} + + + + + +function JSIPE2(obj) { +/* + JSIPE2 API + + obj: object contains property + title: hint + defaultText: default text in created div + property: property where save the result + maxLength: max string length + width: input width + jsk$validate callback, validates the value before applying + jsk$wasEdited callback, called at the end of editing + readonly: readonly mode + + example: + var jsipe = new JSIPE2({obj: elem, + property: 'descr', + title: 'Description', + defaultText: 'Add caption', + width: '90px', + maxLength: 12, + jsk$wasEdited: function(){...}, + readonly: true + }); + +*/ + + for(var i in obj) + this[i] = obj[i]; + var div = JSKitLib.cr(); + div.title = this.readonly ? "" : (this.title || $JCL("clickToEdit")); + var defaultText = this.readonly ? "" : (this.defaultText || $JCL("clickToEditEmpty")); + var maxTextLength = this.maxLength || 256; + var isFocused = false; + + var self = this; + + var textDivDisplayCSS = typeof(self.textModeDisplayCSS) != "undefined" ? self.textModeDisplayCSS : "inline"; + var textDiv = JSKitLib.cr({style:{display:textDivDisplayCSS}}); + var textValue = (JSKitLib.trim(self.obj[self.property]).length > 0) ? self.obj[self.property] : defaultText; + var text = JSKitLib.text(textValue); + textDiv.appendChild(text); + div.appendChild(textDiv); + + var editDiv = JSKitLib.cr(); + editDiv.style.display = "none"; + div.appendChild(editDiv); + var edit = JSKitLib.cr({t:"input", type:"edit", className:"jsipe-input", + style: "width: " + (self.width || "150px"), readonly: this.readonly}); + edit.value = this.obj[this.property] || ""; + editDiv.appendChild(edit); + + if (!this.hideApplyBtn) { + var applyDiv = JSKitLib.cr(); + JSKitLib.addClass(applyDiv, "jsipe-applyButton"); + applyDiv.title = "Apply"; + JSKitLib.addPNG(applyDiv, "//cdn.js-kit.com/images/tick.png"); + editDiv.appendChild(applyDiv); + } + + this.div = div; + + if (this.readonly) return; + + textDiv.onmouseover = function() { JSKitLib.addClass(textDiv, "jsipe-onmouseover"); } + textDiv.onmouseout = function() { JSKitLib.removeClass(textDiv, "jsipe-onmouseover"); } + + this.displayMode = function() { + JSKitLib.show(textDiv, textDivDisplayCSS); + JSKitLib.hide(editDiv); + textDiv.removeChild(text); + text = JSKitLib.text(self.obj[self.property] || defaultText); + textDiv.appendChild(text); + } + + this.editMode = function(e) { + if(!self.editModeEventEnabled) JSKitLib.stopEventPropagation(e); + JSKitLib.hide(textDiv); + JSKitLib.show(editDiv, "inline"); + edit.focus(); + edit.select(); + } + + var applyChanges = function() { + if(typeof self.jsk$validate == "function" && !self.jsk$validate(edit.value)) return; + if(edit.value == self.obj[self.property]) { self.displayMode(); return;} + if(edit.value.length > maxTextLength) { + alert("The text you entered cannot exceed "+ maxTextLength +" symbols"); + resetChanges(); + return; + } + self.obj[self.property] = edit.value = JSKitLib.trim(edit.value); + if(isFocused) edit.blur(); + self.displayMode(); + if(self.jsk$wasEdited) self.jsk$wasEdited(); + } + + this.resetChanges = function() { + edit.value = self.obj[self.property]; + if(isFocused) edit.blur(); + self.displayMode(); + } + + var jumpNextSibling = function() { + if(isFocused) edit.blur(); + if(self.nextSib) + self.nextSib.editMode(); + } + + var jumpPrevSibling = function() { + if(isFocused) edit.blur(); + if(self.prevSib) + self.prevSib.editMode(); + } + + if(this.dblclick) + textDiv.ondblclick = this.editMode; + else + textDiv.onclick = this.editMode; + edit.onblur = function() { applyChanges(); isFocused = false; }; + edit.onfocus = function() { isFocused = true; }; + edit.onclick = function(e) { JSKitLib.stopEventPropagation(e); } + if (!this.hideApplyBtn) applyDiv.onmousedown = applyChanges; + + new JSKbdHandler(edit, [ + {action:applyChanges, keys:[10,13]} + ,{action:this.resetChanges, keys:[27]} + ,{action:jumpNextSibling, keys:[9], shift:false} + ,{action:jumpPrevSibling, keys:[9], shift:true} + ]); +} + +JSIPE2.prototype.addNextSibling = function(next) { + if (next) { + this.nextSib = next; + next.prevSib = this; + } +} + + + + + +function JSIPE(obj) { + var self = this; + self.obj = obj; + var form = this.makeForm(obj.title); + var inp = form.input; + self.form = form; + + form.cleaner.onmousedown = function(e){ + inp.value = ""; + form.cleaner.style.visibility = "hidden"; + inp.focus(); + JSKitLib.preventDefaultEvent(e || window.event); + } + + var keyHandler = function(e) { + e = e || window.event; + setTimeout(function(){ + form.cleaner.style.visibility = (inp.value.length != 0) ? "visible" : "hidden"; + if(obj.type == "Tab" || obj.type == "Image") form.cleaner.style.display = "none"; + }, 0); + switch(e.keyCode || e.which) { + case 27: + JSKitLib.preventDefaultEvent(e); + if(obj.mode == "full") self.finishEditing(obj.field, obj.field.lastValue); + if(obj.jsk$on_cancel_exit) obj.jsk$on_cancel_exit(); + break; + case 10: case 13: + JSKitLib.preventDefaultEvent(e); + if (inp.value && obj.mode == "full") + self.finishEditing(obj.field, inp.value); + if(obj.jsk$on_submit_exit) obj.jsk$on_submit_exit(inp.value); + break; + case 9: + JSKitLib.preventDefaultEvent(e); + if (obj.siblings) obj.siblings[(obj.field.pos+1)%obj.siblings.length].tabKeyHandler(); + break; + } + } + self.addKeyHndl(keyHandler); + if (obj.inpSize) inp.style.width = obj.inpSize; + form.cleaner.style.visibility = "hidden"; + if(obj.mode == "form") return form; + + if(!window.jsipe$glob) window.jsipe$glob = {}; + var glob = window.jsipe$glob; + obj.field.style.cursor = "pointer"; + if(obj.siblings) obj.field.pos = obj.siblings.length; + + this.finishEditing = function(field, newValue) { + if(!field.input) return; + glob.isEditing = false; + field.input.onblur = JSKitLib.isOpera() ? undefined : ""; + field.input.onkeypress = JSKitLib.isOpera() ? undefined : ""; + field.input = null; + field.wasEdited(newValue); + field.style.textDecoration = field.oldDecoration; + } + + var onclickHandler = function() { + if(obj.field.input) return false; + if(obj.jsipe$start && !obj.jsipe$start()) return false; + if(glob.stopEditing) glob.stopEditing(); + if(obj.containerElement.tId) { + clearTimeout(obj.containerElement.tId); + obj.containerElement.tId = 0} + obj.field.oldDecoration = obj.field.style.textDecoration; + obj.field.isHtmlLink = obj.field.firstChild.tagName == 'A'; + obj.field.lastValue = obj.itemObject[obj.Property]; + obj.field.ondblclick = JSKitLib.isOpera() ? undefined : ""; + inp.type = 'text'; + inp.value = obj.itemObject[obj.Property]; + self.addKeyHndl(keyHandler); + + inp.onblur = function(e) { + if(self.form.input.value) { + self.finishEditing(self.obj.field, self.form.input.value); + if (obj.field.lastValue == self.form.input.value) { + if(obj.jsk$on_cancel_exit) obj.jsk$on_cancel_exit(self.form.input.value)} + else{ + if(obj.jsk$on_submit_exit) obj.jsk$on_submit_exit(self.form.input.value)} + }; + //Do not close field until non-empty + } + + obj.field.input = inp; + glob.stopEditing = function() { + glob.stopEditing = null; + if((obj.field.input)&&obj.field.input.value) self.finishEditing(obj.field, obj.field.input.value); + } + JSKitLib.removeChildren(obj.field); + obj.field.appendChild(form.main); + obj.field.style.textDecoration = "none"; + form.cleaner.style.visibility = (inp.value.length != 0) ? "visible" : "hidden"; + if(obj.type == "Tab" || obj.type == "Image") form.cleaner.style.display = "none"; + inp.onselectstart = function(e) { + JSKitLib.stopEventPropagation(e || window.event); + return true; + }; + obj.containerElement.onselectstart = function(e) { return true }; + inp.focus(); + inp.select(); + glob.isEditing = true; + return false; + } + + var ondblclickHandler = function() { + if(0 && obj.field.isHtmlLink) + window.location.href = this.firstChild.value; + } + + switch(obj.type) { + case "Tab": + obj.field.ondblclick = onclickHandler; + break; + case "Others": + obj.field.onclick = onclickHandler; + obj.field.tabKeyHandler = onclickHandler; + obj.field.ondblclick = ondblclickHandler; + break; + case "Search": case "Image": + obj.field.onclick = onclickHandler; + break; + } +} + +JSIPE.prototype.addKeyHndl = function(keyHandler){ + var inp = this.form.input; + switch(this.obj.type) { + case "Tab": + if (JSKitLib.isIE()) inp.onkeydown = keyHandler; + else if(JSKitLib.isSafari()) inp.onkeyup = keyHandler; + else inp.onkeypress = keyHandler; + break; + case "Others": case "Image": + if(JSKitLib.isOpera()) inp.onkeypress = keyHandler; + else inp.onkeydown = keyHandler; + break; + case "Search": + if (JSKitLib.isIE() || JSKitLib.isSafari()) + inp.onkeydown = keyHandler; + else inp.onkeypress = keyHandler; + break; + } +} + +JSIPE.prototype.makeForm = function(title){ + var text = this.dtContent.replace(/TITLE/, title || ""); + var div = JSKitLib.html(text); + var ctls = JSKitLib.mapClass2Object({}, div); + if(!title) ctls['js-JSIPETitle'].style.display = "none"; + return {'main': div,'input': ctls['js-JSIPEInput'], 'cleaner':ctls['js-JSIPECleaner']}; +} + +JSIPE.prototype.dtContent +='' ++' ' ++' ' ++' ' ++' ' ++' ' ++'
    TITLE' ++' ' ++'
    '; + + + + + +if(!window.JSKW$Events){ + var JSKW$Events = new JSEC(); +} + +///////////////////////////////////// +// JS Event Class +///////////////////////////////////// +function JSEC() { + this.contextHandles = []; +} + +JSEC.prototype.registerEventCallback = function (contextHandle, eventHandle, eventName) { + if(!contextHandle) { + contextHandle = new JSECC(eventHandle, eventName); + this.contextHandles.push(contextHandle); + contextHandle.cHdlId = this.contextHandles.length - 1; + } else { + contextHandle.registerEventCallback(eventHandle, eventName); + } + return contextHandle; +} + +JSEC.prototype.deRegisterEventCallback = function (contextHandle, eventHandle, eventName) { + contextHandle.deRegisterEventCallback(eventHandle, eventName); +} + +JSEC.prototype.syncBroadcast = function (eventName) { + var args = arguments; + JSKitLib.fmap(this.contextHandles, function(c){ + if(c) c.broadCast.apply(c, args); + }); +} + +JSEC.prototype.asyncBroadcast = function (eventName) { + var self = this; + var args = arguments; + setTimeout(function(){ + self.syncBroadcast.apply(self, args); + }, 0); +} + +JSEC.prototype.invalidateContext = function (contextHandle) { + if(contextHandle) { + contextHandle.invalidateContext(); + delete this.contextHandles[contextHandle.cHdlId]; + } +} + +///////////////////////////////////// +// JS Event Context Class +///////////////////////////////////// +function JSECC(eventHandle, eventName) { + this.registeredCallbacks = []; + if(eventName || eventHandle) this.registerEventCallback(eventHandle, eventName); +} + +JSECC.prototype.registerEventCallback = function (eventHandle, eventName) { + var ev = eventName || ''; + if(!this.registeredCallbacks[ev]) this.registeredCallbacks[ev] = []; + this.registeredCallbacks[ev].push(eventHandle); +} + +JSECC.prototype.deRegisterEventCallback = function (eventHandle, eventName) { + var ev = eventName || ''; + var self = this; + if(!eventHandle) { + delete this.registeredCallbacks[ev]; + return; + } + var k=0; + while(k=0 && Cnt) ? this.items.slice(sIdx, sIdx+Cnt) : []; +} + +JSPGC.prototype.deleteItems = function (sIdx, Cnt) { + var items = this.getItems(sIdx, Cnt); + var res = 0; + JSKitLib.fmap(this.getItems(sIdx, Cnt), function(e) { + res += (e && e.obj && + e.obj.status!='D' && e.obj.status!='DT') ? 1 : 0; + }); + this.items.splice(sIdx, Cnt); + this.itemsCount -= Cnt; + return res; +} + +JSPGC.prototype.setItemsCount = function (newItemsCount) { + if(newItemsCount0) this.items[newItemsCount-1] = undefined; + this.itemsCount = newItemsCount; + } +} + +JSPGC.prototype.getItemIdxById = function (itemId) { + var itemIdx; + for(var i=0; i=0 && Cnt) ? this.pages.slice(pageIdx, pageIdx+Cnt) : []; +} + +JSPGC.prototype.getPage = function (pageIdx) { + var pageArr = this.getPages(pageIdx, 1); + return (pageArr.length>0) ? pageArr[0] : undefined; +} + +JSPGC.prototype.getStartPageItem = function (pageIdx) { + return pageIdx * this.itemsPerPage; +} + +JSPGC.prototype.setPageCount = function (newPageCount, newItemsCount) { + while(this.pageCount0) this.deletePage(); + this.pageCount = newPageCount; + this.setItemsCount(newItemsCount); + if(!newItemsCount && newPageCount) this.setPageAttr(0, 1, {invalidData: false}); +} + +JSPGC.prototype.getPageAttr = function (pageIdx, Attr) { + var page = this.getPage(pageIdx); + return page ? page[Attr] : undefined; +} + +JSPGC.prototype.setPageAttr = function (pageIdx, Cnt, Attrs) { + JSKitLib.fmap(this.getPages(pageIdx, Cnt), + function(curPage) { + JSKitLib.fmap(Attrs, function(V,K){ curPage[K] = V }) + }); +} + +JSPGC.prototype.getPageByItemIdx = function(index) { + return Math.floor(index/this.itemsPerPage); +} + +JSPGC.prototype.getPageCntByItemCnt = function(itemCnt) { + return Math.ceil(itemCnt/this.itemsPerPage); +} + +JSPGC.prototype.setPageItems = function (startPage, newData) { + var pageCount = this.getPageCntByItemCnt(newData.length); + this.setPageAttr(startPage, pageCount, {invalidData: false, invalidVisualization: true}); + var startItem = this.getStartPageItem(startPage); + var self = this; + this.setItems(startItem, newData.length, JSKitLib.fmap(newData, function(C){ return self.newItem({obj: C}); })); +} + +JSPGC.prototype.addPageItem = function (item, itemIdx) { + if(this.pageCount*this.itemsPerPage==this.itemsCount) { + this.addPage(); + this.setPageAttr(this.pageCount-1, 1, {invalidData: false}); + } + var idx = (typeof itemIdx == "undefined") ? this.itemsCount : itemIdx; + this.addItem(item, idx); + var insertPageIdx = this.getPageByItemIdx(idx); + this.setPageAttr(insertPageIdx, this.pageCount-insertPageIdx, { invalidVisualization: true}); + for(var i=insertPageIdx+1; i1) this.deletePage(); + return res; +} + +JSPGC.prototype.getPageItems = function (pageIdx) { + var startItem = this.getStartPageItem(pageIdx); + var itemsCnt = this.getPageItemsCnt(pageIdx); + return this.getItems(startItem, itemsCnt); +} + +JSPGC.prototype.invalidatePagesView = function (pageIdx, Cnt) { + this.setPageAttr(pageIdx, Cnt, {invalidVisualization: true}); +} + +JSPGC.prototype.invalidatePages = function (pageIdx, Cnt) { + for(var i=0; i=this.pageCount) return cb(undefined); + var curPage = this.getPage(pageIdx); + var getPageFunc = function(){ self.getPageVisualization(pageIdx, cb); }; + if(this.getPageAttr(pageIdx, 'invalidData')) + return this.dataRequest(pageIdx, curPage, cb); + if(this.getPageAttr(pageIdx, 'invalidVisualization')) { + curPage.invalidVisualization = false; + return this.dataVisualizator(this.getStartPageItem(pageIdx), this.getPageItems(pageIdx), curPage, getPageFunc); + } + return cb(this.getPage(pageIdx).target, true); +} + +JSPGC.prototype.getPageItemsCnt = function(pageIdx) { + if(pageIdx<0 || pageIdx>=this.pageCount) return 0; + return (pageIdx==this.pageCount-1 ? (this.itemsCount-pageIdx*this.itemsPerPage) : this.itemsPerPage); +} + +JSPGC.prototype.getItemById = function(itemId) { + var itemsArr = this.getItems(this.getItemIdxById(itemId), 1); + return (itemsArr.length>0) ? itemsArr[0] : undefined; +} + +JSPGC.prototype.getPageByItemId = function(itemId) { + return this.getPageByItemIdx(this.getItemIdxById(itemId)); +} + +JSPGC.prototype.getFirstItem = function () { + if(this.itemsCount) { + var itemsArr = this.getItems(0, 1); + return (itemsArr.length>0) ? itemsArr[0] : undefined; + } else { + return undefined; + } +} + +JSPGC.prototype.invalidateItemView = function (itemId) { + var itemIdx = this.getItemIdxById(itemId); + this.invalidateItemsAttr(itemIdx, 1, 'html'); + var pageIdx = this.getPageByItemIdx(itemIdx); + this.invalidatePagesView(pageIdx, 1); +} + +JSPGC.prototype.invalidate = function () { + this.invalidatePages(0, this.pageCount); +} + + + + + +//////////////////// JSRVC +// requestObj +// request: {uri: someuri, param1: val1, param2: val2, ...} +// [transport: ("GET" | "POST")] +// [target: some_DOM_element] +// [variableRequest: [{param1_1: val1_1, param1_2: val1_2, ...}, +// {param2_1: val2_1, param2_2: val2_2,...}, ...]] +// [form: some_form] +// [onreturn: some_callback] +// [randevu : (true | false)] +// [requestId: some request identity] +// [trailer: specifies the name of parameter which should terminate +// each sub-request of multi-request] + +function JSRVC(requestObj) { + var s = this; + s.requestId = requestObj.requestId || s.generateRequestId(); + s.requestsInProgress = 0; + s.requestsQueue = []; + s.trailer = requestObj.trailer; + s.processRequest(requestObj); +} + +JSRVC.prototype.generateRequestId = function() { + return ((new Date()).valueOf() + Math.random()).toString(); +} + +JSRVC.prototype.processRequest = function(requestObj) { + var s = this; + s.error = undefined; + if(s.requestsInProgress) { + s.requestsQueue.push(requestObj); + return; + } + s.requestObj = requestObj; + if(s.requestObj.pickup && !s.eventCtx) s.eventCtx = JSKW$Events.registerEventCallback(s.eventCtx, function() {s.eventCallback.apply(s, arguments);}, "randevu_answer"); + var req = s.requestObj; + s.preProcessRequest(); + if(!req.transport) + req.transport = req.form ? "POST" : s.getRequestTransport(); + req.target = req.target || document.body; + var onCompleteCB = req.timeout ? function() { + s.startTimeoutTimer.call(s); + } : undefined; + var handlers = {'onload': s.onLoadRequest, 'onreadystatechange': s.onLoadRequest}; + switch(req.transport) { + case "GET": + s.processGETRequest(onCompleteCB, handlers); + break; + case "POST": + s.processPOSTRequest(onCompleteCB, handlers); + break; + } +} + +JSRVC.prototype.preProcessRequest = function() { + var req = this.requestObj; + if(!req.request) req.request = {}; + JSKitLib.fmap(req.epb || {}, function(v, k) { req.request[k] = v; }); + if (req.ref) req.request.ref = req.ref; + req.request.randevuId = this.requestId; + if(!req.variableRequest) req.variableRequest = []; + if(req.pickup) req.request.randevuRnd = Math.random(); +} + +JSRVC.prototype.calcGetRequest = function() { + var s = this; + var req = s.requestObj; + var reqvar = req.variableRequest; + var permGETReq = s.serializeRequest(req.request); + var varGETReq = JSKitLib.fmap(reqvar, function(el, idx){ + return s.serializeRequest(el, '[' + idx + ']'); + }); + return [permGETReq, varGETReq]; +} + +JSRVC.prototype.getRequestTransport = function() { + var ser = this.calcGetRequest(); + var permReq = ser[0]; + var varReq = ser[1]; + var firstReqLen = permReq.length + + (varReq.length>0 ? varReq[0].length : 0); + var totalReqLen = 0; + for(var i=0; i 1700) || (totalReqLen > 3400) ? + "POST" : "GET"); +} + +JSRVC.prototype.startTimeoutTimer = function() { + var s = this; + if(s.timeoutTimer) clearTimeout(s.timeoutTimer); + s.timeoutTimer = setTimeout(function() { s.timeoutExpired(); }, s.requestObj.timeout); +} + +JSRVC.prototype.timeoutExpired = function() { + this.timeoutTimer = undefined; + this.error = "timeout"; + this.returnAnswer(); +} + +JSRVC.prototype.returnAnswer = function(answerData) { + var s = this; + answerData = answerData || {}; + if(answerData.script) { + var script = document.createElement('script'); + script.text = answerData.script; + this.requestObj.target.appendChild(script); + } + if(s.requestObj.onreturn) { + s.requestObj.onreturn.call(s, s.error || "data", answerData.data); + } +} + +JSRVC.prototype.serializeRequest = function(obj, prefix) { + var s = this; + var toString = function(k, v) { + return encodeURIComponent(k) + (prefix || '') + "=" + encodeURIComponent(v); + }; + var request = JSKitLib.fmap(obj, function(v, k) { + if (s.trailer != k) return toString(k, v); + }); + if (s.trailer && typeof(obj[s.trailer]) != "undefined") { + request.push(toString(s.trailer, obj[s.trailer])); + } + return request.join("&"); +} + +JSRVC.prototype.setElementAttributes = function(obj, attrs) { + var s = this; + if (!obj) return; + JSKitLib.fmap(attrs, function(v, k) { + obj[k] = function() { v.call(s, obj) }; + }); +} + +JSRVC.prototype.runScript = function(src, data, handlers) { + var script = document.createElement('script'); + this.setElementAttributes(script, handlers); + script.setAttribute("charset", "utf-8"); + script.setAttribute("src", src + (data ? '?' + data : '')); + this.requestsInProgress++; + this.requestObj.target.appendChild(script); + this.script = script; +} + +JSRVC.prototype.processGETRequest = function(onCompleteCB, handlers) { + var s = this; + var ser = s.calcGetRequest(); + var reqperm = ser[0]; + var reqpermlen = reqperm.length; + var reqvar = ser[1]; + var reqvarlen = reqvar.length; + var currequest = ''; + for(var i=0; i 2000) { + s.runScript(s.requestObj.uri, + reqperm + currequest, handlers); + currequest = ''; + } + } + if((currequest) || (!reqvarlen)) + s.runScript(s.requestObj.uri, + reqperm + '&' + currequest, handlers); + if(onCompleteCB) onCompleteCB(); +} + +JSRVC.prototype.processPOSTRequest = function(onCompleteCB, handlers) { + var s = this; + var req = s.requestObj.request; + var reqvar = s.requestObj.variableRequest; + var reqvarlen = s.requestObj.variableRequest.length; + var createForm = function() { + var iframe = 'js-ifrm-' + Math.random(); + var ifr = JSKitLib.createHiddenIframe(iframe, s.requestObj.target); + var doc = ifr.contentDocument ? ifr.contentDocument : ifr.document; + var f = doc.createElement('FORM'); + f.doc = doc; + if(JSKitLib.isIE()) doc.charset = "utf-8"; + f.target = iframe; + JSKitLib.timedRetry({ + timeout: 100, + maxRetries: 50, + onSuccess: function() { + doc.body.appendChild(f); }, + pred: function() { return !!doc.body; } + }); + return f; + }; + var getForm = function() { + return (s.requestObj.form && !reqvarlen) ? + s.requestObj.form : createForm(); + } + var fillForm = function(form, obj) { + form.method = 'POST'; + form.enctype = "application/x-www-form-urlencoded"; + form.acceptCharset = 'UTF-8'; + form.action = s.requestObj.uri; + JSKitLib.fmap(obj, function(v, k) { + var frmel = (form.doc || document).createElement('INPUT'); + frmel.type = "hidden"; + frmel.name = k; + frmel.value = v; + form.appendChild(frmel); + }); + } + var postRequest = function(pobj, vobj) { + var form = getForm(); + fillForm(form, pobj); + if(vobj) fillForm(form, vobj); + if (form.target) s.setElementAttributes(document.getElementById(form.target), handlers); + JSKitLib.fmap(handlers, function(v, k) { + form[k] = v; + }); + s.requestsInProgress++; + JSKitLib.timedRetry({ + timeout: 100, + maxRetries: 50, + onSuccess: function() { + form.submit(); }, + pred: function() { + return (form.parentNode && + form.parentNode.nodeType!=11); } + }); + } + JSKitLib.fmap(reqvar, function(v) { + postRequest(req, v); + }); + if(!reqvarlen) postRequest(req); + if(onCompleteCB) onCompleteCB(); +} + +JSRVC.prototype.onLoadRequest = function(el) { + var s = this; + if(el.readyState && el.readyState != 'loaded' + && el.readyState != 'complete') return; + el.onreadystatechange = el.onload = null; + if(!s.requestObj.pickup) { + s.requestObj.checked = true; + s.requestsInProgress--; + } + s.postProcessRequest(); +} + +JSRVC.prototype.postProcessRequest = function(source, data) { + var s = this; + if(s.requestObj.pickup && source!="pickup") return; + if(s.requestObj.randevu && !s.error && s.requestObj.transport == "POST") { + s.processRequest({ + 'uri': '//js-kit.com/api/server-answer.js', + 'ref': s.requestObj.ref, + 'epb': s.requestObj.epb, + 'pickup': true, + 'onreturn': s.requestObj.onreturn, + 'target': s.requestObj.target}); + return; + } + s.returnAnswer(data); + if(!s.requestsInProgress) { + if(s.timeoutTimer) { + clearTimeout(s.timeoutTimer); + s.timeoutTimer = undefined; + } + if(s.requestsQueue.length && !s.error) + s.processRequest(s.requestsQueue.pop()); + } +} + +JSRVC.prototype.eventCallback = function(eventName, randevuId, status, data) { + if(this.requestId != randevuId) return; + this.requestsInProgress--; + if(this.script && this.script.parentNode) { + this.script.parentNode.removeChild(this.script); + this.script = undefined; + } + switch(status) { + case "ready": + if(this.eventCtx) { + JSKW$Events.invalidateContext(this.eventCtx); + this.eventCtx = undefined; + } + this.postProcessRequest("pickup", data); + break; + case "timeout": + if(this.error) { + this.returnAnswer(data); + } else { + this.processRequest(this.requestObj); + } + break; + case "exceeded": + this.error = "attempts_number_exceeded"; + this.returnAnswer(); + break; + } +} + +JSRVC.prototype.cancelRequest = function() { + this.error = 'canceled'; +} + + + + + +function JSKitModalDialog(content, config) { + this.config = config; + this.content = content; + this.backdrop = JSKitLib.html('
    '); + this.loadCSS(); + JSKitLib.hide(this.backdrop); + JSKitLib.addChild(document.body, this.backdrop, true); + JSKitLib.setOpacity(this.backdrop, 0.5); +} + +JSKitModalDialog.prototype.open = function() { + if (!this.container) { + var pos = JSKitLib.calcCenterPos(this.config.width, this.config.height); + this.container = JSKitLib.html('
    '); + JSKitLib.addStyle(this.container, + "width: " + this.config.width + "px;" + + "height: " + this.config.height + "px;" + + "left: " + pos[0] + "px;" + + "top: " + pos[1] + "px;"); + JSKitLib.addChild(this.container, this.content); + JSKitLib.addChild(document.body, this.container, true); + } + JSKitLib.show(this.backdrop); + JSKitLib.show(this.container); +} + +JSKitModalDialog.prototype.close = function() { + JSKitLib.hide(this.container); + JSKitLib.hide(this.backdrop); +} + +JSKitModalDialog.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-modal-dialog-container { position: absolute; z-index: 12000; background: #FFFFFF; }" + + ".js-kit-modal-dialog-backdrop { opacity: 0; background-color: #404040; z-Index: 11500; " + + (JSKitLib.isPreIE8() + ? "filter:progid:DXImageTransform.Microsoft.Alpha(opacity='0'); position: absolute; top: expression(eval(-(document.body.offsetTop + (document.body.offsetHeight - document.body.clientHeight)/2))); left: expression(eval(-(document.body.offsetLeft + (document.body.offsetWidth - document.body.clientWidth)/2))); height: expression(eval(Math.max(document.body.offsetHeight, document.documentElement.scrollHeight))); width: expression(eval(Math.max(document.body.offsetWidth, document.documentElement.scrollWidth)));" + : "position: fixed; left: 0; top: 0; height: 100%; width: 100%; -webkit-transition: opacity 0.5s ease-out;" ) + + "", "modalDialog"); +} + + + + + +function JSKitUniversalObject() {} + +JSKitUniversalObject.prototype.applyProperties = function(properties, sourceObject) { + var obj = sourceObject || this; + JSKitLib.fmap(properties || {}, function(value, name) { obj[name] = value; }); +} + +JSKitUniversalObject.prototype.applyConfig = function() { + var self = this; + var args = arguments; + this._config = JSKitLib.foldl({}, ["basic", "local", "global"], function(name, container, idx) { container[name] = args[idx] || {}; }); + return { + "set" : function(key, value) { self._config.local[key] = value; }, + "get" : function(key, defaultValue) { return self._config.local[key] || self._config.global[key] || defaultValue || self._config.basic[key] || ""; } + }; +} + +JSKitUniversalObject.prototype.assemble = function(template, layoutBlocksPrefix, descriptors) { + var content = JSKitLib.html(template); + var components = JSKitLib.mapClass2Object({}, content); + var structure = { + "get" : function(name, noPrefix) { return components[((noPrefix) ? "" : layoutBlocksPrefix + "-") + name]; }, + "content" : content + }; + JSKitLib.fmap(components, function(component, id) { + var pattern = id.match(layoutBlocksPrefix + "-(.*)"); + var descriptor = (pattern) ? pattern[1] : undefined; + if (descriptor && typeof(descriptors[descriptor]) == "function") { + var node = descriptors[descriptor](component); + if (node) component.appendChild(node); + } + }); + return structure; +} + +JSKitUniversalObject.prototype.data2DOM = function(data, target) { + var dom; + switch (typeof(data)) { + case "function" : dom = data(target); break; + case "string" : dom = JSKitLib.html("
    " + data + "
    "); break; + default : dom = data; + } + return dom; +} + +JSKitUniversalObject.prototype.processCallback = function(name, sourceObject) { + var obj = sourceObject || this; + if (obj.callbacks && obj.callbacks.hasOwnProperty(name)) obj.callbacks[name](); +} + +JSKitUniversalObject.prototype.append = function(element, content) { + JSKitLib.removeChildren(element); + element.appendChild(content); + return element; +} + +JSKitUniversalObject.prototype.mergeObjects = function(master, slave) { + return JSKitLib.foldl.call(this, master, slave, function(value, acc, name) { + if (typeof(value) == "object") { + if (!master[name]) master[name] = {}; + this.mergeObjects(master[name], slave[name]); + } else { if (!acc[name]) acc[name] = value; } + }); +} + + + + + +function JSKitUniversalContainer(content, options, callbacks, target) { + if (!target) target = document.createElement("DIV"); + if (!target.parentNode) JSKitLib.addChild(document.body, target, true); + this.config = this.applyConfig({ + "mode" : "popup", + "size" : {"width" : "550", "height" : "500"}, + "title" : "Untitled", + "opacity" : false, + "backdrop" : "yes", + "resizable" : "yes", + "cssPrefix" : "", + "sizeLimit" : {"width" : "550", "height" : "450"}, + "whiteLabel" : false, + "contentOverflow" : "auto" + }, options); + this.applyProperties({ + "target" : target, + "isOpen" : true, + "callbacks" : callbacks || {}, + "imagesPath" : "//cdn.js-kit.com/images/container/" + }); + this.loadCSS(); + this.render(content); +} + +JSKitUniversalContainer.prototype = new JSKitUniversalObject(); + +JSKitUniversalContainer.prototype.render = function(content, title, isRerendering) { + var self = this; + this.applyProperties({ + "title" : title || self.config.get("title"), + "content" : content || document.createElement("DIV") + }); + this.dom = this.assemble(this.template, "jskit-container", this.prepareDescriptors()); + this.append(this.target, this.dom.content); + JSKitLib.addClass(this.target, this.config.get("cssPrefix") + " js-kit-widgetsContainer js-kit-widgetsContainer-" + this.config.get("mode")); + var dimensions = this.config.get("size", { + "width" : self.dom.get("main").offsetWidth, + "height" : self.dom.get("main").offsetHeight + }); + if (!isRerendering) JSKitLib.addStyle(this.target, "width: " + parseInt(dimensions.width) + "px; height: " + parseInt(dimensions.height) + "px;"); + this.dom.get("content").style.overflow = this.config.get("contentOverflow"); + if (this.config.get("whiteLabel")) JSKitLib.hide(this.dom.get("poweredBy")); + + if (this.config.get("mode") == "popup") { + new JSDL(this.target, [this.dom.get("header"), this.dom.get("footer")]); + var opacity = this.config.get("opacity"); + if (opacity) { + this.target.jsk$on_start_drag = function(e) { JSKitLib.setOpacity(this, opacity); }; + this.target.jsk$on_stop_drag = function(e) { JSKitLib.setOpacity(this, "1"); }; + } + if (!isRerendering) { + var calcPos = JSKitLib.calcCenterPos(dimensions.width, dimensions.height); + var pos = this.config.get("position", {x: calcPos[0], y: calcPos[1]}); + JSKitLib.addStyle(this.target, "left: " + parseInt(pos.x) + "px; top: " + parseInt(pos.y) + "px;"); + } + + // make container resizable + if (this.config.get("resizable") == "yes") + this.makeResizableContainer(this.target, this.dom.get("resizeControl"), this.dom.get("content")); + + // display backdrop + if (this.config.get("backdrop") == "yes") { + if (!this.containerBackdrop) { + this.containerBackdrop = JSKitLib.html('
    '); + JSKitLib.addChild(document.body, this.containerBackdrop, true); + } + JSKitLib.show(this.containerBackdrop); + JSKitLib.setOpacity(this.containerBackdrop, 0.3); + } + } + this.processCallback("onContainerOpened"); +} + +JSKitUniversalContainer.prototype.updateTitle = function(title) { + this.append(this.dom.get("title"), this.data2DOM(title || this.config.get("title"))); +} + +JSKitUniversalContainer.prototype.makeResizableContainer = function(target, resizeCtrl, stretchBlock) { + var self = this; + var data; + var limit = this.config.get("sizeLimit"); + var opacity = this.config.get("opacity"); + var useStretchBlock = JSKitLib.isPreIE7() || (JSKitLib.isIE() && document.compatMode == "BackCompat"); + var getMousePos = function(e) { + var scroll = JSDL.prototype.getCurScroll(); + var mousePos = JSKitLib.getMousePosition(e); + return {"x" : mousePos.x + scroll.scroll_left, "y" : mousePos.y + scroll.scroll_top}; + }; + var onStartResize = function(e) { + data = {"pos" : getMousePos(e), "size" : {"width" : target.offsetWidth, "height" : target.offsetHeight}}; + JSKitLib.stopEventPropagation(e); + JSKitLib.preventDefaultEvent(e); + if (opacity) JSKitLib.setOpacity(target, opacity); + JSKitLib.addHandlers(document, onResize, onEndResize); + }; + var onResize = function(e) { + var mousePos = getMousePos(e); + target.style.width = Math.max(limit.width, data.size.width + mousePos.x - data.pos.x) + "px"; + target.style.height = Math.max(limit.height, data.size.height + mousePos.y - data.pos.y) + "px"; + if (useStretchBlock && stretchBlock) stretchBlock.style.width = target.style.width; + JSKitLib.preventDefaultEvent(e); + }; + var onEndResize = function(e) { + data = undefined; + if (JSKitLib.isOpera() || JSKitLib.isIE()) + target.style.width = (((useStretchBlock && stretchBlock) ? stretchBlock : target).offsetWidth - 1) + "px"; + if (opacity) JSKitLib.setOpacity(target, "1"); + JSKitLib.removeHandlers(document, onResize, onEndResize); + }; + JSKitLib.addEventHandler(resizeCtrl, ["mousedown"], onStartResize); +} + +JSKitUniversalContainer.prototype.close = function() { + this.processCallback("onContainerBeforeClose"); + this.target.parentNode.removeChild(this.target); + // Remove backdrop + if (this.containerBackdrop) { + JSKitLib.setOpacity(this.containerBackdrop, 0); + JSKitLib.hide(this.containerBackdrop); + } + this.isOpen = false; + this.processCallback("onContainerClosed"); +} + +JSKitUniversalContainer.prototype.getElement = function(name) { return this.dom ? this.dom.get(name) : false; } + +JSKitUniversalContainer.prototype.prepareDescriptors = function() { + var self = this; + return { + "title" : function() { return self.data2DOM(self.title || self.config.get("title")); }, + "content" : function() { return self.content; }, + "closeButton" : function(element) { self.assembleCloseButton(element); }, + "resizeControl" : function(element) { self.assembleResizeControl(element); }, + "closeButtonImg" : function(element) { if (self.config.get("mode") != "embedded") JSKitLib.addPNG(element, self.imagesPath + "closeWindow.png"); } + }; +} + +JSKitUniversalContainer.prototype.assembleCloseButton = function(element) { + var self = this; + if (this.config.get("mode") != "embedded") { + JSKitLib.notDraggable(element); + element.onclick = function(e) { + self.close(); + JSKitLib.stopEventPropagation(e); + } + } else JSKitLib.hide(element); +} + +JSKitUniversalContainer.prototype.assembleResizeControl = function(element) { + if (this.config.get("mode") != "embedded" && this.config.get("resizable") == "yes") { + JSKitLib.addPNG(element, this.imagesPath + "resizeHandle.png"); + return; + } + JSKitLib.hide(element); +} + +JSKitUniversalContainer.prototype.template = + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
       
    ' + + '
    '; + +JSKitUniversalContainer.prototype.loadCSS = function() { + var oldStyleIE = JSKitLib.isPreIE8() || (JSKitLib.isIE() && !JSKitLib.isPreIE8() && document.compatMode == "BackCompat"); + JSKitLib.addCss( + ".js-kit-containerBackdrop { opacity: 0; background-color: #404040; z-Index: 13800; width: 100%; " + (oldStyleIE ? "filter:progid:DXImageTransform.Microsoft.Alpha(opacity='0'); position: absolute; top: expression(eval(document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + 'px'); right: 0; bottom: 0; height: expression(eval(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)); width: expression(eval(document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth));" : "position: fixed; left: 0; top: 0; height: 100%; -webkit-transition: opacity 0.5s ease-out;" ) + "}" + + ".js-kit-widgetsContainer { " + (oldStyleIE ? "width: " + parseInt(this.config.get("size").width) + "px; height:" + parseInt(this.config.get("size").height) + "px;" : "") + " cursor: default; text-align: left; line-height: normal; color: #000000; font-weight: normal; }" + + "div.js-kit-widgetsContainer a, div.js-kit-widgetsContainer a:visited { background-color: transparent; font-weight: normal; }" + + ".js-kit-widgetsContainer-embedded {}" + + ".js-kit-widgetsContainer-popup { position: absolute; -webkit-box-shadow: 0px 10px 50px #222; " + (JSKitLib.isGChrome() ? "" : "-webkit-border-radius: 7px;") + " z-Index: 14000; }" + + ".jskit-container-main { position: relative; font-family: Helvetica, sans-serif; background: #dfebf2; padding: 0px; " + (JSKitLib.isGChrome() ? "" : "-moz-border-radius: 7px; -webkit-border-radius: 7px;") + " border: 1px solid #C4CFD5; height: 100%; }" + + ".jskit-container-wrapper { " + (oldStyleIE ? "position: relative; border: 0px; height: 100%;" : "position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; border: 5px solid #DFEBF2;") + " -moz-border-radius: 7px; -webkit-border-radius: 7px; }" + + ".jskit-container-header { height: 27px; " + (oldStyleIE ? "margin-top: 5px;" : "") + "}" + + ".jskit-container-title { float: left; font-size: 18px; font-weight: bold; margin: 0px 0px 2px 5px; color: #424242; width: 90%; overflow: hidden; height: 23px; }" + + ".jskit-container-closeButton { width: 18px; height: 18px; float: right; margin: 1px " + (JSKitLib.isIE() ? (JSKitLib.isPreIE7() ? "0" : "5") : "1") + "px 0px; color: #95a0a9; cursor: pointer; }" + + ".jskit-container-closeButtonImg { width: 10px; height: 10px; margin: 4px; }" + + ".jskit-container-content { " + (oldStyleIE ? "zoom: 1; position: relative; height: expression(eval(this.parentNode.offsetHeight - 63) + 'px'); width: expression(eval(this.parentNode.offsetWidth - 10) + 'px'); margin: 0px 5px;" : "position: absolute; top: 0px; bottom: 0px; margin : 32px 0px 25px 0px; width: 100%; -moz-border-radius: 5px;") + " padding: 0px; background: #FFFFFF; }" + + ".jskit-container-footer { " + (oldStyleIE ? "margin-right: 5px;" : "position: absolute; bottom: 0px; right: 0px;") + " width: 100%; }" + + ".jskit-container-footerArea { float: left; }" + + ".jskit-container-poweredBy { float: right; border: 0px; cursor: pointer; font-size: 10px; color: #808080; margin: 6px " + (JSKitLib.isPreIE7() ? "5" : "20") + "px 5px 0px; }" + + "div.jskit-container-poweredBy a, div.jskit-container-poweredBy a:hover { font-size: 10px; color: #808080; text-decoration: none; background-color: transparent; }" + + ".jskit-container-resizeControl { position: absolute; " + (JSKitLib.isPreIE7() ? "top: expression(eval(this.parentNode.offsetHeight - 14) + 'px');" : "bottom: 0px;" ) + " right: 0px; width: 12px; height: 12px; cursor: se-resize; font-size: 10px; }" + + ".js-SettingsWindow { z-index: 16000 !important; }" + + ".js-kit-clear { clear: both; }", "universalContainer"); +} + + + + + +function jskEchoInit(ref, target) { + return (window.JSK$Echo || (window.JSK$Echo = new JSKEcho(ref, target))); +} + +function JSKEcho(ref, target) { + var s = this; + s.ref = ref; + s.target = target; + s.existingRenderers = []; + s.subscribers = []; + s.subscribeRequest = []; + s.uriDomain = '//js-kit.com'; +} + +JSKEcho.prototype.getRendererById = function(rendererId) { + var rs = this.existingRenderers; + var rsl = rs.length; + for(var i=0; i0) ? itemsArr[0] : undefined; +} + +JSKEchoPGC.prototype.getItemIdxById = function (itemId) { + var itemIdx; + for(var i=0; i=0 && Cnt) ? this.items.slice(sIdx, sIdx+Cnt) : []; +} + +JSKEchoPGC.prototype.deleteItem = function (itemId) { + var itemIdx = this.getItemIdxById(itemId); + if(typeof itemIdx == 'undefined') return 0; + + var r = 0; + var self = this; + var item = this.items[itemIdx]; + if(item.obj && item.obj.thread) { + JSKitLib.fmap(item.obj.thread, + function(c) { + r += self.deleteItem(c.ID); + }); + } + if(item.obj && item.obj.status!='D' && item.obj.status!='DT') r++; + if(itemIdx <= this.displayItemIdx) { + this.displayItemIdx--; + var div = item.div; + if(div && div.parentNode) div.parentNode.removeChild(div); + } + this.items.splice(itemIdx, 1); + this.itemsCount--; + return r; +} + +JSKEchoPGC.prototype.getPageByItemId = function(itemId) { + var itemIdx = this.getItemIdxById(itemId); + return (itemIdx <= this.displayItemIdx) || + (!itemIdx && this.displayItemIdx == -1) ? 0 : 1; +} + +JSKEchoPGC.prototype.invalidateItemView = function (itemId) { + var itemIdx = this.getItemIdxById(itemId); + if(itemIdx <= this.displayItemIdx) { + delete this.items[itemIdx].html; + this.invalidVisualization = true; + } +} + +JSKEchoPGC.prototype.invalidatePagesView = function (pageIdx, Cnt) { + if(!pageIdx) this.invalidVisualization = true; +} + +JSKEchoPGC.prototype.getFirstItem = function () { + if(this.itemsCount) { + var itemsArr = this.getItems(0, 1); + return (itemsArr.length>0) ? itemsArr[0] : undefined; + } else { + return undefined; + } +} + +JSKEchoPGC.prototype.getPageItemsCnt = function(pageIdx) { + return pageIdx ? undefined : this.displayItemIdx + 1; +} + +JSKEchoPGC.prototype.invalidate = function () { + this.invalidData = true; + this.invalidVisualization = true; + this.items = []; + this.itemsCount = 0; + this.displayItemIdx = -1; +} + +JSKEchoPGC.prototype.getItemsToDisplay = function () { + return this.getItems(0, this.displayItemIdx + 1); +} + +JSKEchoPGC.prototype.getPageVisualization = function (pageIdx, cb) { + var self = this; + var getPageFunc = function(){ self.getPageVisualization(pageIdx, cb); }; + var getMore = (this.itemsPerPage + this.displayItemIdx) >= this.itemsCount && pageIdx && this.echo_after ? true : false; + if(this.invalidData || getMore) { + this.invalidVisualization = true; + return this.dataRequest(0, getMore, this.echo_after, cb); + } + if(this.invalidVisualization || pageIdx) { + this.displayItemIdx = this.itemsCount-1; + this.invalidVisualization = false; + return this.dataVisualizator(this.getItemsToDisplay(), getPageFunc); + } + return cb(this.target, true); +} + +JSKEchoPGC.prototype.getPlaceIdxByTS = function(TS) { + var items = this.getItems(0, this.itemsCount); + for(var i=0; i=items[i].obj.TS) return items[i].obj.ID; + } + return 0; +} + +JSKEchoPGC.prototype.newItem = function(item) { + var newItem = { obj: undefined, html: undefined, div: undefined }; + if(item) JSKitLib.fmap(item, function(V,K){ newItem[K] = V; }); + return newItem; +}; + +JSKEchoPGC.prototype.addNewItem = function (obj, itemId, isPrepend) { + var item = this.newItem({'obj': obj}); + var itemIdx = itemId ? this.getItemIdxById(itemId) + (isPrepend ? 0 : 1) : this.itemsCount; + this.items.splice(itemIdx, 0, item); + this.itemsCount++; + if(itemIdx<=this.displayItemIdx || + (!obj.paginated && itemIdx==this.displayItemIdx+1) || + (!itemIdx && this.displayItemIdx == -1)) { + this.displayItemIdx++; + this.invalidVisualization = true; + } +} + +JSKEchoPGC.prototype.newData = function (newData, echo_after) { + var s = this; + s.$old_echo_after = s.echo_after; + s.echo_after = echo_after; + JSKitLib.fmap(newData, function(o) { + var itemIdx = s.getItemIdxById(o.ID); + if(typeof itemIdx != 'undefined') { + JSKitLib.fmap(s.items[itemIdx].obj, function(v, k){ + s.items[itemIdx].obj[k] = o[k]; }); + if(itemIdx<=s.displayItemIdx) { + delete s.items[itemIdx].html; + s.invalidVisualization = true; + } + } else { + s.items[s.itemsCount++] = s.newItem({'obj': o}); + } + }); + this.displayItemIdx = this.itemsCount - 1; + this.invalidData = false; + this.loading = false; +} + + + + + +if(!window.JSFSearch) JSFSearch = { threshold: 0.9 }; + +JSFSearch.get_hash_list = function(s) { + return s.split(/[ \t]+/); +} + +JSFSearch.normalize = function(s) { + return s.toLowerCase().replace(/<\/wbr>/g, '').replace(/<[^<]*>/g,' '); +} + +JSFSearch.make_hash = function(s) { + var hash_list = JSFSearch.get_hash_list(JSFSearch.normalize(s)); + var hash_length = JSKitLib.foldl(0, hash_list, + function(v, acc){ return acc + v.length }); + return {'hash_length': hash_length, 'hash_list': hash_list.sort()}; +} + +JSFSearch.get_hash_info = function(obj) { + if(!obj.$hash_info) + obj.$hash_info = JSFSearch.make_hash(obj.Text); + return obj.$hash_info; +} + +JSFSearch.compare_hash_lists$ = function(hash1, hash2, cnt1, cnt2, matched_count, mismatched1, mismatched2) { + var hl1 = hash1.length; + var hl2 = hash2.length; + if(cnt1 >= hl1 && cnt2 >= hl2) + return {'matched_count': matched_count, + 'mismatched1': mismatched1, 'mismatched2': mismatched2}; + if(cnt1 >= hl1) { + mismatched2.push(hash2[cnt2]); + cnt2++; + } else + if(cnt2 >= hl2) { + mismatched1.push(hash1[cnt1]); + cnt1++; + } else + if(hash1[cnt1] == hash2[cnt2]) { + matched_count += hash1[cnt1].length; + cnt1++; + cnt2++; + } else + if(hash1[cnt1] <= hash2[cnt2]) { + mismatched1.push(hash1[cnt1]); + cnt1++; + } else { + mismatched2.push(hash2[cnt2]); + cnt2++; + } + return JSFSearch.compare_hash_lists$(hash1, hash2, cnt1, cnt2, + matched_count, mismatched1, mismatched2); + +} + +JSFSearch.compare_hash_lists = function(hash1, hash2) { + return JSFSearch.compare_hash_lists$(hash1, hash2, 0, 0, 0, [], []); +} + +JSFSearch.get_avg = function(hash) { + var flat_list = hash.join(''); + var sum = 0; + var len = flat_list.length; + for(var i=0; i 0) { + l--; + if(l>=l1) calc_summs(0, avg2.list.charCodeAt(l)) + else if(l>=l2) calc_summs(avg1.list.charCodeAt(l), 0) + else calc_summs(avg1.list.charCodeAt(l),avg2.list.charCodeAt(l)); + } + return {'sum1': sum1, 'sum2': sum2, 'sum3': sum3}; +} + +JSFSearch.calc_distance = function(hash1, hash2) { + var avg_info1 = JSFSearch.get_avg(hash1); + var avg_info2 = JSFSearch.get_avg(hash2); + var sums = JSFSearch.corr_coeff(avg_info1, avg_info2); + return ((sums.sum2 < 0.1 || sums.sum3 < 0.1) ? 0 : + sums.sum1/Math.sqrt(sums.sum2)/Math.sqrt(sums.sum3)); +} + +JSFSearch.compare_hashes = function(hash1, hash2) { + var hl1 = hash1.hash_length; + var hl2 = hash2.hash_length; + if(hl1 == 0 && hl2 == 0) return 1; + var compare_info = JSFSearch.compare_hash_lists(hash1.hash_list, + hash2.hash_list); + var total_len = (hl1 + hl2) / 2; + var matched_pcnt = compare_info.matched_count / total_len; + if(total_len - compare_info.matched_count < 0.1) return 1; + if(compare_info.matched_count < total_len/2) return 0; + if(matched_pcnt > JSFSearch.threshold) return 0.99; + if(matched_pcnt > 0.75 && compare_info.matched_count > hl1 * 0.9) + return 0.99; + if(matched_pcnt > 0.75 && compare_info.matched_count > hl2 * 0.9) + return 0.99; + return (matched_pcnt + + Math.abs(JSFSearch.calc_distance( + compare_info.mismatched1, compare_info.mismatched2)) * + (total_len - compare_info.matched_count) / total_len); +} + +JSFSearch.compare_obj = function(obj1, obj2) { + return (JSFSearch.compare_hashes(JSFSearch.get_hash_info(obj1), + JSFSearch.get_hash_info(obj2)) > JSFSearch.threshold); +} + +JSFSearch.search = function(items, obj) { + if(!obj.event_publisher || obj.ParentID || obj.depth || !obj.Text) + return obj.ParentID; + for (var i=0; i=0; i--) { + var fName = jovs[i][0]; + var func = jovs[i][1]; + this[fName] = func; + } + } + } else { + if(!document.body){ + alert($JCL("savingScriptMessage")); + return; + } + JSKitLib.preloadImg('//cdn.js-kit.com/images/loading-yellow.gif'); + + var request = { + base_uri: JSCC.URI + 's-data.js', + trailer: 'jx', + extra_params: this.comment_location ? {'jsid': this.comment_location} : {} + }; + JSKitLib.initWidgets('comments', request, function(div) { + var obj = new JSCC(div, {'config': {'noDataRequest': true}}); + var params = groupSingleRequestParams(obj); + obj.singleRequestParams = params; + return obj; + }); + + JSKitLib.fmap([ + 'comment-deleting', + 'comment-deleted', + 'comment-added', + 'comments-data-loaded', + 'comments-count-updated' + ], function(e) { + JSKitAPI.subscribe(e, function(eventName, eventParams) { + $JCA[eventParams.jcaIndex].eventsHandler(eventName, eventParams); + }); + }); + JSKitLib.fmap({ + 'JSKitAuth_logout': 'user-logout', + 'JSKitAuth_success_login': 'user-login' + }, function(v, k) { + JSKW$Events.registerEventCallback(undefined, function() { + JSKitAPI.publish(v, {"nofocus": false}); + }, k); + }); + + return; + } + target.jsk$initialized = true; + target.className = idName; + target.id = ""; + + // Handling user configuration settings + this.config = JSKitLib.readConfig("comments", + target, + this.config, + 'path', + 'display-mode', + ['standalone', 'no'], + ['scoring', 'yes'], + 'paginate', + 'backwards', + ['disabled', 'no'], + 'domain', + ['sort', ['date','karma','name','status','rating']], + ['thread', ['yes','no']], + 'adminBgColor', + 'flashColor', + 'moderate', + 'permalink', + 'skin', + 'noautoexpand', + 'label', + ['smiles', 'no'], + ['editable', 'no'], + ['thread-title', $JCL("defaultThreadTitle")], + 'popup-title', + 'popup-width', + 'popup-height', + 'include-sources', + 'exclude-sources', + ['page-title', document.title] + ); + if (!this.config.backwards) { + if (this.config.paginate) + this.config.backwards = 'yes'; + else + this.config.backwards = this.config.nolc && !this.IM ? 'yes' : 'no'; + } + this.uniq = this.config.path; + this.pathOverride = this.config.path; + this.sourceFilter = initSourceFilter(this.config); + this.config.thread = this.config.nolc && !this.IM ? 'no' : this.config.thread; + this.config.domain = this.config.moderate || this.config.domain; + this.config.noautoexpand = this.config.noautoexpand == 'yes'; + + self.target = target; + + this.server = function(ext, data, ajax, rvcparams) { + if((self.serverFilter && !self.serverFilter(ext)) || self.config.disabled == 'yes') return; + + // ensure window.location is current (re:blogspot) + var wl = window.location; + var prms = data; + JSKitLib.fmap(((extra||{})['sargs']||{}), + function(v, k){ prms[k] = v; }); + var getAction = function(scr) { + return scr.match(self.uriDomain) ? wl.protocol + scr : wl.protocol + self.uri + scr; + }; + var action = getAction(ext); + var so = this.serverOptions; + prms = JSKitLib.appendExternalParams("comments", ext, prms); + prms.p = this.pathOverride; + prms.nonce = so && so.nonce || ""; + prms['page-title'] = self.config['page-title']; + var req = { + uri: action, + ref: JSKitLib.getRef(self), + epb: JSKitEPB.getAsHash({}), + request: prms, + target: self.target, + randevu: !!ajax + }; + if (rvcparams) JSKitLib.fmap(rvcparams, function(v, k) { req[k] = v; }); + new JSRVC(req); + } + + this.getpages = function(sp, ap) { + self.loading = (new Date()).valueOf(); + var prms = {}; + JSKitLib.fmap(groupSingleRequestParams(self, {sp: sp}), function(v, k) {prms[k + "[0]"] = v;}); + if(ap) JSKitLib.fmap(ap, function(v,k){ prms[k] = v ;}); + self.server("s-data.js", prms); + } + + JSKitLib.fmap(['user-login', 'user-logout'], function(e) { + JSKitAPI.subscribe(e, function(eventName, eventParams) { + self.eventsHandler(eventName, eventParams); + }); + }); + + if (!this.config.noDataRequest) this.getpages(); +} + +JSKitLib.addCss('' ++ '.js-WelcomePanel { margin: 0px 0px 10px 0px; font: 12px Arial; text-align: left; }' ++ '.js-WelcomePanelBottom { margin: 10px 0px 0px 0px; }' ++ '.js-WelcomePanelTitle { padding-left: 7px; border-bottom: 1px solid #d1bea4; background: #e4d0b3; color: #fff; font: 14px Arial; font-weight: bold; line-height: 21px; }' ++ '.js-WelcomePanelClose { height: 21px; width: 20px; float: right; cursor: pointer; position: relative; top: 7px; ' + (JSKitLib.isIE() ? 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="//cdn.js-kit.com/images/welcome/close.png", sizingMethod="crop")' : 'background: no-repeat url(//cdn.js-kit.com/images/welcome/close.png);') + ' }' ++ '.js-WelcomePanelContent { padding: 18px 20px; background-color: #fffae4; color: #2e2e30; line-height: 21px; ' + (JSKitLib.isIE() ? 'zoom: 1' : '') + ' }' ++ '.js-WelcomePanelContentBlock a, .js-WelcomePanelContentBlock a:link, .js-WelcomePanelContentBlock a:visited, .js-WelcomePanelContentBlock a:hover, .js-WelcomePanelContentBlock a:active { text-decoration: none; color: #2e2e30; font: 12px Arial; white-space: nowrap; }' ++ '.js-WelcomePanelContentBlock a:hover, .js-WelcomePanelContentBlock a:active { text-decoration: underline; }' ++ '.js-WelcomePanelHeader { font: 16px Arial; font-weight: bold; color: #2e2e30; padding: 0px; line-height: 20px; ' + (JSKitLib.isIE() ? 'zoom: 1' : '') + ' }' ++ '.js-WelcomePanelContentBlock { float: left; padding-bottom: 5px; ' + (JSKitLib.isIE() ? 'zoom: 1' : '') + '}' ++ '.js-WelcomePanelContentBlock table img { vertical-align: middle; }' ++ '.js-WelcomePanelCtls { float: left; text-align: center; margin-top: 9px; line-height: 15px; }' ++ '.js-WelcomePanelCtls a, .js-WelcomePanelCtls a:active, .js-WelcomePanelCtls a:visited, .js-WelcomePanelCtls a:hover { color: #2e2e30; font: 11px Arial; }' ++ '.js-WelcomePanelArrow { height: 12px; }' ++ JSKitLib.fmap({Info: 'information', Reg: 'pencil', Profile: 'edit_profile', Help: 'help', Custom: 'bullet_wrench', Dashboard: 'dashboard', Twitter: 'twitter', Support: 'support', Widgets: 'widgets', Panel: 'admin_panel' }, function(v, k) { + var paddingTop = (k == 'Info' || k == 'Reg' ? 4 : 1); + var paddingLeft = (k == 'Info' || k == 'Reg' ? 23 : 25) - (JSKitLib.isIE() ? 2 : 0); + return '.js-WelcomeImg' + k + ' { height: 16px; line-height: 16px; padding: ' + paddingTop + 'px 0px 0px ' + paddingLeft + 'px; float: left; ' + (JSKitLib.isIE() ? 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="//cdn.js-kit.com/images/welcome/' + v + '.png", sizingMethod="crop");' : 'background: url(//cdn.js-kit.com/images/welcome/' + v + '.png) no-repeat left center;') + ' }'; +}).join('') +, 'welcome'); + +JSKitLib.addCss("" ++ ".js-CommentsSkin-smoothgray .js-commentInputName { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-commentInputEmail { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-commentInputUrl { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-AuthAreaWrap { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-CCButtons { margin: 0.3em 0 0.5em 5px; width: 100%;" + (JSKitLib.isIE() ? "zoom: 1; " : "") + "}" ++ ".js-authSelector { float: left; margin-bottom: 5px; }" ++ ".js-logoutSpan { display:none; margin-left: 5px;" + (JSKitLib.isIE() ? "zoom: 1; " : "margin-top: 3px; ") + "}", "AuthAreaWrap"); + +// Optionally leave all CSS up to template +if (!window.$JSKitNoCommentCss) { + JSKitLib.addCss('' + + ".js-OldComments { margin-bottom: 1px; clear:both;}" + + ".js-LeaveComment { margin: 5px 0 0 5px; }" + + ".js-CreateComment, .js-EditComment { text-align: left; display: none; }" + + ".js-commentInputUrl { display: none; }" + + ".js-CCMore { padding-left: 3px }" + + ".js-commentOptions { float: left; }" + + ".js-commentPubOptions { float: left; padding: 2px 5px; }" + + ".js-commentShareCheckbox { float: left; margin: " + (JSKitLib.isIE() ? "-3px" : "1px") + " 0 0 5px; }" + + ".js-commentShareLabel { margin: 1px 3px 0 3px; line-height: 13px; float: left; }" + + ".js-commentYahooShareLabelLogo {margin: 1px 0 0 0; float: left; width: 49px; height: 13px; " + (JSKitLib.isIE() ? 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="//cdn.js-kit.com/images/yahoo/yoslogo.png", sizingMethod="crop");' : 'background: no-repeat url(//cdn.js-kit.com/images/yahoo/yoslogo.png);') + " }" + + ".js-commentSubmit { text-align: right; }" + + ".js-CreateCommentBg { margin: 1em; padding: 0.5em; border: solid 1px #c0c0c0; text-align: left; float: left; }" + + ".js-EditComment .js-CreateCommentBg { float: none; border: none; padding: 0; }" + + ".js-CreateCommentArea { -moz-border-radius: 7px; -webkit-border-radius: 7px; padding: 5px 5px 5px 9px; }" + + ".js-CommentsArea .js-CreateCommentArea { background-color: #cbcbcb; }" + + ".js-OldComments { background-color: transparent; }" + + ".js-CreateCommentFieldsWrap { margin-left: -4px; background-color: #ececec; border: solid 1px #b0b0b0; padding: 4px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }" + + '.js-CreateCommentFields {zoom: 1; color: #404040; background-color: #e8e8e8; padding: 4px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }' + + ".js-PageNavTop { margin-bottom: 3px; }" + + ".js-PageNavBottom { margin-top: 3px; clear: both; }" + + ".js-PageNOther { text-decoration: none; }" + + ".js-PageNCur { font-weight: bold; }" + + ".js-PageArrowCur { opacity: 0.3; zoom:1; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); }" + + ".js-commentFieldSubject { font-weight: bold; margin-bottom: 5px;}" + + ".js-commentFieldLabel { margin-top: 5px; clear:both; margin-right: 0.5em;}" + + ".js-pmFieldLabel { margin-top: 5px; clear:both; margin-right: 0.5em; text-align: left;}" + + ".js-commentFieldNote { font-family: Verdana; font-size: 7pt; color: #808080; }" + + ".js-siteAdmin { font-weight: bold; }" + + ".js-singleComment { zoom: 1; font-size: 8pt; font-family: Verdana, Helvetica; border: solid 1px #c0c0c0; text-align: left; margin-bottom: -1px; }" + + ".js-singleCommentBg { zoom: 1; padding: 0.3em; }" + + ".js-singleCommentCheckbox { float: left; margin: " + (JSKitLib.isIE()?"0":"2") + "px 2px 0px 0px; width: 16px; height: 16px; cursor: pointer; }" + + '.js-singleCommentHeader { color: #484848; margin: 3px 0; }' + + '.js-singleCommentBody { clear: both; color: #404040; background-color: #fefefe; padding: 4px 4px 4px 8px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }' + + 'table.js-singleCommentBodyT { margin: 0; padding: 0; font-family: Verdana, Helvetica; text-align: left; font-size: 8pt; color: #404040; }' + + '.js-singleCommentQuote { position:relative; top: 4px; font-family: "Times New Roman"; font-size: 32px; line-height: 24px; padding-right: 1px; display: none; }' + + ".js-singleCommentINFO { color: #808080; float: right; padding: 3px; margin-left: 2em; text-align: right;}" + + ".js-singleCommentAvatar { float: right; }" + + ".js-singleCommentAvatarCell { text-align: right; }" + + ".js-singleCommentText { padding-top: " + (JSKitLib.isIE()?"0":"4") + "px; }" + + ".js-singleCommentName { font-weight: bold; text-decoration: underline; }" + + ".js-singleCommentUrl { margin: 0px 0px 0px 2px; padding: 0px; border: 0px; width: 10px; height: 10px; display: none; vertical-align: top; }" + + ".js-singleCommentDate { font-size: 7pt; }" + + ".js-singleCommentOrigin { display: inline; bottom: 0.3em; font-size: 7pt; color: #808080; }" + + ".js-singleCommentKarmaComMod { clear: both; }" + + ".js-singleCommentKarma { float: left; font-size: 7pt; color: #808080; margin-right: 1em; padding-top: 3px; }" + + ".js-singleCommentKarmaShow { float: left; font-size: 7pt; color: #808080; margin-right: 2em; padding-top: 3px; display: none; }" + + ".js-singleCommentKarmaScore { display: none; }" + + ".js-singleCommentComMod { float: left; font-size: 7pt; color: #808080; display: inline; padding-top: 3px; margin-right: 1em; }" + + ".js-singleCommentCtls { float: right; white-space: nowrap; }" + + ".js-singleCommentMenu { float: left; margin: -4px 15px 0px 0px; " + (JSKitLib.isIE() ? "zoom: 1; " : "") + " white-space: nowrap; }" + + ".js-singleCommentControl, .js-singleCommentKarmaY, .js-singleCommentKarmaN { cursor: pointer; }" + + ".jskit-MenuTitle { cursor:pointer; padding: 3px; white-space: nowrap; color: #476cb8; font-size: 11px; width: 100%; }" + + ".jskit-MenuTitleMO { }" + + ".jskit-MenuTitlePressed { }" + + ".jskit-MenuTitleExpandMarker { width: 16px; height: 16px; margin: 1px 0px 0px -2px; }" + + ".jskit-MenuContainer { border: 1px solid #D6E2E9; background-color: #FFFFFF; cursor:pointer; position: absolute; margin-left: -2px; -moz-border-radius: 4px; -webkit-border-radius: 4px; z-index: 20000;}" + + ".jsk-MenuAdmin td, .js-kit-miniProfile-addAnotherSite td, .jskit-MenuContainer td, .js-singleCommentMenu td, .jsk-HeaderPauseBox td { padding: 0px !important; vertical-align: middle !important; border-collapse: separate !important; border: 0px solid !important;}" + + ".jsk-MenuAdmin table, .js-kit-miniProfile-addAnotherSite table, .jskit-MenuContainer table, .js-singleCommentMenu table, .jsk-HeaderPauseBox table { margin: 0px !important; border-collapse: separate !important; border: 0px solid !important; width: auto !important; }" + + ".jskit-MenuRootContainer { margin: 2px 0px 0px -3px; }" + + ".jskit-MenuRootHTML { float: left; height: 2em; }" + + ".jskit-MenuItem { border: 1px 0px solid #FFFFFF; line-height: 14px; }" + + ".jskit-MenuItemIcon { width: 16px; height: 16px; margin: 4px 6px;" + (JSKitLib.isIE() ? " zoom: 1;" : " float: left;" ) + " }" + + ".jskit-MenuItemCheckboxCnt, .jskit-MenuItemRadioCnt { height: 24px; width: 65px; float: left; white-space: nowrap; margin: 0px; line-height: 14px;" + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" + + ".jskit-MenuItemTitle { margin: 5px 20px 4px 0px; color: #000000; font: 12px Arial; text-decoration: none; white-space: nowrap; zoom: 1;}" + + ".jskit-MenuItemEnding { height: 16px; margin: 2px; font-size: 14px; color: #000000; display: inline; font-family: Arial; }" + + "div.jskit-AvatarMenuItemEnding { display: block; margin: 1px 3px; }" + + ".jskit-MenuItemMO { background-color: #EDEDED; }" + + ".jskit-MenuItemMO .jskit-MenuDeleteButton { visibility: visible; }" + + ".jskit-MenuDelimeter { margin: 2px 0px; height: 1px; width: 100%; background-color: #CCCCCC; font-size: 1px; width: 100%; }" + + ".jskit-MenuItemInput { line-height: 16px; font: 12px Arial; padding: 0px; border: 1px solid #AAAAAA; height: 16px; margin: " + (JSKitLib.isIE() ? "3px" : "3px") + " 0px; width: 120px; position: absolute; }" + + ".jskit-MenuItemCheckbox, .jskit-MenuItemRadio { margin: 4px 4px 4px 10px; padding: 0px 8px; line-height: 16px; height: 16px; float: left; }" + + ".jskit-MenuDeleteButton { width: 16px; height: 16px; margin: 7px 0px 0px 2px; display: block; visibility: hidden; }" + + 'div.js-singleCommentEdit, div.js-singleCommentReply, div.js-singleCommentDelete, div.js-singleCommentModerate { background: right top url(//cdn.js-kit.com/images/button-clear.png) no-repeat; height: 16px; font-size: 8pt; line-height: 9px; color: #404040; cursor: pointer; float: left; margin: 0 0.5em 0 4px; }' + + 'div.js-singleCommentEdit div, div.js-singleCommentReply div, div.js-singleCommentDelete div, div.js-singleCommentModerate div { background: left top url(//cdn.js-kit.com/images/button-clear.png) no-repeat; height: 16px; padding: 2px 4px 0px 5px; position: relative; left: -1px; float: left; }' + + ".js-kit-lcf-miniProfile { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-singleCmtProfileEnabled .js-kit-miniProfile-avatar, .js-kit-singleCmtProfileEnabled .js-kit-miniProfile-stats, .js-kit-singleCmtProfileEnabled .js-kit-miniProfile-viewDetails, .js-kit-singleCmtProfileEnabled .js-kit-miniProfile-name { cursor: pointer; }" + + ".js-kit-lcj-miniProfile-name-ipe { cursor: text; }" + + ".js-kit-singleCmtProfileDisabled .js-kit-miniProfile-viewDetails { display: none; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfileNameWrap { padding-bottom: 5px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-name, .js-kit-lcf-miniProfile .js-kit-miniProfile-siteLinksIcons { float: left; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfileSitesWrap { border-top: 2px dotted #E4E4E4; padding-top: 5px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-addAnotherSite { float: left; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "margin: 1px 0px 0px 0px; cursor: pointer; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-addAnotherSite span.text { color: #0066CC; margin-right: 5px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-siteLinksIcons { border: 0px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-name-ipe { margin-right: 70px; height: 24px; line-height: 20px; font-size: 16px; border: 0px; outline: 0px;}" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-logout { " + (JSKitEPB.isExists() ? "display: none" : "float: right; margin: 1px 0px 0px -70px; cursor: pointer; color: #0066CC; font-size: 10px;") + "}" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-logoutIcon { float: left; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " margin: 2px 0px 0px 5px; padding: 0px 5px; font-size: 8px; width: 10px; height: 10px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-logoutLink { float: left; " + (JSKitLib.isIE() ? "zoom: 1; padding-bottom: 2px;" : "") + " }" + + ".js-kit-lcf-extraControlsMenuWrapper { float: left; }" + + ".js-kit-relative { position: relative; }" + + ".js-CreateComment .js-kit-tabs-singleTab { display: block; }" + + ".js-CreateComment .js-kit-tab { padding: 5px 0px 5px 0px; margin-right: 20px; background: transparent; cursor: pointer; }" + + ".js-CreateComment .js-kit-tab-title { color: #0066CC; }" + + ".js-CreateComment .js-kit-tab .js-kit-tab-expandMarker { float: left; width: 16px; height: 16px; }" + + ".js-kit-lcf-extraControlsMenuContent { border: 1px solid #BBBBBB; background: #FFFFFF; margin-top: 10px; color: #3a3a3a;}" + + ".js-kit-images-wrapper, .js-kit-follow-wrapper { padding: 10px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-images-form { margin: 20px 0px; }" + + ".js-kit-images-form .js-uploadImageForm { display: inline; }" + + ".js-kit-images-form .js-uploadImageInputLabel { display: inline; margin-right: 5px; font-size: 12px; }" + + ".js-kit-images-form .js-kit-images-imgSizeSpec { display: none; }" + + ".js-kit-follow-openingProfile { cursor: default; text-decoration: none; }" + + ".js-kit-follow-activeNotifyMode-noemail { background: none; }" + + ".js-kit-follow-activeNotifyMode-email, .js-kit-follow-activeNotifyMode-anymails { background: #fffea9; }" + + ".js-kit-follow-notifyOptionRadio { float: left; width: 16px; height: 16px; cursor: pointer; }" + + ".js-kit-follow-notifyOptionLabel { float: left; margin-left: 3px; font-size: 12px; cursor: pointer; }" + + ".js-kit-follow-emailAddress { margin: 0px 5px; }" + + ".js-kit-follow-leftColumn { float: left; margin-right: -26px; position: relative; width: 26px; }" + + ".js-kit-follow-rightColumnWrapper { float: left; width: 100%; }" + + ".js-kit-follow-rightColumn { margin-left: 26px; }" + + ".js-kit-follow-emailContainer { " + (JSKitLib.isPreIE8() ? "zoom: 1; margin-left: 5px;" : "") + " font-size: 12px; margin-bottom: 10px; }" + + ".js-kit-follow-rssContainer { " + (JSKitLib.isPreIE8() ? "zoom: 1;" : "") + " }" + + ".js-kit-follow-rightSubColumn { float: right; position: relative; margin-left: -95px; width: 85px; }" + + ".js-kit-follow-leftSubColumnWrapper { float: right; width: 100%; }" + + ".js-kit-follow-leftSubColumn { margin-right: 95px; }" + + ".js-kit-follow-notifyModeSelector { margin: 5px 0px; }" + + ".js-kit-follow-rssThreadButton { padding: 0px; margin-left: 5px; cursor: pointer; }" + + ".js-kit-follow-label { font-size: 12px; font-weight: bold; }" + + ".js-kit-follow-emailIcon, .js-kit-follow-rssIcon { width: 16px; height: 16px; }" + + ".js-kit-follow-input { width: " + (JSKitLib.isIE() ? "98%" : "100%") + "; }" + + ".js-kit-exp-banner-container { background: #fffac3; border: 1px solid #fee747; position: absolute; z-index: 20100; width: 320px; height: 200px; margin: 0px; padding: 15px 20px; font-size: 12px; line-height: 120%; text-align: left; }" + + ".js-kit-exp-banner-header { margin-bottom: 10px; text-align: center; }" + + ".js-kit-exp-banner-title { font-weight: bold; }" + + ".js-kit-exp-banner-label { font-weight: bold; margin-right: 5px; }" + + ".js-kit-exp-banner-button-container { text-align: center; margin-top: 20px; }" + + ".js-kit-exp-banner-button { background-color: transparent; background-image: url('//cdn.js-kit.com/images/common/continue.png'); border: none; cursor: pointer; margin: 0; padding: 0; width: 112px; height: 39px; }" + + ".js-kit-replies-expand-container { padding: 10px 0px; cursor: pointer; text-align: center; background: url(//cdn.js-kit.com/images/replies-expand-bg.png) repeat-x center; }" + + ".js-kit-replies-expand-wrapper { display: inline; padding: 0px 10px; }" + + ".js-kit-replies-expand-label { display: inline; background: url(//cdn.js-kit.com/images/whirlpool-comments.png) center left no-repeat; padding-left: 15px; }" + + ".js-singleCommentNotice { color: #ff0000; font-size: 8pt; }" + + ".js-commentControl { float: left; margin-right: 2em; }" + + '.js-commentFieldInput { border: solid 1px #7f99b9; width:' +(JSKitLib.isPreIE7()?'98%':'100%')+';}' + + '.js-commentFieldInputProfile { border: solid 1px #7f99b9; width:' +(JSKitLib.isIE()?'98%':'100%')+' !important;}' + + ".js-CmtButton { margin-right: 0.5em }" + + ".js-CCButtons { margin: 0.3em 0 0.5em 0 }" + + ".js-CCButtons INPUT { font-size: 8pt; }" + + ".js-poweredBy { margin-top: 2pt; color: #808080; font-size: 7pt; font-family: Verdana, Helvetica; }" + + ".js-poweredBy A, .js-poweredBy A .js-poweredBy-text { text-decoration: none; color: #8080a0 !important; cursor: pointer; }" + + ".js-antispamBy { text-align: right; }" + + ".js-Progress { position: absolute; visibility: hidden; right: 5px; top: 5px; width: 15px; height: 15px; }" + + ".js-SettingsWindow { padding: 0.3em; border: solid 1px #cccccc; color: #404040; white-space: normal; font-family: Verdana, Helvetica; font-size: small; z-index: 400; }" + + ".js-SettingsWindowNolc { z-index: 14400 }" + + ".js-SettingsWindowHeader { text-align:center; padding: 5px 0; margin-bottom: 5px; background-color: #e6e9ec; font-size: 10pt; font-family: Verdana, Helvetica; color: #435362}" + + ".js-ControlBlockText, .js-ControlBlockTextDisabled {font-size: 8pt; text-align: left;}" + + ".js-ControlBlockButton {font-size: 8pt;}" + + ".js-ControlBlockTextDisabled {color: #808080}" + + ".js-showBorder {border:ridge 2px #a0a0a0;}" + + ".js-hideBorder {border:solid 2px #fefefe;}" + + ".js-SearchTitle {margin-right: 5px;}" + + ".js-SearchWords {padding: 0px; margin-right: 5px; border-bottom: 1px dashed #0000ff}" + + ".js-uploadAvatarForm {margin-top: 0px;}" + + ".js-singleCommentConversationHead {padding: 0.3em; " + (JSKitLib.isIE() ? "margin-top: 36px !important;" : "margin-top: 26px !important;") + "}" + + ".js-singleCommentConversationChild {padding: 0.3em; margin-top: -1px !important}" + + ".js-Conversation {padding: 0.3em; position: relative; top: -20px; display: inline; }" + + ".js-ConversationWrapper { height: 0px; " + (JSKitLib.isIE() ? "overflow: hidden;" : "") + "}" + + ".js-TornPageTop { margin-left: -5px; margin-right: -5px; " + (JSKitLib.isIE() ? "height: 6px;" : "height: 11px; margin-top: -5px; background: url(//cdn.js-kit.com/images/tornPaperT.gif) no-repeat;") + " }" + + ".js-TornPageBottom { margin-left: -5px; margin-right: -5px; " + (JSKitLib.isIE() ? "height: 6px;" : "height: 11px; margin-bottom: -5px; background: url(//cdn.js-kit.com/images/tornPaperB.gif) no-repeat;") + " }" + + ".js-TornPageTopImg { " + (JSKitLib.isIE() ? (JSKitLib.isPreIE7() ? "position: absolute;" : "float: left;") : "") + " margin-top: -5px; height: 11px; width: 100%; }" + + ".js-TornPageBottomImg { " + (JSKitLib.isIE() ? (JSKitLib.isPreIE7() ? "position: absolute;" : "float: left;") : "") + " margin-bottom: -5px; height: 11px; width: 100%; }" + + ".js-TornPageDivider { margin-left: -5px; margin-right: -5px;" + (JSKitLib.isPreIE7()?"":"margin-bottom: -1px;") + " height: 22px; background-color: #CBCBCB; }" + + ".js-TornPageDividerTop { height: 10px; background-color: #ECECEC; border: solid 1px #b0b0b0; border-top-width: 0; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; margin-bottom: 6px; }" + + ".js-TornPageDividerBottom { height: 10px; background-color: #ECECEC; border: solid 1px #b0b0b0; border-bottom-width: 0; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; }" + + ".js-commentBodyLabel { clear: both; }" + + ".js-CreateCommentFieldsBaseInfo { float: right; margin-bottom : 5px; width: 100%; }" + + ".js-commentCmtTextarea { clear: both; }" + + ".js-CommentsSkin-wireframe .js-commentAvatar { background: #FFFFFF; border: 1px solid #c0c0c0; width: 96px; height: 96px; margin: 0px 0px 5px 0px; }" + + ".js-CommentsSkin-smoothgray .js-commentAvatar { background: #FFFFFF; position: relative; float: right; margin-left: -102px; border: 1px solid #c0c0c0; width: 96px; height: 96px; }" + + ".js-kit-lcf-avatarsManagerWrapper { float: left; position: relative; width: 64px; height: 64px; margin-right: 10px; margin-right: -75px; overflow: visible !important; }" + + ".js-kit-basicUserInfoWrap { float: left; width: 100%; }" + + ".js-kit-lcf-userInfoWrapper { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-nonLoggedUserInfo .js-kit-lcf-fromMenuAnonymous, .js-kit-nonLoggedUserInfo .js-kit-lcf-toMenu, .js-kit-nonLoggedUserInfo .js-kit-fromMenuAnonymous { margin-left: 75px; }" + + ".js-kit-from-to-menu-title { margin: 5px 8px 0px 8px; font-weight: bold; font-size: 10px; }" + + ".js-kit-from-to-menu-footer { margin-top: 8px; }" + + ".js-kit-lcf-toMenu { margin: 9px 0px; }" + + ".js-kit-lcf-toField, .js-kit-from-menuAnonymousWrap { background-color: #FFFFFF; border: 1px solid #BBBBBB; }" + + ".js-kit-from-menuAnonymousWrap { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-lcf-toField .jskit-MenuRootHTML { cursor: pointer; }" + + ".js-kit-lcf-toField { cursor: pointer; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".jskit-MenuRootHTML { cursor: pointer; }" + + ".js-kit-from-control { float: left; margin-right: -85px; position: relative; }" + + ".js-kit-from-field { float: left; width: 100%; height: 26px; cursor: text; }" + + ".js-kit-from-name { margin: 5px 0px 0px " + (JSKitLib.isIE() ? "85" : "81") + "px; font-size: 14px; border: 0px; cursor:text; width: 15em; line-height: 14px; outline: 0px;}" + + ".js-kit-from-name input.jsipe-input { margin: 0px; padding: 0px; border: 0px; background: #FFFFFF; outline: 0px; font-size: 14px !important; }" + + ".js-kit-disabledNameField { background-color: #fffea9; cursor: pointer; }" + + ".js-kit-disabledNameField .js-kit-from-name, .js-kit-disabledNameField .js-kit-miniProfile-name-ipe { width: auto; cursor: pointer; }" + + ".js-kit-loggedUserInfo { margin-left: 0px; }" + + ".js-CmtSpam { background: url(//cdn.js-kit.com/images/bio-hazard.gif) bottom right repeat-x !important; background-color: #ffffe0 !important; color: #404040; }" + + (JSKitLib.isIE() ? ".js-CreateComment { zoom: 1; }" : "") + + ".js-previewImageDescr { width: 102px; left: 0px; bottom: 0px; }" + + ".js-previewImage { position: relative; text-align: center; margin: 4px; float: left; width: 102px; }" + + ".js-all-previewImages {margin-top: 15px; border-top: 1px solid #ececec; border-bottom: 1px solid #ececec; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" + + ".js-all-previewImages .js-previewImage { position: static; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-uploadImageButton { float: left; color: blue; cursor: pointer; }" + + ".js-previewImageTitle { background-color: #ececec; font-size: 7pt; float: left;}" + + ".js-uploadImageInputWrapper2 { margin: 0; padding: 0; position: absolute; top: 0px; left: 0px;}" + + ".js-uploadImageInputWrapper1 {position: relative;}" + + ".js-uploadGreyDescr { color: #c0c0c0; }" + + ".js-uploadImageIcon { height: 16px; vertical-align: "+(JSKitLib.isSafari()?"sub":"middle")+"; margin-right: 5px; }" + + ".js-CommentsPopupLink { cursor: pointer; }" + + ".js-kit-popupComments { z-index: 13900 !important; }" + + ".js-kit-popupComments .js-CommentsArea { padding: 7px }" + + ".js-kit-popupComments .js-LeaveComment { font-family: Arial; font-size: 11pt; }" + + ".js-kit-follow-popup-container { border: 4px solid #CBCBCB; text-align: left; }" + + ".js-kit-follow-popup-header { font-family: Verdana, Helvetica; font-weight: bold; font-size: 12pt; color: gray; }" + + ".js-kit-follow-popup-header, .js-kit-follow-popup-footer { padding: 10px; background: #ECECEC; }" + + ".js-kit-follow-popup-editNotifications { float: left; cursor: pointer; font-size: 14px; padding-top: 3px; }" + + ".js-kit-follow-popup-cancelButtonContainer, .js-kit-follow-popup-doneButtonContainer { float: right; }" + + ".js-kit-follow-popup-cancelButton { margin-right: 5px; }" + + ".js-kit-clickable { cursor: pointer; }" + , 'cmt'); + if(JSKitLib.isOpera()) JSKitLib.addCss("wbr:after{content:\"\\00200B\"}", 'wbr'); + else JSKitLib.addCss(".js-singleCommentTEXT{word-wrap:break-word}", 'wbr'); + + JSKitLib.addCss("" + + ".js-CommentsSkin-smoothgray .js-OldCommentsWrap {zoom:1; margin-bottom: 1px; clear: both; background-color: #cbcbcb; -moz-border-radius: 7px; -webkit-border-radius: 7px; padding: 5px; }" + + ".js-CommentsSkin-smoothgray .js-OldComments { background-color: #ececec; border: solid 1px #b0b0b0; padding: 4px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }" + + ".js-CommentsSkin-smoothgray .js-singleComment { border-style: none; margin: 0px; " + (JSKitLib.isIE() ? "zoom:1;" : "") + "; background: transparent; }" + + ".js-CommentsSkin-smoothgray .js-PageNOther { font-weight: bold; color: #0066cc; text-decoration: none; } " + + ".js-CommentsSkin-smoothgray .js-PageNCur { color: #fe9600; } " + + ".js-CommentsSkin-smoothgray .js-OldComments .js-CreateCommentArea { background-color: transparent; }" + + ".js-CommentsSkin-smoothgray .js-OldComments .js-singleCommentName { color: #0066cc; }" + + ".js-CommentsSkin-smoothgray .js-singleCommentBody { clear: both; color: #404040; background-color: #fefefe; padding: 4px 4px 4px 8px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; " + (JSKitLib.isIE() ? "zoom:1;" : "") + "}" + + ".js-CommentsSkin-smoothgray .js-singleCommentCtls { float: right; }" + + ".js-CommentsSkin-smoothgray .js-singleCommentBg { zoom: 1; padding: 0.3em; position: relative; }" + , "comments-skin-smoothgray"); + JSKitLib.addCss(".js-CommentsSkin-haloscan .js-singleComment { font-size: 11px; font-family: Verdana, Helvetica; border: none; zoom: 0; }" + + ".js-CommentsSkin-haloscan .js-singleCommentCtls { float: right; white-space: nowrap; }" + + ".js-CommentsSkin-haloscan .js-singleCommentAvatar { padding-bottom: 1em }" + + ".js-CommentsSkin-haloscan .js-LeaveComment { text-align: center; }" + + ".js-CommentsSkin-haloscan .js-commentControl, .js-CommentsSkin-haloscan .js-commentTool, .js-CommentsSkin-haloscan .js-poweredBy, .js-CommentsSkin-haloscan .js-poweredBy div { display: inline; float: none; }" + + ".js-CommentsSkin-haloscan .js-antispamBy { display: block; }" + + ".js-CommentsSkin-haloscan .js-CreateCommentBg { width: 30em; margin-top: 1em; margin-left: auto; margin-right: auto; padding: 0.5em; text-align: left; float: none; border: none; }" + + ".js-CommentsSkin-haloscan .js-singleCommentBg { padding: 0em }" + , "comments-skin-haloscan"); + + // new skin layout + JSKitLib.addCss('' + + '.js-CommentsSkin-echo .jsk-ThreadWrapper { margin-bottom: 1em; padding: 10px; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; ' + (JSKitLib.isIE() ? 'zoom:1;' : '') + ' }' + + '.js-CommentsSkin-echo .jsk-StreamWrapper { margin-bottom: 1em; background: url(//cdn.js-kit.com/images/dot-gray.png) repeat-x bottom; }' + + '.js-CommentsSkin-echo .jsk-HeaderWrapper { padding-top: 1em; padding-bottom: 1em; }' + + '.js-CommentsSkin-echo textarea.js-CmtText-noWYSIWYG, .js-CommentsSkin-echo textarea.js-CmtTextEdit-noWYSIWYG { border: 0px; background: #FFFFFF; padding: 0px; }' + + '.js-CommentsSkin-echo .jsk-CommentFormBody-noWYSIWYG, .js-CommentsSkin-echo .jsk-CommentEditFormBody-noWYSIWYG { ' + (JSKitLib.isIE() ? "zoom: 1;" : "") + ' border: 1px solid #BBBBBB; padding: 5px 7px; background: #FFFFFF; }' + + '.js-CommentsSkin-echo .js-commentTool { display: none; }' + + ".js-CommentsSkin-echo .js-singleCommentAvatar { background-position: center; }" + + ".js-PageMore { text-align: center; border: solid 1px #E4E4E4; padding: 10px; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; cursor: pointer; font-weight: bold; background-color: #FFFFFF; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" + + '.jsk-HeaderInfoBox { float: left; }' + + '.jsk-HeaderInfoBoxImg { float: left; padding: 0px; width: 16px; height: 16px; }' + + '.jsk-CommentsCountWrap { float: left; ' + (JSKitLib.isIE() ? "zoom: 1;" : "") + ' padding: 0px; margin-left: 5px; line-height: normal !important; }' + + '.jsk-CommentsCount { font-weight: bold !important; }' + + '.jsk-HeaderMenu { float: right; }' + + '.jsk-HeaderPauseBox { display: none; margin: 0px; padding: 3px; float: right; vertical-align: middle;}' + + '.jsk-HeaderPauseBoxImg { float: left; width: 16px; margin-right: 2px; }' + + '.jsk-MenuAdmin { float: right; }' + + '.jsk-MenuAdmin .jskit-MenuItem { text-align: left; }' + + '.jsk-ItemWrapper { padding-bottom: 1em; padding-top: 1em; background: url(//cdn.js-kit.com/images/dot-gray.png) repeat-x top; line-height: 150%; }' + + '.jsk-ItemWrapper-borderless { background: none; }' + + '.jsk-ItemUserAvatarWrapper { float: left; padding: 2px; }' + + '.jsk-ItemContentWrapper { margin-left: 10px }' + + '.jsk-ItemFooter { text-align: left; }' + + '.jsk-ItemAttachmentsTitle { float: left; line-height: 100%; font-size: 0.8em; padding: 1px; }' + + '.jsk-ItemAttachmentIconWrapper { padding: 5px; border: 1px solid #ECECEC; }' + + '.jsk-ItemAttachmentWrapper { float: left; margin: 0px; margin: 5px 12px 5px 12px; text-align: center; width: 110px; }' + + '.js-singleCommentAdminStar { border: 0; width: 16px; height: 16px; vertical-align: middle; display: none; }' + + + ".jsk-CommentFormSurface { zoom: 1; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; border: 1px solid #dddddd; padding: 11px; line-height: normal; }" + + ".jsk-CommentFormAvatar { float: left; }" + + ".jsk-CommentFormFooter { margin-top: 11px; width: 100%; }" + + ".jsk-CommentFormAvatarsArea { border: 1px solid #bbbbbb; margin: 0em 0em 0.6em 0em; padding: 0.3em; }" + + ".jsk-CommentFormAvatarsArea .jsk-avt-section-label { font-weight: bold; font-size: 12px; }" + + ".jsk-CommentFormAvatarsArea .jsk-avt-upload-label { font-size: 8pt; }" + + ".jsk-CommentFormInputsWrapper { padding-left: 113px; margin-bottom: 11px; }" + + ".jsk-CommentFormButton { margin-left: 0.5em; }" + + ".jsk-CommentFormWrapper { margin-bottom: 1em; }" + + // new pager + + '.jsk-PagerWrapper { width: 100%; text-align: center; padding: 0.75em 0px; }' + + '.jsk-Pager { border: 0; margin: 0; padding: 0; display: inline; }' + + '.jsk-Pager li { border:0; margin:0; padding:0; list-style:none; display: inline; margin-left: 3px; }' + + '.jsk-Pager a { border: solid 1px #DDDDDD; }' + + '.jsk-Pager .jsk-PrevOff, .jsk-Pager .jsk-NextOff { color:#666666; padding: 5px 8px; }' + + '.jsk-Pager .jsk-Prev a, .jsk-Pager .jsk-Next a { border:solid 1px #DDDDDD; }' + + '.jsk-Pager .jsk-Active { color:#ff0084; font-weight:bold; padding: 5px 8px; }' + + '.jsk-Pager a:link, .jsk-Pager a:visited { color:#0063e3; padding: 4px 7px; text-decoration:none; }' + + '.jsk-Pager a:hover { border:solid 1px #666666; }' + + '.jsk-PagerItemHover { background-color: #E4E4E4; }' + + // new skin theme + // colors: + + '.jsk-PrimaryBackgroundColor { background-color: #FFFFFF; }' + + '.jsk-SecondaryBackgroundColor { background-color: #f4f4f4; }' + + '.jsk-TrinaryBackgroundColor { background-color: #ECEFF5; }' + + '.jsk-PrimaryHighlightColor { color: #fffea9; }' + + '.jsk-SecondaryHighlightColor { color: #ffff00; }' + + '.jsk-PrimaryFontColor { color: #3a3a3a; }' + + '.jsk-SecondaryFontColor, .jsk-ThreadWrapper a.jsk-SecondaryFontColor { color: #c6c6c6; }' + + '.jsk-ThreadWrapper a, .jsk-LinkColor { color: #476cb8; }' + + '.jsk-H1Color { color: #878487; }' + // fonts: + + '.jsk-PrimaryFont, .jsk-PrimaryFont a:hover, .jsk-CommentFormSurface input, .js-kit-follow-popup-container input { font-family: Lucida grande, Tahoma, Verdana, Arial; }' + + '.jsk-PrimaryFont { font-size: 8pt; font-weight: normal; }' + + '.jsk-H1Font { font-size: 1.38em; font-weight: bold; line-height: 1.4em; }' + + '.jsk-LinkFont, .jsk-ThreadWrapper a, .jsk-ThreadWrapper a:hover { text-decoration: none; font-weight: normal; }' + + // other skin's properties + + '.jsk-DisabledFontColor { color: #9c9c9c; }' + + '.jsk-ItemName { font-weight: bold; }' + + 'input.jsk-CommentFormButton { font-size: 1.25em; }' + + '.jsk-HeaderMenu table td { border-spacing: 0; padding: 0; margin: 0; vertical-align: middle; height: 16px; }' + + '.jsk-HeaderMenu table td .js-singleCommentMenuTitleExpandMarker { margin: 0; padding: 0; }' + + '.jsk-HeaderMenu .js-singleCommentMenuTitle { padding: 0; margin: 0; }' + + '.js-CommentsSkin-echo .js-poweredBy { font-family: Arial; font-size: 9px; color: #bbbbbb; margin-top: 1.2em; white-space: nowrap; line-height: normal; text-align: right; }' + + '.js-CommentsSkin-echo .js-poweredBy-wrapper { float: right; }' + + '.js-CommentsSkin-echo .js-poweredBy-logo { ' + (JSKitLib.isPreIE8() ? "zoom: 1;" : "") + ' border: none; margin-left: 5px; height: 14px; width: 25px; float: right; }' + + '.js-CommentsSkin-echo .js-poweredBy-text { ' + (JSKitLib.isIE() ? "zoom: 1; padding-bottom: 3px;" : "") + 'float: right; }' + + '.js-CommentsSkin-echo .js-commentAvatar { margin: 0; }' + + ".js-CommentsSkin-echo .js-commentFieldInput { outline: 0px; border: 0px solid; width: 100%; }" + + ".js-CommentsSkin-echo .js-commentFieldLabel { clear: none; margin: 0; }" + + ".js-CommentsSkin-echo .js-authSelector { float: none; }" + + '.js-CommentsSkin-echo .js-singleComment { border: none; }' + + '.js-CommentsSkin-echo .js-singleCommentBg { padding: 0; position: static; }' + + '.js-CommentsSkin-echo .jsk-ItemChildrenMarker { border-color: transparent transparent #ECEFF5; border-width: 0px 11px 11px; border-style: solid; margin: 3px 0px 0px 67px; height: 1px; width: 0px; display: none;' + (JSKitLib.isIE() ? ' font-size: 1px; line-height: 1px; filter: chroma(color=black);' : '') + ' }' // This is magic "arrow up". Only color and margins could be changed + + '.js-CommentsSkin-echo .jsk-ItemWrapperThread { padding-bottom: 1px; }' + + '.js-CommentsSkin-echo .jsk-ItemWrapperThread .jsk-ItemChildrenMarker { display: block; }' + + '.js-CommentsSkin-echo .jsk-ItemWrapperChild { padding: 10px; margin: 0px 20px 2px 0px; background-image: none; }' + + '.js-CommentsSkin-echo .js-singleCommentCtls { float: left; white-space: normal; }' + + '.js-CommentsSkin-echo .js-singleCommentDate { font-size: 1em; }' + + '.js-CommentsSkin-echo .js-previewImageDescr { width: 110px; }' + + '.js-CommentsSkin-echo .jsk-ItemAge { float: left; margin: 0 0.5em 0 0; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmit { position: absolute; left: 11px; bottom: 3px; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitImg { margin-bottom: -3px; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitLabel { margin-left: 5px; color: #000000; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitRetry { display: none; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitMsg { position: relative; -moz-border-radius: 0.5em; -webkit-border-radius: 0.7em; background-color: #FFFF99; border: solid 1px #C6C677; padding: 10px; margin: 0 40px; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitWrapper { background-color: #FFFFFF; position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-transition: opacity 0.5s ease-out; -moz-border-radius: 0.5em; -webkit-border-radius: 0.7em; vertical-align : middle; text-align: center; }' + + '.js-singleViaLinkWrapper { text-align: right; float: right; margin-right: 7px; }' + + '.js-singleCommentViaIcon { ' + (JSKitLib.isIE() ? "zoom: 1;": "") + ' border: 0; margin: 0.1em 0.3em 0 0.3em; width: 16px; height: 16px; float: right; }' + + '.js-singleViaText { ' + (JSKitLib.isIE() ? "zoom: 1;": "") + ' margin-bottom: 0.5em; white-space: nowrap; float: right; }' + + 'table.mceToolbar { width: auto !important; }' + + 'table.mceLayout td { padding: 0px !important; }' + + (JSKitLib.isIE() && !JSKitLib.isPreIE8() ? 'table.mceLayout a { display: none; }' : '') // hiding with empty text + + , 'comments-skin-echo'); + + JSKitLib.addCss("" + + ".js-kit-lcf-Border { border: 1px solid #BBBBBB; overflow: hidden; }" + + ".jskit-GoogleLikeMenuBar { width: " + (JSKitLib.isIE() ? "79" : "75") + "px; height: 26px; border-right: 1px solid #BBBBBB; font-size: 12px; line-height: 26px; cursor: pointer; text-align: right; white-space: nowrap; background: url(//cdn.js-kit.com/images/google-like-button.png);}" + + ".jskit-GoogleLikeMenuBarExpandMarker { float: right; line-height: 12px; height: 10px; width: 10px; margin: 9px 5px 0px 5px; }" + + ".jskit-GoogleLikeMenuBarText { float: right; font-weight: bold; color: #3a3a3a; }" + + ".jskit-Dogtag { background-color: #E2E9FF; float: left; margin: 1px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border: 1px solid #88AADD; white-space: nowrap; height: 22px; cursor: default; }" + + ".jskit-DogtagIcon { width: 16px; height: 16px; margin: 3px; float: left; }" + + ".jskit-DogtagCross { width: 10px; height: 10px; margin: 6px 5px 6px 0px; float: left; cursor: pointer; line-height: 10px; }" + + ".jskit-DogtagText { float: left; margin: 4px 7px 3px 2px; font-size: 11px; " + (JSKitLib.isIE() && document.compatMode == "BackCompat" ? "line-height: 22px; margin-top: 0px;" : "") + " }" + + ".js-nsgecko { -moz-user-select: none; }"); +} + +JSCC.prototype.setStreamState = function(paused, forced) { + if (!forced && this.pause.forced) return; + this.pause.state = paused; + this.pause.forced = !!forced; + this.renderPauseIndicator(); + if(!paused) { + if(this.pause.queue.length > 0) { + var events = this.pause.queue; + this.pause.queue = []; + this.renderSubscribeEvents(events); + } + this.renderPauseCounter(); + } +} + +JSCC.prototype.renderPauseIndicator = function() { + if(!this.pause.visible) return; + JSKitLib.show(this.TC["jsk-HeaderPauseBox"], 'block'); + var state = this.pause.state; + if(!this.pause.forced && !this.pause.visible) { + this.pause.state = false; + } + JSKitLib.setStyle(this.TC["jsk-HeaderPauseBoxImg"], "background: url('//cdn.js-kit.com/images/control_" + (state ? "pause" : "play") + ".png') no-repeat center center"); + JSKitLib.text($JCL(state ? 'statePaused' : 'stateLive'), this.TC["jsk-HeaderPauseBoxName"], true); + JSKitLib.preventSelect(this.TC["jsk-HeaderPauseBoxName"]); +} + +JSCC.prototype.renderPauseCounter = function() { + if(!this.pause.visible) return; + JSKitLib.text(this.pause.queue.length == 0 ? '' : + '(' + this.pause.queue.length + ' ' + $JCL('itemsNew') + ')', this.TC["jsk-HeaderPauseBoxCount"], true); + JSKitLib.preventSelect(this.TC["jsk-HeaderPauseBoxCount"]); +} + +JSCC.prototype.setDefaultField = function(name,value) { + JSKitLib.fmap.call(this, ["fieldDfl", "extraFormFields"], function(section) { + this[section][name] = JSKitEPB.getValue(name) || value || ""; + }); +} + +JSCC.prototype.addChild = function(to, what) { + if (typeof(to) != 'object') + return; + + if(arguments.length == 3 && arguments[2]) + to.insertBefore(what, to.firstChild); + else + to.appendChild(what); +} + +JSCC.prototype.a = function() { + var a = this.cr("a"); + a.href = "javascript:void(0);"; + for(var text = '', i = 0; i < arguments.length; i++) + text += arguments[i]; + a.innerHTML += text; + return a; +} + +JSCC.prototype.div = function(id) { + var self = this; + var div = this.cr("div"); + for(var i = 1; i < arguments.length; i++) { + var arg = arguments[i]; + switch(typeof(arg)) { + case "string": + this.addChild(div, document.createTextNode(arg)); + break; + case "undefined": + break; + default: + case "object": + if(!arg) break; + this.addChild(div, arg); + break; + } + } + if(id) { + div.className = id; + var arr = String(id).split(/[ ]+/); + JSKitLib.map(function(el) { + if(el.substr(0, 3) == 'js-') + self.TC[el] = div; + }, arr); + } + return div; +} + +JSCC.prototype.dtComment + = '
    ' + + '
    ' + + '
    ' + + '
    ' + + '{Name}' + + '' + + '
    {Date}
    ' + + '
    ' + + '' + + '
    {Text}
    ' + + '
    ' + + '
    {Notice}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:likeThisComment}' + + ' [{Label:yes}]' + + ' [{Label:no}]' + + ' ({Label:Score}:' + + ' 0 {Label:byVotes}' + + ' 0)' + + '' + + '
    ' + + '
    {Label:communityAssignedCarmaScore}:' + + ' 0 {Label:byVotes}' + + ' 0' + + '
    ' + + '
    ' + + '[{Label:btnReply}]' + + ' [{Label:btnDelete}]' + + ' [{Label:btnEdit}]' + + ' [{Label:btnModerate}]' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' +; + +JSCC.prototype.dtComment2 + = '
    ' + + '
    ' + + '
    ' + + '
    ' + + '{Name}' + + '' + + ' {Label::depth?replies:says}:' + + '
    ' + + '
    {Age}
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '' + + '
    {Text}
    ' + + '
    {Notice}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:likeThisComment}' + + ' [{Label:yes}]' + + ' [{Label:no}]' + + ' ({Label:Score}:' + + ' 0 {Label:byVotes}' + + ' 0)' + + '' + + '
    ' + + '
    {Label:communityAssignedCarmaScore}:' + + ' 0 {Label:byVotes}' + + ' 0' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:btnReply}
    ' + + '
    {Label:btnDelete}
    ' + + '
    {Label:btnEdit}
    ' + + '
    {Label:btnModerate}
    ' + + '
    ' + + '
    ' + + '
    ' // Body + + '
    ' + + '
    ' +; + +JSCC.prototype.dtComment3 + = '
    ' + + '
    ' + + '' + + '
    ' + + '{Text}
    ' + + '
    ' + + '
    ' + + '

    ' +; + +JSCC.prototype.dtCommentEcho + = '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + ' ' + + '{Name}' + + '{IP}' + + ' ' + + '
    ' + + '{Text}' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Age}
    ' + + '
    ' + + '' + + '' + + '{Label:btnFlag|ucf}' + + '' + + '' + + '' + + '{Label:btnLike|ucf}' + + '' + + '' + + '' + + '{Label:btnReply|ucf}' + + '' + + '' + + '' + + '{Label:btnDelete|ucf}' + + '' + + '' + + '' + + '{Label:btnEdit|ucf}' + + '' + + '' + + '' + + '{Label:btnModerate|ucf}' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' +; + +JSCC.prototype.ffComment + = '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + ' ' + + '{content.user.name}' + + ' ' + + '
    ' + + '{content.title}' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Age}
    ' + + '
    ' + + '' + + '' + + '{Label:btnFlag|ucf}' + + '' + + '' + + '' + + '{Label:btnLike|ucf}' + + '' + + '' + + '' + + '{Label:btnReply|ucf}' + + '' + + '' + + '' + + '{Label:btnDelete|ucf}' + + '' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' +; + +JSCC.prototype.dtHeaderEcho + = '
    ' + + '
    ' + + '
    ' + + '
    {Title}' + + ' {CountLabel}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
     
    ' + + '' + + ' ' + + '' + + ' –' + + '
    ' + + '
    ' + + '
    ' + + '
    ' +; + +JSCC.prototype.dtCreate + = '
    ' + + '
    ' + + '
    {Label:leaveComment}
    ' + + '
    ' + + '
    {Label:nicknameLabel}
    ' + + '
    ' + + '
    ' + + '
    {Label:url}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:emailLabel}' + + '
    {Label:emailNote}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:ratingLabel}
    ' + + '
    ' + + '
    {Label:commentLabel}
    ' + + '
    ' + + '
    {Label:avatar}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '' + + '[{Label:more}]' + + '
    ' + + '' + + '
    (Spam filtering by Akismet)
    ' + + '

    ' +; + +JSCC.prototype.dtCreate2 + = '
    ' + + '
    ' + + '
    {Label:leaveComment}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:nicknameLabel}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:url}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:emailLabel}' + + '
    {Label:emailNote}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:ratingLabel}
    ' + + '
    ' + + '
    {Label:commentLabel}
    ' + + '
    ' + + '
    ' + + '
    ' // Fields + + '
    ' + + '
    ' + + '{Label:addPicText}' + + '
    ' + + '
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    (Spam filtering by Akismet)
    ' + + '
    ' + + '

    ' +; + +JSCC.prototype.dtCreate3 + = '
    ' + + '
    ' + + '
    {Label:leaveComment}
    ' + + '
    ' + + '
    {Label:nicknameLabel}
    ' + + '
    ' + + '
    ' + + '
    {Label:emailLabel}' + + '
    {Label:emailNote}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:url}
    ' + + '
    ' + + '
    ' + + '
    {Label:ratingLabel}
    ' + + '
    ' + + '
    {Label:commentLabel}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '[{Label:more}]' + + '
    ' + + '' + + '
    (Spam filtering by Akismet)
    ' + + '

    ' +; + +JSCC.prototype.dtCreateEcho += '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' ++ '
    '; + +JSCC.prototype.dtProfileCreate + = '
    ' + + '
    ' + + '
    {Label:leaveComment}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:nicknameLabel}
    ' + + '
    ' + + '
    ' + + '
    {Label:emailLabel}' + + '
    {Label:emailNote}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:commentLabel}
    ' + + '
    ' + + '
    ' // Fields + + '
    ' + + '
    ' + + '' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '

    ' +; + +JSCC.prototype.dtEditComment + = '' +; + +JSCC.prototype.dtEditComment2 + = '' +; + +JSCC.prototype.dtConversation + = '
    ' + + '
    ' + + '{Label}{Name}' + + '
    ' + + '
    ' +; + +JSCC.prototype.dtMiniProfileLeaveComment = + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + +JSCC.prototype.dtCreateUserInfoLogged = + '
    ' + + '
    ' + + '
    ' + + '
    '; + +JSCC.prototype.dtCreateUserInfoNonLogged = + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + +JSCC.prototype.dtCommentsPopupLink + = '{LinkLabel}'; + +JSCC.prototype.dtPostingCommentDialog + = '
    ' + + '
    ' + + '' + + '' + + ' (' + + '{Label:retry}/' + + '{Label:cancel}' + +')' + + '
    ' + + '
    '; + +JSCC.prototype.dtFollowPanel = +'
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:follow_emailNotification}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:follow_notifyMode_noemail}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:follow_notifyMode_anymails}
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '{Label:follow_emailAddressLabel}' + + '' + + '' + + '({Label:follow_editProfile})' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    {Label:follow_rssThread}
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + +'
    '; + +JSCC.prototype.dtFollowPanelPopup = + '
    ' + + '
    {Label:follow_popupHeader}
    ' + + '
    ' + + '' + + '
    '; + +JSCC.prototype.dtExpirationBanner = + '
    ' + + '
    ' + + '
    {Label:expirationBanner_title}
    ' + + '
    {Label:expirationBanner_description}
    ' + + '
    ' + + '
    ' + + '{Label:expirationBanner_domain}' + + '' + + '
    ' + + '
    ' + + '{Label:expirationBanner_subscriptionType}' + + '' + + '
    ' + + '
    ' + + '{Label:expirationBanner_serviceFirstDate}' + + '' + + '
    ' + + '
    ' + + '{Label:expirationBanner_expirationDate}' + + '' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    '; + +JSCC.prototype.localDate = function(t) { + if(!t) return ""; + var d = new Date(t * 1000); + return d.toLocaleDateString(); +} + +JSCC.prototype.localTime = function(t) { + if(!t) return ""; + var d = new Date(t * 1000); + return d.toLocaleTimeString(); +} + +JSCC.prototype.localAge = function(t) { + if(!t) return ""; + if(t) + var d = new Date(t * 1000); + var offset = d.getTimezoneOffset() * 60; + var day = Math.ceil(((new Date()).valueOf() - offset * 1000) / 86400000) * 86400; + var when = Math.floor((day - t + offset) / 86400); + switch(when) { + case 0: when = $JCL("leftToday"); break; + case 1: when = $JCL("leftYesterday"); break; + default: + if(when > 0 && when < 6) + when = when + $JCL("leftDaysAgo"); + else + when = d.toLocaleDateString(); + } + return when + ", " + d.toLocaleTimeString(); +} + +JSCC.prototype.viaLink = function(content) { + if (!content) return ""; + + if (content.service && content.service.profileUrl) { + return content.service.profileUrl; + } else if (content.user && content.user.profileUrl) { + return content.user.profileUrl; + } else { + return ""; + } +} + +JSCC.prototype.JCL = function(v) { + return $JCL( + (v == 'leaveComment') ? (this.config.label || v) : v + ); +} + +JSCC.prototype.gtmpl = function(t, mObj) { + var s = this; + var lowercase = function(a, m) { return String(m).toLowerCase(); } + t = t.replace(/^[^<]*(<[\s\S]*>)[^>]*$/, "$1"); + t = t.replace(/(<[\/]?[A-Z]+)/g, lowercase); + if(mObj && mObj.ID) t = t.replace(/(<[a-z]+)/, '$1 id="' + mObj.ID + '"'); + t = t.replace(/{Label:([^:\|}]+[^\|}]*)\|?([^}]*)}/g, + function(a, m, modifier) { + var loc = s.JCL(m); + switch (modifier) { + case 'uc' : loc = loc.toUpperCase(); break; + case 'lc' : loc = loc.toLowerCase(); break; + case 'ucf': loc = loc.substr(0, 1).toUpperCase() + loc.substr(1); break; + } + return loc; + }); + t = t.replace(/{([a-zA-Z]+\.)+([a-zA-Z]+)}/g, + function(a) { + var arr = a.substr(1,a.length-2).split(/\./); + var res = mObj; + JSKitLib.fmap(arr, function(v) { + if(res[v]) { + res = res[v] + } else { + return ''; + } + }); + return res || ''; + }); + return t; +} + +JSCC.prototype.tmpl = function(t, obj, dontPutId) { + var self = this; + t = self.gtmpl(t, dontPutId ? false : obj); + t = t.replace(/{Age}/g, self.localAge(obj.TS)); + t = t.replace(/{Date}/g, self.localDate(obj.TS)); + t = t.replace(/{Time}/g, self.localTime(obj.TS)); + t = t.replace(/{Via}/g, self.viaLink(obj.content)); + if (obj.IP) t = t.replace(/{IP}/g, " (" + obj.IP + ")"); + var text = String(obj.Text); + if ((obj.status == 'M' || obj.status == 'H') + && (this.serverOptions.mmode == 'pre' || this.serverOptions.mmode == 'onhold' || (obj.msgtype && obj.msgtype.match(/T|P/)))) { + text += (this.serverOptions.mtext || ''); + } + text = text.replace(/^[ \s]+|[ \s]+$/, ''); + text = text.replace(/\n\n+/g, '\n\n'); + text = text.replace(/\n/g, ' 
    '); + if(text.indexOf('<') == -1) + text = text.replace(/([^&<>\s]{12})([^&<>\s]{12})/g, '$1$2'); + text = text.replace(/{/g, '{'); + t = t.replace(/{Text}/g, text); + t = t.replace(/{Label:(:([a-z]+)\?([^:}]*):([^}]*))?([^}]*)}/g, + function(a,b,p,f,s,m){ + if(p) m = (obj[p]?f:s)+m; + return $JCL(m); + }); + var d = {"SO:":this.serverOptions,"":obj}; + t = t.replace(/{([A-Z]+:)?([A-Za-z0-9]+)(\+\d+)?}/g, + function(a,t,m,p){ var v = ((d[t]||obj)[m])||''; if(p) v = parseInt(v) + parseInt(p); return v; }); + return t; +} + +JSCC.prototype.setCommentStyle = function(cmt, className) { + var el = cmt.ctls['js-singleCommentBody'] || cmt; + if(el) JSKitLib.addClass(el,className); +} + +JSCC.prototype.cmtSetSpamStatus = function(cmt, s) { + cmt.cobj.status = s ? 'S' : 'A'; + if(s) { + this.setCommentStyle(cmt, "js-CmtSpam"); + } else { + cmt.style.backgroundColor = ""; + cmt.style.backgroundImage = ""; + cmt.style.color = ''; + } + if(cmt.domINFO) cmt.domINFO.style.backgroundColor = s ? '#ffffe0' : ""; +} + +JSCC.prototype.cmtSetOffensiveStatus = function(cmt, s) { + cmt.cobj.status = s ? 'O' : 'A'; + if(s) { + this.setCommentStyle(cmt, "js-CmtSpam"); + } else { + cmt.style.backgroundColor = ""; + cmt.style.backgroundImage = ""; + cmt.style.color = ''; + } + if(cmt.domINFO) cmt.domINFO.style.backgroundColor = s ? '#ffffe0' : ""; +} + +JSCC.prototype.blockAction = function(action) { + var s = this; + var cid = s.ctBlock.forId; + var cmt = s.jspg.getItemById(cid).div; + s.hideSettingsWindow('ctBlock'); + switch(action) { + case "approve": + s.cmtApprove(cid); + break; + case "approveuser": + s.cmtApproveUser(cid); + break; + case "delete": + s.cmtDelete(cid, 'delete'); + break; + case "spam": + s.cmtSetSpamStatus(cmt, true); + s.cmtDelete(cid, 'spam'); + break; + case "ip": + case "user": + s.cmtDelete(cid, 'block_by_action', action); + break; + case "unban": + s.cmtDelete(cid, action); + } +} + +JSCC.prototype.moderationCommentsListUpdate = function(id, moderate) { + if (moderate) this.moderationCommentsList[id] = true; + else delete this.moderationCommentsList[id]; + return true; +} + +JSCC.prototype.hideExpirationBanner = function() { + if (!this.expirationBanner) return; + this.expirationBanner.parentNode.removeChild(this.expirationBanner); + delete this.expirationBanner; +} + +JSCC.prototype.showExpirationBanner = function(target) { + var s = this; + var recalcPosition = function() { + var coords = { + "local": JSKitLib.findPos(target), + "global": JSKitLib.findPos(s.target) + }; + s.expirationBanner.style.top = (coords.local[1] + target.offsetHeight) + "px"; + s.expirationBanner.style.left = (coords.global[0] + (s.target.offsetWidth - s.expirationBanner.offsetWidth)/2) + "px"; + }; + if (s.expirationBanner) { + recalcPosition(); + return; + } + var template = s.gtmpl(s.dtExpirationBanner); + var descriptors = { + "domain": function() { + return JSKitLib.text(s.config.domain); + }, + "creation": function(element, dom) { + if (s.account.creation) { + return JSKitLib.text(s.localDate(s.account.creation)); + } + JSKitLib.hide(dom.get("creation-wrap")); + }, + "expiration": function() { + return JSKitLib.text(s.localDate(s.account.expiration)); + }, + "subscription": function() { + var subscriptions = { + "free": "Echo Free", + "pro": "Echo Live", + "proplus": "Echo PRO" + }; + return JSKitLib.text(subscriptions[s.account.subscription || "free"]); + }, + "button": function(element) { + JSKitLib.setEventHandler(element, ["click"], function() { + window.open("//js-kit.com/settings/pricing.cgi?site=" + s.config.domain, "_blank"); + }); + } + }; + s.expirationBanner = JSKitLib.toDOM(template, "js-kit-exp-banner-", descriptors).content; + s.target.appendChild(s.expirationBanner); + recalcPosition(); +} + +JSCC.prototype.cmtBlock = function(cid) { + var s = this; + var cmt = s.jspg.getItemById(cid).div; + if (s.account.expired) { + s.showExpirationBanner(cmt.domCtls || cmt.domINFO); + return; + } + var status = cmt.cobj.status; + var msgtype = cmt.cobj.msgtype || ''; + var cmtreason; + if (status && status=='S' && cmt.cobj.reason) { + switch (cmt.cobj.reason) { + case 'Blocked by User': + case 'User': + cmtreason = 'User'; + break; + case 'IP': + case 'Blocked by IP': + cmtreason = 'IP'; + break; + } + } + if(s.ctBlock) { s.hideSettingsWindow('ctBlock'); return; } + if(!s.blockDom) { s.blockDom = {}; } + if(!s.blockDom[status]) { s.blockDom[status] = {}; } + if(!s.blockDom[status][cmtreason]) { var jca = '$JCA[' + s.jcaIndex + '].blockAction'; + var cb = function(a, d) { + return '" class="js-ControlBlockButton" '+(d ? 'disabled="on"' : '')+'" onclick="this.blur();'+jca+"('"+a+'\');return false;" />';} + var trth = ''; + var trtd = ''; + var trtdd = ''; + var tinp = '' + + (s.serverOptions.mmode != 'onhold' ? '' : ( + trth + $JCL("approveUser") + trtd + aumsg + + tinp + $JCL("approveUser") + cb('approveuser'))) + + trth + $JCL("approveMessage") + + mtrt + ammsg + + tinp + $JCL("approveMessage") + cb('approve') + + trth + $JCL("deleteUnwantedComment") + + trtd + $JCL("getRidOfComment") + + tinp + $JCL("deleteMessage") + cb('delete') + + ((cmtreason == 'User' || cmtreason == 'IP') ? + '' : + trth + $JCL("flagAsSpam") + + trtd + $JCL("trainAksimet") + + tinp + $JCL("spamJunk") + cb('spam')) + + ((cmtreason == 'User') ? + unbantext + : trth + $JCL("blockCommenter") + + trtd + $JCL("hideCommentsFromUser") + + tinp + $JCL("blockUser")+cb('user')) + + ((cmtreason == 'IP') ? + unbantext + : trth + $JCL("blockCommenterIP") + + trtd + $JCL("hideCommentsFromIP") + + tinp + $JCL("blockIP")+cb('ip')) + + ""); + } + s.settingsWindow('ctBlock', cmt.domCtls || cmt.domINFO, s.blockDom[status][cmtreason]); + s.ctBlock.forId = cid; +} +JSCC.prototype.cmtApprove = function(cid) { + var cmt = this.jspg.getItemById(cid).div; + if(cmt.cobj.status == 'S') { + this.cmtSetSpamStatus(cmt, false); + cmt.cobj.status = 'S'; // cmtDelete's deal + } + if(cmt.cobj.status == 'O') { + this.cmtSetOffensiveStatus(cmt, false); + cmt.cobj.status = 'O'; + } + this.cmtDelete(cid, 'message'); +} + +JSCC.prototype.cmtApproveUser = function(cid) { + var cmt = this.jspg.getItemById(cid).div; + if(cmt.cobj.status == 'S') { + this.cmtSetSpamStatus(cmt, false); + cmt.cobj.status = 'S'; // cmtDelete's deal + } + this.cmtDelete(cid, 'user'); +} + +JSCC.prototype.routeAction = function(fun) { + var a = [this]; + for(var i = 0; i < $JCA.length; i++) { + if($JCA[i].jcaIndex != this.jcaIndex + && $JCA[i].config.domain == this.config.domain + && $JCA[i].config.path == this.config.path + && $JCA[i].config['display-mode'] == 'inline' + && !this.IM && !$JCA[i].IM && !$JCA[i].config.userProfileComments) + a.push($JCA[i]); + } + for(var i = 0; i < a.length; i++) { + var e = a[i]; + if(i) e.serverFilter = function(n) { + return (n == 's-data.js'); } + fun.apply(e); + delete e.serverFilter; + } +} + +JSCC.prototype.cmtDelete = function(cid, approvalMode) { + var args = arguments; + this.routeAction(function() { + this.cmtDeleteAct.apply(this, args); + }); +} + +JSCC.prototype.cmtDeleteAct = function(cid, approvalMode, action) { + var s = this; + var item = this.jspg.getItemById(cid); + if (!item) return; + var cmt = item.div; + if(!cmt) { + (this.objById[cid]||{}).status = 'D'; + this.jspg.deleteItem(cid); + this.reCalcPages(); + return; + } + + if(arguments.length == 1) approvalMode = 'delete'; + + var oldStatus = cmt.cobj.status; + + var path = (this.config.moderate || (this.config.nolc && !this.IM)) ? + cmt.cobj.path : this.config.path; + if(this.config.nolc && !this.IM) + this.config.domain = cmt.cobj.domain; + this.moderationCommentsListUpdate(cid); + var idlist = [{'id': cid, 'p': path}]; + switch(approvalMode) { + case 'message': + if (!this.inlineModeration) { + this.preHandlerDelete(cmt); + } + if(oldStatus == 'S') { + this.groupModerationRequest(approvalMode, + {'spam': idlist, 'appr': [], 'del': []}); + cmt.cobj.action = 'unban'; + } else if(oldStatus == 'O') { + this.groupModerationRequest(approvalMode, + {'spam': [], 'appr': idlist, 'del': []}); + } else { + this.groupModerationRequest(approvalMode, + {'spam': [], 'appr': [], 'del': idlist}); + } + if (this.inlineModeration) this.postHandlerModerate(cid); + break; + case 'user': + if (!this.inlineModeration) { + this.preHandlerDelete(cmt); + } + this.groupModerationRequest(approvalMode, idlist, + (oldStatus == 'S' ? {'junk': 'no'} : {})); + if (this.inlineModeration) this.postHandlerModerate(cid); + break; + case 'delete': + this.preHandlerDelete(cmt); + this.groupModerationRequest(approvalMode, idlist); + break; + case 'block_by_action': + this.preHandlerDelete(cmt); + this.groupModerationRequest('block' + action, idlist); + cmt.cobj.action = 'ban'; + break; + case 'unban': + if (!this.inlineModeration) { + this.preHandlerDelete(cmt); + } + this.groupModerationRequest(approvalMode, idlist); + cmt.cobj.action = 'ban'; + if (this.inlineModeration) this.postHandlerModerate(cid); + break; + case 'spam': + this.groupModerationRequest(approvalMode, idlist); + setTimeout(function() { // screen del + s.removeComment(cmt, true); + }, 1000); + break; + case 'ignore': + /* Just delete from screen */ + default: + this.removeComment(cmt, true); + } +} + +JSCC.prototype.preHandlerDelete = function(cmt) { + this.publishEvent('comment-deleting', {'cmtId': cmt.cobj.ID}); +} + +JSCC.prototype.postHandlerDelete = function(cmt) { + this.publishEvent('comment-deleted', {'cmtId': cmt.cobj.ID}); +} + +JSCC.prototype.removeComment = function(cmt, useRecursion) { + var cobj = cmt.cobj; + var deletedPageIdx = this.jspg.getPageByItemId(cobj.ID); + if(cobj.ParentID && this.objById[cobj.ParentID]) { + var prn = this.objById[cobj.ParentID]; + this.jspg.invalidateItemView(cobj.ParentID); + var parentPageIdx = this.jspg.getPageByItemId(cobj.ParentID); + this.jspg.invalidatePagesView(parentPageIdx, deletedPageIdx-parentPageIdx); + } else { + if(deletedPageIdx && cobj.ParentID) this.jspg.invalidatePagesView(deletedPageIdx-1, 1); + } + if(cobj.cedge) { + var curItemIdx = this.jspg.getItemIdxById(cobj.ID); + if((cobj.cedge==1 && !this.IM && typeof curItemIdx!='undefined') || (cobj.cedge==2 && typeof curItemIdx!='undefined')) { + var itemIdxD = cobj.cedge==1 ? 1 : -1; + var items = this.jspg.getItems(curItemIdx+itemIdxD, 1); + if(items.length && items[0]) items[0].obj.cedge += cobj.cedge; + } + } + var self = this; + var deletedComment = function(dobj) { + return (dobj.status=='D' || dobj.status=='DT'); + } + var delCount = deletedComment(cobj) ? 0 : 1; + if(this.IM) { + var cnt = 0; + var deletedPageItems = this.jspg.getPageItems(deletedPageIdx); + JSKitLib.fmap(deletedPageItems, function(V){ + if(!deletedComment(V.obj) && V.obj.conversation==cobj.conversation) cnt++; + }); + if(cnt>1) { + if(cmt.cobj.hasCnvs) { + cmt.cobj.status = 'DT'; + this.jspg.invalidateItemView(cobj.ID); + } else { + this.jspg.deleteItem(cmt.cobj.ID); + } + } else if(cnt<=1){ + JSKitLib.fmap(deletedPageItems, function(V){ + if(V.obj.conversation==cobj.conversation) self.jspg.deleteItem(V.obj.ID); + }); + } + } else { + delCount = this.jspg.deleteItem(cobj.ID); + this.reCalcPages(); + } + this.ctag = null; + var pageNo = this.curPage; + this.curPage = 0; + this.displayPage(pageNo, function(immed){ + if(immed) { + if(useRecursion && this.jspg.getItemById(cmt.cobj.ID)) { + self.removeComment(cmt); + } + } + }); + return delCount; +} + +JSCC.prototype.postHandlerModerate = function(cid) { + var cmt = this.jspg.getItemById(cid).div; + cmt.cobj.status = 'A'; + this.jspg.invalidateItemView(cid); + var pageNo = this.curPage; + this.curPage = 0; + this.displayPage(pageNo); +} + +JSCC.prototype.createCommentAsHTML = function(obj) { + if(obj.status == 'D') return ''; + if(this.objppc) this.objppc(obj); + return this.tmpl(this.dtComment, obj); +} + +JSCC.prototype.getUserProperty = function(name, defaultValue) { + return JSKitEPB.getValue(name) || this.TC && this.TC["js-Cmt" + name] && !JHI2.isEmpty(this.TC["js-Cmt" + name]) && this.TC["js-Cmt" + name].value || defaultValue; +} + +JSCC.prototype.markOffensive = function(cid) { + if(confirm($JCL("isJunkVote"))) { + if ((this.adminMode) && (!this.inlineModeration)) { + this.cmtDelete(cid); + } else { + var item = this.jspg.getItemById(cid); + if(!item) return; + var obj = item.obj; + var req = { + 'id': cid, + 'permalink': this.config.permalink, + 'Text': obj.Text || + (obj.content ? obj.content.title : ''), + 'Name': this.getUserProperty("Name", $JCL("guest")) + }; + this.server('-mark.off', req); + } + } +} + +JSCC.prototype.getLikeInstanceByID = function(cid){ + var comment = this.jspg.getItemById(cid); + return comment.obj.likeInstance; +} + +JSCC.prototype.postLikeVote = function(cid, obj) { + var voter = { + "name" : this.getUserProperty("Name", "") + }; + var avatar = this.avatarsManager.getActiveAvatar(); + if (avatar) { + voter.avatar = avatar.name; + voter.avatar_width = avatar.width; + voter.avatar_height = avatar.height; + } + var likeInstance = this.getLikeInstanceByID(cid); + if (likeInstance.busy) return; + likeInstance.busy = true; + likeInstance.renderLikeControl("progress"); + likeInstance.sendRequest(voter); +} + +JSCC.prototype.handleLikeResponse = function(cid, action, data){ + this.routeAction(function() { + this.serverOptions.profile = data.profile; + var likeInstance = this.getLikeInstanceByID(cid); + likeInstance.busy = false; + likeInstance.vote(action, data); + }); +} + +JSCC.prototype.showProfile = function(target, data, extraConfig) { + if (data.ProfileURL && !data.profile) { + window.open(data.ProfileURL); + return; + } + var s = this; + var so = s.serverOptions; + if (!data.profile || (data.profile != so.profile && !so.showProfile) || $JSKitGlobal.isProfileLoaded == "no") return; + var applyFollowPanelsCallback = function(func) { + JSKitLib.fmap([s.followPanel, s.followPanelPopup], function(panel) { + if (panel) func(panel); + }); + }; + var config = JSKitLib.foldl({ + "parentTarget" : s.target, + "targetRef" : JSKitLib.getRef(s), + "whiteLabel" : so.whitelabel, + "callbacks" : { + "onsave" : function(profile) { + s.extraFormFields["Email"] = profile.getEmail() || ""; + var email = s.extraFormFields["Email"] || $JCL("follow_emptyEmail"); + applyFollowPanelsCallback(function(panel) { + var link = panel.get("emailAddress"); + var action = s.extraFormFields["Email"] ? "remove" : "add"; + JSKitLib.text(email, link, true); + JSKitLib[action + "Class"](link, + "js-kit-follow-activeNotifyMode-" + so.notifyMode); + }); + }, + "onload" : function(profile) { + if (profile.isYours()) so.profile = profile.getProfileID(); + applyFollowPanelsCallback(function(panel) { + var link = panel.get("editProfileLink"); + JSKitLib.text($JCL("follow_editProfile"), link, true); + JSKitLib.removeClass(link, "js-kit-follow-openingProfile"); + JSKitLib.addClass(panel.get("rssThreadButton"), "js-kit-follow-rssButton"); + }); + } + } + }, extraConfig || {}, function(value, acc, key) { acc[key] = value; }); + if (!$JSKitGlobal.profileObjectInitialized) { + $JSKitGlobal.isProfileLoaded = "no"; + JSKitLib.addScript(s.uriDomain + "/widgets/profile.js", target, function() { + $JSKitGlobal.isProfileLoaded = "yes"; + JSKW$openProfile(data.profile, target, config); + }); + } else JSKW$openProfile(data.profile, target, config); +} + +JSCC.prototype.appendProfileHandler = function(target, data) { + var self = this; + var isAvailable = this.serverOptions.showProfile && (data.profile || data.ProfileURL); + var avatarDims = {"width": "48", "height": "48"}; + var openProfile = function(element) { + JSKitLib.addEventHandler(element, ["click"], function(e) { + JSKitLib.stopEventPropagation(e); + JSKitLib.preventDefaultEvent(e); + self.showProfile(target, data); + return false; + }); + }; + JSKitLib.addClass(target, "js-kit-clickable"); + if (this.IM || this.getSkin() != "echo") return openProfile(target); + if (data.event_publisher) { + data.Name = data.content.user.name + } + var descr = { + "avatar": function(element) { + var container = { + "instance": element, + "width": avatarDims.width, + "height": avatarDims.height + }; + self.appendAvatarImage(container, data); + if (isAvailable) openProfile(element); + } + }; + if (isAvailable) descr.name = descr.viewDetails = function(element) { openProfile(element); }; + var config = { + "labels": $JCL, + "uriDomain": self.uriDomain, + "uriAvatar": self.uriAvatar, + "avatarSize": avatarDims, + "cssPrefix": "js-kit-singleCmtMiniProfile js-kit-singleCmtProfile" + (isAvailable ? "Enabled" : "Disabled"), + "descriptors": descr, + "openFullProfile": function() { self.showProfile(target, data); }, + "isNativeProfileDisabled": !isAvailable + }; + + eval("var wp = " + JSKitLib.htmlUnquote((data.Webpresence || "[]"))); + var webpresence = JSKitLib.fmap(wp, function(item) { + if (!item[2] || item[2] == "checked") { + var type = item[0].replace(/login-/, ""); + var group = item[0].match(/login-/) ? "login" : "web"; + if (group == "web" && !self.serverOptions.extraFieldURL) return; + var identity = self.jskauth.assembleIdentity(item[1], type, group); + if (type == "gfc" && self.jskauth.getAuthIdentity("gfc")) { + identity.url = item[1]; + identity.params.domain = self.config.domain; + } + return identity; + } + }); + var url = data.Url ? [self.jskauth.assembleIdentity(data.Url, "home", "web")] : []; + data.identities = {"auth": {}, "web": JSKitLib.merge(webpresence, url)}; + + var clearTimer = function(timer) { + clearTimeout(timer); + timer = undefined; + }; + var openMiniProfile = function(ttl) { + clearTimer(self.miniProfileCollapseTimer); + self.miniProfileExpandTimer = setTimeout(function() { + if (data.miniProfile) { + data.miniProfile.display(target); + } else { + data.miniProfile = new JSKitMiniProfile(target, data, config); + } + data.miniProfile.getContent().onmouseover = function() { + clearTimer(self.miniProfileCollapseTimer); + }; + }, ttl); + }; + target.onclick = function() { openMiniProfile(0); } + target.onmouseover = function() { openMiniProfile(JSCC.MINI_PROFILE_TTL); } + target.onmouseout = function() { + clearTimer(self.miniProfileExpandTimer); + self.miniProfileCollapseTimer = setTimeout(function() { + JSKW$Events.syncBroadcast("miniProfile_collapseAll"); + }, JSCC.MINI_PROFILE_TTL); + }; +} + +JSCC.prototype.fixComment = function(cmt, obj, pageIdx, globalIdx, itemsOnPage) { + var self = this; + if (obj.profile == this.serverOptions.profile) obj.yours = true; + var so = this.serverOptions; + var cfg = this.config; + var typeCondition = obj.msgtype && obj.msgtype.match(/T|P/) && !so.trackbackreply; + var flagCondition = !so.commod || obj.yours || cfg.nolc || typeCondition; + var anonymous = so.anonymousCmt && !self.jskauth.isLogged(); + + self.objById[obj.ID] = obj; + if(obj.status == 'D') { + cmt.style.display = 'none'; + return; + } + + if(obj.depth) { + cmt.style.marginLeft = this.level4margin(obj.depth) + } else { + obj.depth = 0; + } + + var ctls = JSKitLib.mapClass2Object({}, cmt); + cmt.ctls = ctls; + cmt.cobj = obj; + var imgArea = cmt.ctls["js-singleCommentPreviewImage"]; + if (imgArea && cmt.cobj.imgs && cmt.cobj.imgs.length && self.config.uploadImages){ + self.addChild(imgArea,self.createImages(cmt.cobj.imgs)); + imgArea.style.display = "block"; + } + + var jsc = function(t){return ctls['js-singleComment'+t]} + + var switchClasses = function(controls, class2add, class2remove) { + JSKitLib.fmap(controls, function(element) { + JSKitLib.addClass(element, class2add); + JSKitLib.removeClass(element, class2remove); + }); + }; + + var appendHoverActions = function(controls){ + var container = jsc(""); + if (!container || self.getSkin() != "echo") return; + JSKitLib.addEventHandler(container, ["mouseout"], function() { + switchClasses(controls, "jsk-SecondaryFontColor", "jsk-LinkColor"); + }); + JSKitLib.addEventHandler(container, ["mouseover"], function() { + switchClasses(controls, "jsk-LinkColor", "jsk-SecondaryFontColor"); + }); + }; + + cmt.bg = jsc('Bg'); + var stripe = jsc('Body') || jsc(''); + stripe.className += " js-singleCommentDepth" + (obj.depth || 0); + if (this.useEcho()) { + if (obj.depth) { + stripe.className += " jsk-TrinaryBackgroundColor jsk-ItemWrapperChild"; + switchClasses([cmt.bg], 'jsk-TrinaryBackgroundColor', 'js-singleCommentBg'); + } else if (obj.thread && obj.thread.length) { + stripe.className += " jsk-ItemWrapperThread"; + } + } + if(!(cmt.style.display.match(/none/))){ + stripe.className += " js-comment-stripe-" + ((globalIdx % this.stripecount) + 1); + } + + if(self.IM && typeof(obj.conversation)=='number') { + if(obj.hasCnvs) { + this.appendConversation(cmt, obj.conversation); + } else { + this.appendConversationChild(cmt); + } + } + + /* Handle avatars */ + if(obj.status!='DT' && obj.status!='DD') self.placeAvatar(obj, jsc('Avatar')); + + /* Handle if ratings are present */ + if (obj.Rating > 0 && ( ! this.isStandalone()) ) { + var self = this; + var action = function() { + if (!jsc('Rating')) return; + jsc('Rating').appendChild(self.createMiniStarObject(obj.Rating, 10)); + jsc('Rating').appendChild(JSKitLib.html('
    ')); + JSKitLib.show(jsc('Rating')); + } + $JSKitGlobal.tryRatingsAppObjectAction(this.uniq, action); + } else { + if (jsc('Rating')) JSKitLib.hide(jsc('Rating')); + } + + var sa = jsc("Name"); + if(sa) { + self.rerenderName(cmt); + if(obj.admin) sa.className = sa.className + " js-siteAdmin"; + } + + var renderKarmaView = function(karma, container, value, voters) { + JSKitLib.text(karma.score, value, true); + JSKitLib.text(karma.votesText, voters, true); + JSKitLib.show(container, "inline"); + }; + var kS = jsc("KarmaScore"); + if(kS && obj.karma) { + var kVal = jsc("KarmaValue"); + var kVot = jsc("KarmaVoters"); + if(obj.karma.votes) renderKarmaView(obj.karma, kS, kVal, kVot); + var setKarmaAction = function(name, score) { + if (!jsc(name)) return; + JSKitLib.setEventHandler(jsc(name), ['click'], function() { + obj.karma.recomputeScore(score); + renderKarmaView(obj.karma, kS, kVal, kVot); + this.blur(); + }); + } + setKarmaAction("KarmaY", 1); + setKarmaAction("KarmaN", -1); + } + if(jsc("KarmaShow") && obj.karma && obj.yours && obj.karma.votes) { + renderKarmaView(obj.karma, jsc("KarmaShow"), jsc("KarmaValueShow"), jsc("KarmaVotersShow")); + } + if (so.likedBy && jsc("LikedBy")){ + var anonymousAvatar = self.avatarsManager.anonymousAvatarData(); + eval("var votersList = " + (obj.like || "[]") + ";"); + obj.likeInstance = new JSCCLike({ + "ID" : obj.ID, + "jx": self.jcaIndex, + "ref": JSKitLib.getRef(self), + "path": self.pathOverride, + "voters" : votersList, + "target" : jsc("LikedBy"), + "profile": function(){ return self.serverOptions.profile; }, + "translator" : $JCL, + "onInit" : function(){ + var expandMarker = this.getExpandMarker(); + if (expandMarker) appendHoverActions([expandMarker]); + }, + "onVoterInit" : function(target, data){ + var avatar = data.avatarData || anonymousAvatar; + data.avatar = avatar.name; + data.avatarWidth = avatar.width; + data.avatarHeight = avatar.height; + delete data.avatarData; + self.appendProfileHandler(target, data); + }, + "onVoterRender" : function(dom, data){ + self.avatarsManager.assembleAvatar({ + "instance": dom.get("avatar"), + "width": "16", + "height": "16" + }, data.avatar || anonymousAvatar); + }, + "likeControl": jsc("Like") + }); + } + + var functionsToBind = [ + ["Edit", "ShowCommentDialog", [{isEditing: true}]], + ["Flag", "markOffensive"], + ["Like", "postLikeVote"], + ["Reply", "ShowCommentDialog"], + ["Block", "cmtBlock"], + ["Delete", "cmtDelete"], + ["Approve", "cmtApprove"], + ["Moderate","cmtBlock"], + ["ComModMark", "markOffensive"], + ["ApproveUser", "cmtApproveUser"] + ]; + + JSKitLib.fmap(functionsToBind, function(list){ + (function(elementName, funcName, args) { + if (!jsc(elementName)) return; + args = args || []; + args.unshift(cmt.id); + JSKitLib.setEventHandler(jsc(elementName), ['click'], function(){ + self[funcName].apply(self, args); + }); + }).apply(self, list); + }); + + var elementVisibilityConditions = { + "IP" : !self.adminMode, + "Url" : obj.Url, + "Karma" : !this.scoringEnabled() || obj.yours || !obj.karma || typeCondition || cfg.nolc, + "ComMod" : flagCondition, + "LikedBy" : !so.likedBy, + "Editable" : cfg.editable != 'yes' || cfg.nolc || !(self.adminMode || self.ownerMode), + "Likeable" : !so.likedBy || anonymous, + "Flagable" : flagCondition, + "Deletable" : (!self.adminMode || !obj.event_type) && ((!obj.yours && !self.IM && !self.ownerMode) || (self.adminMode && !cfg.nolc)), + /* FIXME(?) Lev, this.serverOptions are not defined in moderation mode but the result is likely as desired, i.e. admin can still reply */ + "Replyable" : so.mmode == "pause" || !self.isSourceAvailable("Comments") || typeCondition || (cfg.nolc && (!self.IM || obj.yours)), + "Moderatable" : !self.adminMode || cfg.nolc, + "ApproveUser" : so.mmode != "onhold", + "ProfileLinkable" : !obj.profile || cfg.nolc + }; + JSKitLib.fmap(elementVisibilityConditions, function(flag, name){ + if (jsc(name) && flag) JSKitLib.hide(jsc(name)); + }); + + cmt.bg.style.zIndex = this.czidx - (pageIdx % this.czidx); + cmt.domINFO = jsc('INFO'); + cmt.domCtls = jsc('Ctls') || jsc('controls'); + + if(obj.status == 'S') + this.cmtSetSpamStatus(cmt, true); + + if(obj.status == 'O') + this.cmtSetOffensiveStatus(cmt, true); + + if(obj.admin) { + JSKitLib.addClass(cmt, "js-commentByAdmin"); + if(cfg.adminBgColor) { + cmt.style.backgroundColor = cfg.adminBgColor; + cmt.bg.style.backgroundColor = cfg.adminBgColor; + } + var star = jsc('AdminStar'); + if(star) JSKitLib.show(star, 'inline'); + } + + if(obj.status == 'DT') { + if(cmt.domINFO) JSKitLib.hide(cmt.domINFO); + if(cmt.domCtls) JSKitLib.hide(cmt.domCtls); + } + if(obj.status == 'DD') { + if(cmt.domCtls) JSKitLib.hide(cmt.domCtls); + this.placeProcessAvatar(jsc('Avatar')); + } + if(jsc("Checkbox")) { + var checkbox = jsc("Checkbox"); + var state = this.moderationCommentsList[obj.ID] ? "checked" : "unchecked"; + this.setInputState("checkbox", checkbox, state); + checkbox.onclick = function() { + var state = self.moderationCommentsList[obj.ID] ? "unchecked" : "checked"; + self.setInputState("checkbox", checkbox, state); + self.moderationCommentsListUpdate(obj.ID, state == "checked"); + }; + } + if(jsc("Menu")) { + if(!obj.menu) + obj.menu = self.addMenu(cmt, obj); + if(obj.menu) + jsc("Menu").appendChild(obj.menu); + } + if(jsc("ViaIcon")) JSKitLib.addPNG(jsc("ViaIcon"), obj.content.service.iconUrl); + var controls = JSKitLib.fmap(["Flag", "Like", "Reply", "Moderate", "Edit", "Delete", "ViaThirdPartyService"], function(name){ + var element = jsc(name); + if (element) return element; + }); + appendHoverActions(controls); +} + +JSCC.prototype.setInputState = function(type, element, state) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/common/" + type + "_" + state + ".png"); +} + +JSCC.prototype.level2margin = function(level) { + if(level < 20) return "10px"; + if(level < 40) return "4px"; + return "0px"; +} +JSCC.prototype.level4margin = function(level) { + switch (this.config.skin) { + case 'echo': + if(level > 1) level = 1; + return ((parseInt(this.maxAvatarDims.width) + 10) * level) + 'px'; + default: + if(level <= 20) return (10 * level) + 'px'; + if(level <= 40) return (200 + 4 * level) + 'px'; + return '280px'; + } +} +JSCC.prototype.cmtInDiv = function(div, obj, fincb) { + JSKW$Events.syncBroadcast("smileys-newCommentInDiv", obj); + if (!obj.isEditing) { + var cIdx, insBefore = false; + if(this.config.backwards == 'yes') { + var fitem = this.jspg.getFirstItem(); + if(fitem) { + cIdx = fitem.obj.ID; + insBefore = true; + } + } + if(this.config.thread != 'yes') { + obj.Notice = $JCL('commentMoveNotice'); + cIdx = obj.ParentID || cIdx; + delete obj.ParentID; + delete obj.depth; + } + if(this.useEcho()) { + cIdx = this.jspg.getPlaceIdxByTS(obj.TS); + insBefore = true; + } + obj.cedge = 3; + if(obj.ParentID) { + obj.cedge = 0; + var prn = this.objById[obj.ParentID]; + var td = (prn && prn.depth) ? prn.depth : 0; + if(prn) { + if (this.useEcho()) { + JSKitLib.addClass(this.jspg.getItemById(obj.ParentID).div, 'jsk-ItemWrapperThread'); + } + if(!obj.depth) { + prn.thread.push(obj); + obj.depth = 1 + td; + } + if(this.IM && typeof(prn.conversation)=='number') obj.conversation = prn.conversation; + cIdx = this.getLastReply(obj.ParentID).obj.ID; + insBefore = false; + var curItem = this.jspg.getItemById(cIdx); + if(curItem && curItem.obj.cedge>1) { + obj.cedge = 2; + curItem.obj.cedge -= 2; + var parentPageIdx = this.jspg.getPageByItemId(obj.ParentID); + var insertedPageIdx = this.jspg.getPageByItemId(cIdx); + this.jspg.invalidatePagesView(parentPageIdx, insertedPageIdx-parentPageIdx+1); + } + } + } + + if(this.IM) { + for(var i=0; i 0) { + cmt.cobj.height += cmtHeight; + cmt.style.height = cmt.cobj.height + 'px'; + return true; + } else if (cmt.cobj.cntBorderPause == 8) { + cmt.style.overflow = ""; + cmt.style.height = ""; + cmt.cobj.height = -1; + cmt.cobj.cntBorderPause--; + return true; + } else if (cmt.cobj.cntBorderPause > 0) { + cmt.cobj.cntBorderPause--; + return true; + } else if (cmt.cobj.cntBorderUp < 256) { + cmt.cobj.cntBorderUp += 10; + var blue = cmt.cobj.cntBorderUp; + bg.style.backgroundColor = "rgb(256, 256, " + (blue > 256 ? 256 : blue) + ")"; + return true; + } else { + self.setOpacity(bg, 1); + bg.style.backgroundColor = ""; + delete cmt.cobj.echoItemFirstTime; + return false; + } + } + var oldEffectStep = function(cmt) { + if (cmt.cobj.cntDown > 0) { + self.setOpacity(bg, calcOpacity()); + return true; + } else { + bg.style.backgroundColor = ""; + self.setOpacity(bg, 1); + return false; + } + } + cmt.cobj.cntDown -= cmt.cobj.cntMode ? decr.f : decr.s; + return cmt.cobj.echoItemFirstTime ? echoEffectStep(cmt) : oldEffectStep(cmt); + } + + var runStep = function() { + obj.intvl = setTimeout(function() { + var nextStep = effectStep(cmt); + if (nextStep) runStep(); + else { + obj.intvl = null; + delete obj.havingEffect; + } + }, 50); + }; + runStep(); +} + +JSCC.prototype.foldInputFields = function(e, acc, f) { + if(e.getAttribute) { + var name = e.getAttribute('NAME'); + if(name && (name.substr(0, 6) == 'js-Cmt')) { + var shortName = name.substr(6); + acc = f.call(this, e, acc, shortName) || acc; + } + } + var cn = e.childNodes; + if(cn) { + var clen = cn.length; + for(var i = 0; i < clen; i++) + acc = this.foldInputFields(cn[i], acc, f); + } + return acc; +} + +JSCC.prototype.inputFieldsMsg = function(ctl, cmtObj, pText) { + return this.foldInputFields(ctl, [], function(e, a, name){ + if (e.jsk$not_specified || JHI2.isEmpty(e)) return; + var isText = /^Text(Edit)?$/.test(name); + var text = isText ? pText : e.value; + a.push({"Name": "js-Cmt" + name, "Value": text}); + if(isText && this.serverOptions.htmlMode) + text = text.replace(/<[\/]?[a-z]{1,3}(\s+(href)=[^>]+)?>/g, ''); + //text = text.replace(/&/g, '&').replace(//g, '>'); + cmtObj[name] = text; + }); +} + +JSCC.prototype.cmtAvatarPlaceWidth = function(cobj) { + return cobj.ParentID ? this.maxAvatarDims.width/2 : this.maxAvatarDims.width; +} + +JSCC.prototype.cmtInPlace = function(cobj, fincb) { + var div = this.TC["js-OldComments"]; + cobj.Name = cobj.Name || $JCL("guest"); + this.cmtInDiv(div, cobj, function(cmt) { + if(cmt) this.flash(cmt); + if(fincb) fincb.apply(this, [cmt]); + }); +} + +JSCC.prototype.ShowCommentDialog = function(msgId, extra) { + if(this.commentPostingProcess) { + alert($JCL('messagePostingInProgress')); + return; + } + var s = this; + msgId = msgId || ''; + this.forMsg = this.objById[msgId]; + + /* Remove dialog from sight */ + this.CommentCancelled(); + + extra = extra || {}; + if (s.getSkin() == "echo") { + if (this.TC["js-CmtText"] && (this.jskauth.isLogged() || !this.anonymousCmt)) { + var hint = $JCL("defaultCommentText"); + var input = s.TC["js-CmtText"]; + if (s.serverOptions.wysiwyg) { + hint = '' + hint + ''; + input.hint = hint; + input.value = hint; + } else { + JHI2.remove(input); + JHI2.create(hint, input); + } + } + JSKitLib.fmap(s.serverOptions.wysiwyg ? [] : ["js-CmtText", "js-CmtTextEdit", "jsk-CommentFormBody", "jsk-CommentEditFormBody"], function(name) { + if (s.TC[name]) JSKitLib.addClass(s.TC[name], name + "-noWYSIWYG"); + }); + } + + var isReply = !!msgId; + var cct = this.TC["js-LeaveComment"]; + + if (!this.getSkin().match(/smoothgray|echo/)) this.onAddImgButton(this.imgShow); + + var ccd = this.TC[extra.isEditing ? "js-EditComment" : "js-CreateComment"]; + if (extra.isEditing) { + isReply = false; + var cte = this.TC['js-CmtTextEdit']; + if (this.forMsg.originalText) { + cte.value = this.forMsg.originalText; + } else { + cte.value = this.forMsg.Text.replace(/<\/wbr>/g, ''); + if (!this.serverOptions.wysiwyg) { + cte.value = JSKitLib.htmlUnquote(cte.value); + JSKW$Events.syncBroadcast("smileys-beforePostNewComment", cte); + } + } + } + this.replyForId = (isReply ? msgId : ''); + + var placeDialog = function(immediate, apl) { + if (!apl) apl = [this.TC["js-CommentsArea"], this.TC["js-CommentsArea"].firstChild]; + if(msgId){ + apl[0].insertBefore(ccd, apl[1]); + } else if (this.config.backwards == 'yes') { + apl[0].insertBefore(ccd, this.TC['js-WelcomePanel'] ? apl[1].nextSibling : apl[1]); + } else { + this.addChild(apl[0], ccd); + } + if (extra.isEditing) JSKitLib.hide(apl[1]); + + if(this.config.backwards == 'yes' && msgId) + cct.style.visibility = "hidden"; + else + cct.style.display = "none"; + ccd.style.display = "block"; + try { + var name_suffix = (extra.isEditing ? 'Edit' : ''); + var text = this.TC["js-CmtText" + name_suffix]; + /* TinyMCE support (A) */ + if(!text.id) text.id = "js-CmtText" + name_suffix + "-" + this.jcaIndex; + if(!text.richEditor && this.serverOptions.wysiwyg) try { + text.smoothWysiwygLoading = (s.getSkin() == 'echo' && !extra.isEditing); + if (text.smoothWysiwygLoading) { + if (!text.jsk$cover) { + text.jsk$cover = JSKitLib.html('
    '); + text.jsk$wrapper = s.TC['jsk-CommentFormBody']; + } + text.jsk$wrapper.parentNode.replaceChild(text.jsk$cover, text.jsk$wrapper); + JSKitLib.hide(text.jsk$wrapper); + text.jsk$cover.parentNode.insertBefore(text.jsk$wrapper, text.jsk$cover); + } + var addMCECtrl = function(){ + text.jsk$nofocus = extra.nofocus; + text.jsk$widget = s; + if(s.tmce.foreign) tinyMCE.settings = s.tmce.cfg; + tinyMCE.settings.auto_focus = (extra.nofocus ? null : text.id); + text.jsk$hasDefaultValue = (s.getSkin() == 'echo' && !extra.isEditing); + if (text.jsk$hasDefaultValue) { + var re = new RegExp('(

    )?' + text.hint + '(

    )?'); + text.defaultRemoved = !text.value.match(re); + } + tinyMCE.execCommand('mceAddControl', false, text.id); + text.richEditor = true; + if(text.mceLoadedCtx) { + JSKW$Events.invalidateContext(text.mceLoadedCtx); + text.mceLoadedCtx = null; + } + } + if(window.tinyMCE) { + if(tinyMCE.getInstanceById(text.id) == null) { + setTimeout(function() { addMCECtrl(); }, 0); + } + } else text.mceLoadedCtx = JSKW$Events.registerEventCallback(undefined, addMCECtrl, "mceLoaded"); + } catch(e) {} + + var sub = this.TC["js-Cmtsubmit" + name_suffix]; + var can = this.TC["js-Cmtcancel" + name_suffix]; + var prev = function(e){JSKitLib.stopEventPropagation(e); JSKitLib.preventDefaultEvent(e); return false;} + + if(JSKitLib.isOpera()) { + var onkey = function(){}; + } else if(JSKitLib.isIE()) { + var onkey = function(d,f){d.onkeydown=f}; + } else { + var onkey = function(d,f){d.onkeypress=f}; + } + + /* combined ratings */ + var commentRatingElements = JSKitLib.getElementsByClass(ccd, "js-commentRatingDisplay"); + var commentRatingDisplay = 'none'; + this.submitRating = false; + if (this.hasRatingsAppObject() && ( ! isReply)) { + if (this.TC["js-commentFieldRating"]) { + this.embedRatingsAppObject(this.TC["js-commentFieldRating"]); + commentRatingDisplay = ''; + this.submitRating = true; + } + } + for (var i=0; i < commentRatingElements.length; i++) { + commentRatingElements[i].style.display = commentRatingDisplay; + } + + + var flds = this.foldInputFields(ccd, [], + function(e, a, name) { + var dfl = this.fieldDfl[name]; + if(dfl) { + if(e.jsk$setdfl) + e.jsk$setdfl(dfl); + else if(!e.value) + e.value = dfl; + } + var aclen = a.length; + if(e.richEditor) { + if (e.value) { + e.value = e.value.replace(/^\n\n+/, ''); + if(!e.value.match(/^

    (\n|.)*<\/p>$/)) e.value = '

    ' + e.value + '

    '; + } + var o = { focus: function() { + var setupFocusing = function(ed) { + var keyHandler = function(ed, e) { + if(e.keyCode != 9) return true; + window.focus(); + try { + a[aclen+(e.shiftKey?-1:1)].focus(); + } catch(ex) { ; } + return prev(e); + }; + if (JSKitLib.isIE()) ed.onKeyDown.add(keyHandler); else ed.onKeyPress.add(keyHandler); + } + var ed = tinyMCE.getInstanceById(text.id); + if(ed) { + setupFocusing(ed); + } else { + var t = setInterval(function() { + var ed = tinyMCE.getInstanceById(text.id); + if(ed) { clearInterval(t); setupFocusing(ed); } + }, 100); + } + } }; + if(aclen) onkey(a[aclen-1], function(e) { + e = e || window.event; + if(e.keyCode == 9 && !e.shiftKey) { + this.blur(); + o.focus(); + return prev(e); + } + }); + a.push(o); + } else { + a.push(e); + } + }); + + var okd = function(offset) { return function(e) { + e = e || window.event; + if(e.keyCode != 9) return true; + this.blur(); + flds[offset+(e.shiftKey?(flds.length-2):0)].focus(); + return prev(e); + } } + + onkey(flds[flds.length-1], okd(0)); + onkey(flds[0], okd(1)); + + // Place initial focus. + if(!extra.nofocus) { + for(var i = 0; i < flds.length; i++) + if(!flds[i].value || flds[i].type == 'submit') { + flds[i].focus(); + break; + } + if (s.config.backwards != 'yes') + sub.scrollIntoView(false); + } + } catch(e) { } + }; + if(!msgId) { + placeDialog.apply(this,[true]); + } else { + var id = this.useReplyThreadsCollapsing() || extra.isEditing ? + msgId : this.getLastReply(msgId).obj.ID; + var pn = this.jspg.getPageByItemId(id); + var item = this.jspg.getItemById(id); + item.obj.isEditing = extra.isEditing; + this.displayPage(pn+1, function(immed) { + if (!immed) return; + if (!s.useEcho()) item = s.jspg.getItemById(id); + var placement = [item.div.parentNode, item.div.nextSibling]; + if (extra.isEditing) { + s.editingCmt = item.div.ctls['js-singleCommentText']; + placement = [s.editingCmt.parentNode, s.editingCmt]; + } + placeDialog.apply(s, [true, placement]); + }); + s.setStreamState(true, true); + } + var pb = this.TC["js-poweredBy-echo"] || this.TC["js-poweredByJSKit"]; + if (this.serverOptions.whitelabel && pb) JSKitLib.hide(pb); + + if (s.getSkin() != 'echo') { + var oiddiv = s.TC['js-logoutSpan']; + if (oiddiv) oiddiv.style.display = s.jskauth.isLogged() ? 'inline' : 'none'; + s.jskauth.drawSelector(s.TC['js-authSelector']); + s.setThirdPartyShare(); + s.setNameFieldValue(); + } + return false; +} + +JSCC.prototype.CommentCancelled = function() { + if(this.tmce && (this.serverOptions.media || this.serverOptions.smiley)) + this.tmce.cfg.closePopups(); + var cct = this.TC["js-LeaveComment"]; + var ccd = [this.TC["js-EditComment"], this.TC["js-CreateComment"]]; + if (cct) { + cct.style.visibility = ""; + cct.style.display = ""; + } + var name_suffix = (this.editingCmt ? 'Edit' : ''); + var text = this.TC["js-CmtText" + name_suffix]; + if(text && text.richEditor) { + try { + if (!this.anonymousCmt) { + tinyMCE.triggerSave(false, false); + } + var v = text.value; + tinyMCE.execCommand('mceRemoveControl', false, text.id); //tmce set value from its internal property + text.value = v; + } catch(e) { ; }; + text.richEditor = false; + if(text.mceLoadedCtx) { + JSKW$Events.invalidateContext(text.mceLoadedCtx); + text.mceLoadedCtx = null; + } + } + var s = this; + JSKitLib.fmap(ccd, function(el, i){ + el && el.parentNode && el.parentNode.removeChild(el); + }); + if (this.editingCmt) { + JSKitLib.show(this.editingCmt); + delete this.editingCmt; + } + return false; +} + +JSCC.prototype.smileTag = function(smile) { + return '' + smile.title + ''; +} + +JSCC.prototype.textSmiles2Graphical = function(text, reverse) { + var s = this; + if(window.tinyMCE) tinyMCE.settings.smiley = false; + var flag = true; + var orig = text; + JSKitLib.fmap(s.smiles, function(el, i){ + text = reverse ? text.replace(el.regexpTag, ' ' + i + ' ') : text.replace(el.regexpText, function($0, $1){return ($1 ? $0 : s.smileTag(el));}); + if(window.tinyMCE && flag && (text !== orig)) { + tinyMCE.settings.smiley = true; + flag = false; + } + }); + return text; +} + +JSCC.prototype.thirdPartyImport = function(KVLMsg) { + var s = this; + var text = JSKitLib.stripTags(KVLMsg['js-CmtText']); + var permalink = KVLMsg['permalink'] || s.config.permalink; + var reg = RegExp("^http(.)?://(.*?)/"); + var m = reg.exec(permalink); + var domain = (m && m.length>1) ? m[2] : s.config.domain; + var share_data = { + 'domain': domain, + 'permalink': permalink, + 'Text': text + }; + var createTargetDiv = function() { + var tgt = 'div-sharing-' + Math.random(); + var div = JSKitLib.html(''); + s.target.appendChild(div); + return tgt; + } + var facebook = s.jskauth.getAuthIdentity("facebook"); + if(facebook && KVLMsg['js-CmtShare-facebook']=='on') { + var jsk$fb = new JSKitFBSDK( + JSKitLib.getRef(s), + facebook.params.app_id, + facebook.params.xd_receiver, + function() { + this.shareComment(s.serverOptions.whitelabel); + }, + undefined, + share_data); + } + var gfc = s.jskauth.getAuthIdentity("gfc"); + if(gfc && gfc.params.site && KVLMsg['js-CmtShare-gfc']=='on') { + var jsk$gfc = new JSKitGFC( + JSKitLib.getRef(s), + createTargetDiv(), + gfc.params.site, + function(){ + this.sharedata = share_data; + this.shareComment(); + }); + } +} + +JSCC.prototype.appendFormFields = function(fields, tmpObj) { + var self = this; + var formFields = this.getKVListFromMsg(fields); + var extraFields = JSKitLib.foldl({}, this.extraFormFields, function(value, acc, name) { + if (name != "Email" || self.getSkin() != "echo") acc["js-Cmt" + name] = value; + }); + var mergedFields = JSKitLib.foldl(extraFields, formFields, function(value, acc, name) { acc[name] = value; }); + return JSKitLib.fmap(mergedFields, function(value, name) { + tmpObj[name.replace("js-Cmt", "")] = value; + return {"Name": name, "Value": value}; + }); +} + +JSCC.prototype.CommentSubmitted = function() { + var s = this; + var prn = this.forMsg; + var isEditing = prn && prn.isEditing; + + if(!isEditing && this.serverOptions.requireUsername && this.TC["js-CmtName"] && JHI2.isEmpty(this.TC["js-CmtName"])) { + alert($JCL('nicknameRequired')); + s.TC["js-CmtName"].focus(); + return; + } + + /* TinyMCE support (B) */ + var name_suffix = (isEditing ? 'Edit' : ''); + var text = this.TC["js-CmtText" + name_suffix]; + var textValue; + if(text.richEditor) { + tinyMCE.triggerSave(false, false); + JSKW$Events.syncBroadcast("smileys-beforePostNewComment", text); + textValue = String(text.value). + replace(/(<\/p>)[\r\n]+(

    )/g, '$1$2'). + replace(/(

    ) (<\/p>)/g, '$1$2'). + replace(/

    /g, '\n').replace(/<\/p>/g, '').replace(//g, '\n'). + replace(/^\n/, ''); + } else { + textValue = String(text.value).replace(/&/g, '&'); + } + + var textMsg = (this.getSkin() != "echo" || !JHI2.isEmpty(text)) ? encodeURIComponent(textValue) : ""; + if(!textMsg || !textMsg.length) { + alert($JCL("tooShort")); + return; + } + + var mcl = this.serverOptions.maxCommentLength || 3000; + if(text.value.length > mcl) { + alert($JCL("tooLong",{"maxCommentLength":mcl})); + return; + } + + var form = this.TC[isEditing ? "js-EditComment" : "js-CreateComment"]; + var avt = this.avatarsManager.getActiveAvatar() || 'no'; + var permalink = this.config.permalink; + var moderate = this.config.moderate; + + var tmpObj = {yours:true}; + if(prn) { + if (isEditing) { + tmpObj.ID = prn.ID; + } else { + tmpObj.ParentID = prn.ID; + } + tmpObj.path = prn.path; + if(prn.permalink) { + tmpObj.permalink = prn.permalink; + permalink = prn.permalink; + } + } + + if (this.getSkin() == "echo" && this.extraFormFields["Url"] && this.jskauth.isLogged()) { + this.extraFormFields["Url"] = ""; + } + this.extraFormFields["Name"] = this.getUserProperty("Name", ""); + this.extraFormFields["Email"] = this.getUserProperty("Email", ""); + this.extraFormFields["Webpresence"] = this.getSelectedIdentities(); + + var message = this.appendFormFields(this.inputFieldsMsg(form, tmpObj, textValue), tmpObj); + if (this.getSkin() == "echo") { + message.push({'Name': 'js-CmtNotifyMode', 'Value': s.serverOptions.notifyMode}); + } + + tmpObj["Name"] = tmpObj["Name"] || $JCL("guest"); + + /* combined ratings */ + if (this.submitRating) { + rating = this.getRatingsAppObject().userRating; + message.push({'Name': 'js-CmtRating', 'Value': rating}); + tmpObj.Rating = rating; + } + if(prn && !isEditing) { + message.push({'Name': 'js-CmtParentID', 'Value': prn.ID}); + if(this.IM=='own' && prn.profile) { + message.push({'Name': 'destProfile', 'Value': prn.profile}); + } + } + if(permalink) message.push({'Name': 'permalink', 'Value': permalink}); + if (!isEditing) { + if(avt) message.push({'Name': 'avatar', 'Value': (avt.name ? avt.name : avt)}); + } else { + tmpObj.isEditing = true; + } + + if(moderate) this.pathOverride = this.forMsg.path; + + var onsuccess = function(cmtObj) { + var KVLCmt = s.getKVListFromMsg(message); + // API: subscriber expects + // (ConstructedMessageObject[, FormDOM]) + try { + JSKitAPI.askpublic.call(s, "comment-submit", + s.generateEventParams(KVLCmt), form); + } catch(e) { + return; + } + s.CommentCancelled(); + if (s.TC['js-CmtText' + name_suffix]) { + s.TC['js-CmtText' + name_suffix].value = ''; + } + if (s.clearImgs) { + s.clearImgs(); + } + if (!isEditing) { + s.thirdPartyImport(KVLCmt); + } + if (s.extraControlsMenu) { + s.extraControlsMenu.collapseTabs(); + } + var am = s.avatarsManagement; + if (am && am.avatarsListContainer) { + JSKitLib.hide(am.avatarsListContainer); + } + delete s.replyForId; + } + var onerror = function() { + var cover = s.commentPostingProcess.cover; + if (cover) { + JSKitLib.text($JCL('messagePostFailed'), cover.get("Label"), true); + cover.get("Img").src = "//cdn.js-kit.com/images/warning.gif"; + JSKitLib.show(cover.get("Retry"), "inline"); + } else { + alert($JCL("messagePostFailed")); + s.setStateLCF("enable"); + } + } + this.postComment(tmpObj, message, { + 'onsuccess': onsuccess, + 'onerror': onerror + }); +} + +JSCC.prototype.prepareCommentObj = function(tmpObj) { + var cobj = JSKitLib.cloneObject(tmpObj); + if(cobj.isEditing) { + cobj.Text = cobj.TextEdit; + delete cobj.TextEdit; + } else if (cobj.echoItem) { + cobj.extra = {}; + cobj.thread = []; + } else { + this.tmpID++; + cobj.ID = "jst-" + this.tmpID; + cobj.status = 'A'; + cobj.profile = this.serverOptions.profile; + var avatar = this.avatarsManager.getActiveAvatar(); + if (avatar) { + cobj.avatar = avatar.name; + cobj.avatarWidth = avatar.width; + cobj.avatarHeight = avatar.height; + } + cobj.avatarPlaceWidth = this.cmtAvatarPlaceWidth(cobj); + cobj.extra = {}; + cobj.thread = []; + cobj.depth = 0; + cobj.admin = this.adminMode; + var d = new Date(); + cobj.TS = Math.round(d.valueOf() / 1000) + (this.serverDiffTS || 0); + } + cobj.jcaIndex = this.jcaIndex; + return cobj; +} + +JSCC.prototype.postComment = function(tmpObj, tmpMsg, options) { + var s = this; + var cmtObj = JSKitLib.cloneObject(tmpObj); + if (s.useEcho()) { + cmtObj.echoItemFirstTime = true; + } + if(s.images) cmtObj.imgs = s.images; + var msg = JSKitLib.fmap(tmpMsg, function(e){ return e; }); + + if(cmtObj.ParentID && !this.objById[cmtObj.ParentID]) { + this.invalidateJSPG(); + if(options && options.onerror) options.onerror(); + return; + } + + cmtObj = this.prepareCommentObj(cmtObj); + /* Kick in message submission */ + msg.push({'Name': 'tid', 'Value': cmtObj.ID}); + s.prepareImgData(msg); + var src = (cmtObj.isEditing ? '.edit' : '.put'); + var prms = this.getKVListFromMsg(msg); + s.commentPostingProcess = { + attempts: 1, + attemptsMax: 3, + cmtObj: cmtObj, + start: function(){ + s.commentPostingProcess.timer = setTimeout(function(){ + var p = s.commentPostingProcess; + if(!p) return; + if(p.attempts < p.attemptsMax) { + p.attempts++; + s.commentPostingProcess.start(); + } else { + if(options && options.onerror) + options.onerror(); + } + }, JSCC.REPOST_COMMENT_TIMEOUT); + s.setStateLCF("disable"); + s.server(src, prms, true, {transport: 'POST'}); + }, + stop: function(){ + s.setStateLCF("enable"); + clearTimeout(s.commentPostingProcess.timer); + delete s.commentPostingProcess; + if(options && options.onsuccess) + options.onsuccess(cmtObj); + }, + disableLCF: function() { + var container = s.TC["jsk-CommentFormSurface"]; + if (!container || cmtObj.isEditing) return; + JSKitLib.addClass(container, "js-kit-relative"); + var p = s.commentPostingProcess; + p.enableLCF(); + p.cover = s.assembleCoverLCF(); + container.appendChild(p.cover.content); + p.adjustCoverPosition(container); + }, + enableLCF: function() { + var cover = s.commentPostingProcess.cover; + if (cover && cover.content.parentNode) { + var container = cover.content.parentNode; + container.removeChild(cover.content); + JSKitLib.removeClass(container, "js-kit-relative"); + } + }, + adjustCoverPosition: function(container) { + var cover = s.commentPostingProcess.cover; + if (JSKitLib.isIE()) { + cover.content.style.width = container.offsetWidth+ "px"; + cover.content.style.height = container.offsetHeight + "px"; + } + cover.get("Msg").style.top = (container.offsetHeight - cover.get("Msg").offsetHeight)/2 + "px"; + } + }; + s.commentPostingProcess.start(); +} + +JSCC.prototype.setStateLCF = function(state) { + this.setControlsStateLCF(state, [this.TC['js-Cmtcancel']]); + this.commentPostingProcess[state + "LCF"](); +} + +JSCC.prototype.assembleCoverLCF = function() { + var s = this; + var attachEvent = function(element, extraCallback) { + element.href = "javascript:void(0);"; + element.onclick = function() { + s.setStateLCF("enable"); + delete s.commentPostingProcess; + if (extraCallback) extraCallback(); + return false; + }; + }; + var descriptors = { + "Wrapper": function(element) { + JSKitLib.setOpacity(element, 0.7); + }, + "Label": function(element) { + var attempts = s.commentPostingProcess.attempts; + JSKitLib.text($JCL("posting") + (attempts > 1 ? " (" + $JCL("attempt") + " " + attempts + ")" : "") + "...", element, true); + }, + "Post": function(element) { + attachEvent(element, function() { + s.CommentSubmitted(); + }); + }, + "Cancel": function(element) { + attachEvent(element); + } + }; + return JSKitLib.toDOM(s.gtmpl(s.dtPostingCommentDialog), "js-CommentWaitSubmit", descriptors); +} + +JSCC.prototype.getKVListFromMsg = function(msg) { + var prms = {}; + JSKitLib.fmap(msg, function(v) { prms[v.Name] = v.Value; }); + return prms; +} + +JSCC.prototype.getRatingsAppObject = function() { + return this.isStandalone() ? null : $JSKitGlobal.getRatingsAppObject(this.uniq); +} + +JSCC.prototype.hasRatingsAppObject = function() { + return this.getRatingsAppObject() ? true : false; +} + +JSCC.prototype.embedRatingsAppObject = function(node) { + // One time + if ( ! this.embedRatingsAppObjectCompleted) { + $JSKitGlobal.copyRatingsAppObject(this.uniq, node); + this.embedRatingsAppObjectCompleted = true; + } +} + +JSCC.prototype.createMiniStarObject = function(rating, scale) { + + var rao = this.getRatingsAppObject(); + var fullStar = rao.miniFullStar['user']; + var emptyStar = rao.miniEmptyStar['user']; + var starWidth = rao.miniStarWidth + 'px'; + var starHeight = rao.miniStarHeight + 'px'; + + var setImage = function(star, imageURL) { + if(star.imageURL == imageURL) + return; // Already set and we know it + + star.imageURL = imageURL; + + if(document.body.filters) { + star.runtimeStyle.filter + = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + + imageURL + "', sizingMethod='crop')" + } else { + star.style.backgroundImage = 'url(' + imageURL + ')'; + } + } + + var obj = document.createElement('div'); + + /* Increment by Full Star Ratings */ + for (var i=2; i <= scale; i += 2) { + + var star = this.cr('div'); + + star.style.cssFloat = 'left'; + star.style.styleFloat = 'left'; + star.style.width = starWidth; + star.style.height = starHeight; + + setImage(star, (rating >= i ? fullStar : emptyStar)); + + obj.appendChild(star); + } + + return obj; +} + +JSCC.prototype.rerenderName = function(cmt) { + var self = this; + var ctls = cmt.ctls; + var jsc = function(t){return ctls['js-singleComment'+t]}; + var sn = jsc("Name"); + if(sn && !(cmt.cobj.msgtype && cmt.cobj.msgtype.match(/T|P/))) { + sn.style.cursor = 'pointer'; + self.appendProfileHandler(sn, cmt.cobj); + } + var su = jsc("Url"); + if(su && cmt.cobj.Url && self.serverOptions.extraFieldURL + && !(cmt.cobj.msgtype && cmt.cobj.msgtype.match(/T|P/))) { + su.style.cursor = 'pointer'; + su.setAttribute('title', cmt.cobj.Url); + su.style.display = 'inline'; + su.onclick = function() { + window.open(cmt.cobj.Url, '_blank'); + return false; + } + } +} + +JSCC.prototype.gotPermanentId = function(tmpid, msgId) { + var self = this; + if (!this.commentPostingProcess) return; + var cobj = this.commentPostingProcess.cmtObj; + this.commentPostingProcess.stop(); + cobj.ID = msgId; + self.objById[msgId] = cobj; + var aux = arguments.length > 2 ? arguments[2] : {}; + var props = { + 'status': cobj, + 'Text': cobj, + 'originalText': cobj, + 'mtext': self.serverOptions, + 'mmode': self.serverOptions}; + for(var pname in props) { + if(aux.hasOwnProperty(pname)) { + props[pname][pname] = aux[pname]; + } + } + if (aux.Text) { + JSKW$Events.syncBroadcast('smileys-loadCommentsWidget', cobj, self.jcaIndex); + } + if(!self.serverOptions.profile && aux.profile) { + self.serverOptions.profile = aux.profile; + } + if (aux.profile) { + cobj.profile = aux.profile; + } + var fillObject = function(obj) { + if (aux.avatar) { + obj.avatar = aux.avatar; + obj.avatarWidth = aux.avatarWidth; + obj.avatarHeight = aux.avatarHeight; + obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(obj); + } + if (aux.destName) { + obj.destName = aux.destName; + } + if (aux.gravatarId) { + obj.GravatarID = aux.gravatarId; + } + return obj; + }; + cobj = fillObject(cobj); + var cnvsObj = fillObject({"Name": cobj.Name}); + if(aux.avatar || aux.gravatarId) { + self.placeAvatar(cobj); + } + if(this.IM && cobj.waitConversation) { + cnvsObj.direction = "out"; + this.conversations[cobj.waitConversation.cnvsIdx] = cnvsObj; + cobj.conversation = cobj.waitConversation.cnvsIdx; + cobj.waitConversation = false; + cobj.hasCnvs = false; + } + this.isCommentSender = true; + this.routeAction(function() { + if (!this.isSourceAvailable("Comments")) return; + this.cmtInPlace(cobj, function() { + if (!this.isCommentSender) return; + this.controls.reveal(); + this.reCalcPages(); + if (this.useEcho() && this.serverOptions.expandLeaveCmt && !this.config.noautoexpand) { + this.ShowCommentDialog(undefined, {nofocus: true}); + } + delete this.isCommentSender; + }); + }); + this.publishEvent(tmpid == msgId ? 'comment-edited' : 'comment-added', {'cmtId': msgId}); +} + +function JSReplyMSGId(tmpid, msgId) { + try { + var cobj; + var widget; + for(var i = 0; i < $JCA.length; i++) { + var p = $JCA[i].commentPostingProcess; + if(p && p.cmtObj && p.cmtObj.ID == tmpid && p.cmtObj.jcaIndex == $JCA[i].jcaIndex) { + cobj = p.cmtObj; + widget = $JCA[i]; + break; + } + } + if (widget) widget.gotPermanentId.apply(widget, arguments); + } catch(e){} +} + +function JSDeleteMSGId(msgId, jcaIndex, deletedCount) { + try { + var self = $JCA[jcaIndex]; + var item = self.jspg.getItemById(msgId); + if(item) { + var cmt = item.div; + if(cmt.cobj.action) + JSKW$Events.syncBroadcast("comments_serverRequest_" + cmt.cobj.action); + self.routeAction(function() { + if(deletedCount>1){ + this.tag = null; + this.invalidateJSPG(); + var pageNo = this.curPage; + this.curPage = 0; + this.displayPage(pageNo); + } else { + this.postHandlerDelete(cmt); + } + }); + } + } catch(e){} +} + +function JSMarkOffensive() { + alert($JCL('markoffMessage')); +} + +function JSCCLike(config) { + this.uriAvatar = JSCC.URI_AVATAR; + this.uriDomain = JSCC.DOMAIN; + this.avatarSize = {"width": "16", "height": "16"}; + JSKitLib.fmap.call(this, config, function(v, k){ this[k] = v; }); + this.voters = {"raw": this.voters}; + this.initVoters(); + this.loadCSS(); +} + +JSCCLike.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-like-label { float: left; margin-right: 5px; }" + + ".js-kit-like-expand { float: left; cursor: pointer; }" + + ".js-kit-like-name { float: left; }" + + ".js-kit-like-avatar { float: left; margin-right: 2px; }" + + ".js-kit-like-userButton { float: left; height: 16px; margin: 0px 5px 2px 0px; cursor: pointer; }" , "like"); +} + +JSCCLike.prototype.label = function(key, data){ + return this.translator("like_" + key, data); +} + +JSCCLike.prototype.initVoters = function(){ + var self = this; + + //if voters list contains more than 7 voters - display 5 voters and expand marker + this.displayLimit = {"reduced": 5, "full": 7}; + + var i = 0; + while (i < this.voters["raw"].length){ + if (this.voters["raw"][i].profile == this.profile()){ + //if voters list contains your profile we will show it first + this.voters["raw"].unshift(this.voters["raw"].splice(i, 1).shift()); + this.voted = true; + break; + } + i++; + } + this.guestsCount = 0; + this.voters["normalized"] = JSKitLib.filter(function(voter){ + if (voter.name == "" && voter.profile != self.profile()) self.guestsCount++; + return (voter.name != "" || voter.profile == self.profile()); + }, this.voters["raw"]); + if (this.guestsCount > 0) { + this.displayLimit["full"]--; + this.displayLimit["reduced"]--; + } + if (this.voters["normalized"].length > this.displayLimit["full"]) { + this.voters["reduced"] = this.voters["normalized"].slice(0, this.displayLimit["reduced"]); + } else delete(this.voters["reduced"]); + this.assemble(); + this.renderLikeControl(); +} + +JSCCLike.prototype.renderLikeControl = function(flag) { + var label = this.voted ? "unlike" : "like"; + JSKitLib.text(this.label(label + (flag ? "_progress" : "")), this.likeControl, true); + this.likeControl.title = this.label(label + "_title"); +} + +JSCCLike.prototype.sendRequest = function(obj) { + var params = { + "p": this.path, + "id": this.ID, + "jx": this.jx, + "action": this.voted ? "unlike" : "like" + }; + var request = JSKitLib.foldl(obj, params, function(value, acc, key) { acc[key] = value; }); + new JSRVC({ + "uri": this.uriDomain + '/comment-karma', + "request": request, + "ref": this.ref, + "epb": window.JSKitEPB ? JSKitEPB.getAsHash() : {} + }); +} + +JSCCLike.prototype.vote = function(action, obj) { + var voterInList = JSKitLib.lookup(function(voter){ + return voter.profile == obj.profile; + }, this.voters["raw"]); + + if (action == "like" && !voterInList) { + this.voters["raw"].unshift(obj); + this.initVoters(); + } + if (action == "unlike" && voterInList) { + this.voters["raw"] = JSKitLib.filter(function(voter){ + return voter.profile != obj.profile; + }, this.voters["raw"]); + this.voted = false; + this.initVoters(); + } +} + +JSCCLike.prototype.assembleVotersList = function(voters) { + var self = this; + var container = []; + var assembleSingleVoter = function(textLabel, avatar){ + var template = + '

    ' + + '
    ' + + '
    ' + textLabel + '
    ' + + '
    ' + + '
    '; + var dom = JSKitLib.toDOM(template, "js-kit-like-", {}); + self.onVoterRender(dom, {"avatar": avatar}); + return dom.content; + }; + JSKitLib.fmap(voters || [], function(voter){ + var avatar = voter.avatar ? { + "name": voter.avatar, + "width": voter.avatar_width, + "height": voter.avatar_height + } : undefined; + var textLabel = (voter["profile"] == self.profile()) ? self.label("you") : voter["name"]; + var singleVoter = assembleSingleVoter(textLabel, avatar); + self.onVoterInit(singleVoter, { + "Name": voter.name, + "profile": voter.profile, + "avatarData": avatar + }); + container.push(singleVoter); + }); + if (this.guestsCount > 0){ + var textLabel = self.label((self.guestsCount > 1) ? "guests" : "guest", {"guestsCount": self.guestsCount}); + container.push(assembleSingleVoter(textLabel)); + } + return container; +} + +JSCCLike.prototype.assemble = function() { + var self = this; + if (!self.voters["normalized"].length && self.guestsCount == 0) { + JSKitLib.removeChildren(self.target); + return; + } + + var descriptors = [ + function(container) { + container.appendChild(JSKitLib.html('
    ' + self.label("likedBy") + '
    ')); + }, + function(container){ + JSKitLib.fmap(self.assembleVotersList(self.voters["reduced"] && !self.expanded ? self.voters["reduced"] : self.voters["normalized"]), function(userButton){ + container.appendChild(userButton); + }); + }, + function(container){ + if (!self.voters["reduced"]) return; + self.expandMarker = JSKitLib.html('
    '); + var expandLabel = self.label(self.expanded ? "collapseList" : "andXMore", {"count" : self.voters["normalized"].length - self.displayLimit["reduced"]}); + JSKitLib.text(expandLabel, self.expandMarker, true); + JSKitLib.preventSelect(self.expandMarker); + JSKitLib.setEventHandler(self.expandMarker, ["click"], function(){ + self.expanded = !self.expanded; + JSKitLib.removeChildren(self.target); + self.assemble(); + }); + container.appendChild(self.expandMarker); + } + ]; + JSKitLib.removeChildren(self.target); + JSKitLib.fmap(descriptors, function(descriptor){ + descriptor(self.target); + }); + this.onInit(); +} + +JSCCLike.prototype.getExpandMarker = function(element){ + return this.expandMarker; +} + +function JSCCKarma(cObj, self) { + var kObj = { p: cObj.karmaP || 0, n: cObj.karmaN || 0 }; + this.score = kObj.p - kObj.n; + this.votes = kObj.p + kObj.n; + this.cObj = cObj; + this.self = self; + this.vote2text(); + return this; +} +JSCCKarma.prototype.vote2text = function() { + this.votesText = this.votes + ' ' + + ((this.votes == 1) ? $JCL("vote") : $JCL("votes")); +} + +JSCCKarma.prototype.recomputeScore = function(scoreAdjustment) { + var now = new Date(); + if(this.votedAlready) { + this.score -= this.myVote; + } else { + this.votes += 1; + this.votedAlready = true; + var kObj = this; + setTimeout(function() { + var action = kObj.myVote > 0 ? '+' : '-'; + kObj.self.server('-karma', {'id': kObj.cObj.ID, + 'action': action}); + }, 2000); + } + this.score += scoreAdjustment; + this.myVote = scoreAdjustment; + this.vote2text(); +} + +JSCC.prototype.divPages = function(so, items) { + var srv = so.pages; + this.curPage = 0; + var self = this; + if(!this.jspg && !this.useEcho()) { + this.jspg = new JSPGC(items.length, srv.ps); + this.jspg.dataRequest = function(pageIdx, pg, cb) { + var pageNo = pageIdx+1; + if(!pg.target) pg.target = self.cr('div'); + var tgt = pg.target; + if(tgt.parentNode) tgt.parentNode.removeChild(tgt); + self.dataLoader = function() { + self.renderLeaveCommentForm(); + self.curPage = 0; + self.displayPage(pageNo, function(immed){ cb.apply(self, [undefined, immed])}); + } + if(srv.pn < 10) + srv.pn += 5; + self.getpages(pageNo - Math.ceil(srv.pn / 2), {'pn[0]': srv.pn}); + JSKitLib.text($JCL("loading"), tgt, true); + return cb(tgt, false); + }; + this.jspg.dataVisualizator = function(sIdx, arr, pg, cb) { + if(!pg.target) pg.target = self.cr('div'); + var tgt = pg.target; + if(tgt.parentNode) tgt.parentNode.removeChild(tgt); + var itemsOnPage = arr.length; + var cnvs = []; + var cn = JSKitLib.fmap(arr,function(V,K){ + if(!V.html) { + var oldN = V.obj.Name; + V.obj.Name = (self.IM && V.obj.yours) ? 'Me' : oldN; + var oldT = V.obj.Text; + if(V.obj.status=='DT') V.obj.Text = 'Deleted'; + if (V.obj.Url && !V.obj.Url.match(/^https?:\/\//) ) { + V.obj.Url = "http://" + V.obj.Url; + } + V.obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(V.obj); + V.html = self.createCommentAsHTML(V.obj); + V.obj.Name = oldN; + V.obj.Text = oldT; + delete V.div; + } + V.div = JSKitLib.html(V.html); + V.div.id = V.obj.ID; + V.obj.hasCnvs = !cnvs[V.obj.conversation]; + cnvs[V.obj.conversation] = true; + self.fixComment(V.div, V.obj, K, K+sIdx, itemsOnPage); + return V; + }); + JSKitLib.removeChildren(tgt); + self.pageHeader(tgt, sIdx, arr, itemsOnPage); + if(self.dtGroupModeration) + tgt.appendChild(self.groupModerationBlock(self.dtGroupModeration)); + for(var i=0; i1) { + var crdiv = function(className) { + var div = self.cr("div"); + div.className = className; + return div; + }; + var div = crdiv("js-TornPageDivider"); + var divT = crdiv("js-TornPageDividerTop"); + var divB = crdiv("js-TornPageDividerBottom"); + div.appendChild(divT); + div.appendChild(divB); + tgt.appendChild(div); + } + } + self.pageFooter(tgt, sIdx, arr, itemsOnPage); + if(self.dtGroupModeration) + tgt.appendChild(self.groupModerationBlock(self.dtGroupModeration)); + return cb(tgt, true); + }; + } + if(!this.jspg && this.useEcho()) { + this.jspg = new JSKEchoPGC(srv.ps, srv.echo_after); + this.jspg.dataRequest = function(pageIdx, more, echo_after, cb) { + var pageNo = pageIdx+1; + if(!self.jspg.target) self.jspg.target = self.cr('div'); + var tgt = self.jspg.target; + if(tgt.parentNode) tgt.parentNode.removeChild(tgt); + if(!more) JSKitLib.removeChildren(tgt); + self.dataLoader = function() { + self.renderLeaveCommentForm(); + self.curPage = 0; + self.displayPage(pageNo, function(immed){ cb.apply(self, [undefined, immed])}); + } + var params = {'echo[0]': true}; + if (more && echo_after) params['echo_after[0]'] = echo_after; + self.getpages(undefined, params); + var pageNav = self.TC['js-PageNavBottom']; + if(pageNav) { + JSKitLib.removeChildren(pageNav); + pageNav.appendChild(JSKitLib.html('
    ' + $JCL("loading") + '
    ')); + } + self.jspg.loading = true; + return cb(tgt, false); + }; + this.jspg.dataVisualizator = function(arr, cb) { + if(!self.jspg.target) self.jspg.target = self.cr('div'); + var tgt = self.jspg.target; + var itemsOnPage = arr.length; + var cnvs = []; + var cn = JSKitLib.fmap(arr,function(V,K){ + if(!V.html) { + var oldN = V.obj.Name; + V.obj.Name = (self.IM && V.obj.yours) ? 'Me' : oldN; + var oldT = V.obj.Text; + if(V.obj.status=='DT') V.obj.Text = 'Deleted'; + if (V.obj.Url && !V.obj.Url.match(/^https?:\/\//) ) { + V.obj.Url = "http://" + V.obj.Url; + } + + if(V.obj.event_publisher) { + if(typeof(V.obj.content) == 'string') + eval('var content = ' + V.obj.content + '; V.obj.content = content;'); + + // Removing links to this page + var sanitizer = function(url) { + if (!url) return ''; + if ('/' != url[url.length - 1]) url = url + '/'; + return url.split('#', 2)[0] + .toLowerCase() + .replace(/\butm_(source|medium|term|content|campaign)=[^&$]+(&|$)/g, '') + .replace(/\?*&*$/, '') + .replace(/^https?:\/\/(www\.)?/, '') + .replace(/\/\/+/, '/'); + }; + + var el = document.createElement('div'); + el.innerHTML = V.obj.content.title; + var ref = sanitizer(self.config.permalink); + var links= JSKitLib.getElementsByClass(el, '*', 'a'); + + JSKitLib.fmap(links, function(link) { + var data_resolved = sanitizer(link.getAttribute('data-resolved')); + var href = sanitizer(link.href); + if((href == ref) || (data_resolved == ref)) + link.parentNode.removeChild(link); + }); + + var clearText = JSKitLib.trim(el.innerHTML.replace(/<\/?wbr>/g, '')); + if (clearText == "") { + el.innerHTML = $JCL("sharedThisOn", {"service_name": V.obj.content.service.name || V.obj.event_publisher}); + } + + V.obj.content.title = el.innerHTML; + + if(V.obj.content.user && (V.obj.content.user.profileUrl || V.obj.content.user.avatarUrl)) { + V.obj.avatar = V.obj.GravatarID = (V.obj.content.user.avatarUrl || + V.obj.content.user.profileUrl + "/picture?size=medium"); + V.obj.avatarWidth = "50"; + V.obj.avatarHeight = "50"; + V.obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(V.obj); + V.obj.ProfileURL = V.obj.content.user.profileUrl; + } + V.html = self.tmpl(self.ffComment, V.obj); + } else { + V.obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(V.obj); + V.html = self.createCommentAsHTML(V.obj); + } + V.obj.Name = oldN; + V.obj.Text = oldT; + V.$olddiv = V.div; + V.$isnew = true; + V.div = JSKitLib.html(V.html); + if (V.obj.extra && V.obj.extra.cssClass) { + JSKitLib.addClass(V.div, V.obj.extra.cssClass); + } + } + V.div.id = V.obj.ID; + V.obj.hasCnvs = !cnvs[V.obj.conversation]; + cnvs[V.obj.conversation] = true; + if(V.obj.echoItemFirstTime && !V.obj.havingEffect) { + V.div.style.overflow = 'hidden'; + V.div.style.height = "1px"; + V.obj.height = 1; + } + if(V.$isnew) + self.fixComment(V.div, V.obj, K, K, itemsOnPage); + return V; + }); + for(var i=0; i0) { + req.variableRequest = idlist.spam; + req.request.junk = 'no'; + req.uri = this.uriDomain + '/comments-junk'; + new JSRVC(req); + } + if(idlist.appr.length>0) { + req.variableRequest = idlist.appr; + req.uri = this.uriDomain + '/comments-approve'; + new JSRVC(req); + } + if(idlist.del.length>0) { + req.variableRequest = idlist.del; + req.request.apr = 'message'; + req.uri = this.uriDomain + '/comments-del'; + new JSRVC(req); + } + break; + case 'delete': + req.uri = this.uriDomain + '/comments-del'; + new JSRVC(req); + break; + case 'spam': + req.request.junk = 'yes'; + req.uri = this.uriDomain + '/comments-junk'; + new JSRVC(req); + break; + case 'user': + req.request.apr = 'user'; + req.uri = this.uriDomain + '/comments-del'; + new JSRVC(req); + break; + case 'blockuser': + req.request.by = 'user'; + req.uri = this.uriDomain + '/comments-block'; + new JSRVC(req); + break; + case 'blockip': + req.request.by = 'ip'; + req.uri = this.uriDomain + '/comments-block'; + new JSRVC(req); + break; + case 'unban': + if(this.config.permalink) req.request.permalink = this.config.permalink; + req.request.unban = 1; + req.uri = this.uriDomain + '/comments-approve'; + new JSRVC(req); + break; + }; +} + +JSCC.prototype.pageHeader = function(target, globalIndex, items, itemsOnPage) { + if(this.getSkin()=='smoothgray' && itemsOnPage>0 && items.length>0 && (!this.adminMode || this.inlineModeration)) { + var obj = items[0].obj; + if(obj.cedge!=3 && obj.cedge!=1) { + var div = this.cr("div"); + div.className = "js-TornPageTop"; + if(JSKitLib.isIE()) { + var img = this.cr("img"); + img.className = "js-TornPageTopImg"; + img.src = "//cdn.js-kit.com/images/tornPaperT.gif"; + div.appendChild(img); + } + target.appendChild(div); + } + } +} + +JSCC.prototype.pageFooter = function(target, globalIndex, items, itemsOnPage) { + if(this.getSkin()=='smoothgray' && itemsOnPage>0 && items.length==itemsOnPage && (!this.adminMode || this.inlineModeration)) { + var obj = items[itemsOnPage-1].obj; + if(obj.cedge!=3 && obj.cedge!=2) { + var div = this.cr("div"); + div.className = "js-TornPageBottom"; + if(JSKitLib.isIE()) { + var img = this.cr("img"); + img.className = "js-TornPageBottomImg"; + img.src = "//cdn.js-kit.com/images/tornPaperB.gif"; + div.appendChild(img); + } + target.appendChild(div); + } + } +} + +JSCC.prototype.htmlPaginate = function(thread) { + return this.htmlPaginator(thread, []); +} + +JSCC.prototype.htmlPaginator = function(thread, arr) { + var tl = thread.length; + for(var i = 0; i < tl; i++) { + var obj = thread[i]; + var present = (obj.status == 'D') ? 0 : 1; + if(present) { + arr.push(obj); + } + this.htmlPaginator(obj.thread, arr); + } + return arr; +} + +JSCC.prototype.restoreEchoAfter = function() { + if(this.useEcho()) { + this.jspg.echo_after = this.jspg.$old_echo_after; + } +} + +JSCC.prototype.invalidateJSPG = function() { + this.restoreEchoAfter(); + this.jspg.invalidate(); +} + +// Part of externally useable API +JSCC.prototype.rerender = function() { + var pageToDisplay = this.curPage; + this.restoreEchoAfter(); + this.curPage = 0; + this.jspg.invalidatePagesView(pageToDisplay-1, 1); + this.displayPage(pageToDisplay); +} + +JSCC.prototype.setPath = function(path) { + this.pathOverride = path; +} + +JSCC.prototype.detectCommentDialogOpened = function() { + var ccd = this.TC[this.forMsg && this.forMsg.isEditing ? "js-EditComment" : "js-CreateComment"]; + return !!ccd && JSKitLib.hasParentNode(ccd) && ccd.style.display == 'block'; +} + +JSCC.prototype.displayPage = function(pageNo, cb) { + if(this.loading && !cb) { + var nt = (new Date()).valueOf(); + if((nt - this.loading) > 5000) { + this.gen++; + } else { + return; + } + } + + if(pageNo < 1) + return; + + if(pageNo > this.jspg.pageCount) + pageNo = this.jspg.pageCount; + + var immediate = true; + + if(this.curPage != pageNo) { + var cd = this.detectCommentDialogOpened(); + try { + if (!this.useEcho() || this.forMsg) this.CommentCancelled(); + } catch(e) { } + + if(!this.useEcho()) + try { + if(this.curPage) { + var p = this.jspg.getPage(this.curPage - 1); + if(p && p.target && p.target.parentNode) + p.target.parentNode.removeChild(p.target); + } + } catch(e) { } + var oc = this.TC["js-OldComments"]; + var self = this; + if(this.useEcho()) { + this.curPage = 1; + var pcb = function(p, immed) { + if(p) { + if(self.jspg.target && !JSKitLib.hasParentNode(self.jspg.target)) oc.appendChild(p); + p.style.display = ''; + } + if(immed && cb) cb.apply(self, [immed]); + }; + this.jspg.getPageVisualization(pageNo-1, pcb); + if(cd && this.replyForId) { + var parentMsg = this.jspg.getItemById(this.replyForId); + this.ShowCommentDialog(parentMsg ? this.replyForId : undefined); + } + cd = undefined; + } else { + this.curPage = pageNo; + var pcb = function(p, immed) { + if(p) { + oc.appendChild(p); + p.style.display = ''; + } + if(immed && cb) cb.apply(self, [immed]); + }; + this.jspg.getPageVisualization(pageNo-1, pcb); + } + immediate = false; + if (cd && !this.forMsg) { // show only if not reply and not editing + if (((this.config.nolc && this.IM == 'foreign') || (this.serverOptions.expandLeaveCmt && !this.config.noautoexpand)) && !this.config.moderate) { + this.ShowCommentDialog(undefined, {nofocus: true}); + } + } + } + + var ocw = this.TC["js-OldCommentsWrap"]; + if (this.jspg.itemsCount != 0) + { + JSKitLib.show(ocw); + } + else + { + JSKitLib.hide(ocw); + } + + if(!this.jspg.loading || !this.useEcho()) this.rePageNavigator(this.curPage-1); + if(immediate && cb) cb.apply(this, [immediate]); +} + +JSCC.prototype.SearchLine = function() { + var self = this; + var sExit = self.cr('span'); + var title = self.cr('span'); + title.className = 'js-SearchTitle'; + title.innerHTML = ''+$JCL("youSearchedFor")+':'; + sExit.appendChild(title); + var line = self.cr('span'); + line.className = 'js-SearchWords'; + text = JSKitLib.truncate(self.searchString, 15, "...", true); + line.insertBefore(JSKitLib.text(text),line.firstChild); + sExit.appendChild(line); + var del = self.cr('input'); + del.type = 'button'; + del.value = $JCL('clearSearch'); + sExit.appendChild(del); + var obj={ + 'containerElement': sExit, + 'field': line, + 'itemObject': self, + 'type': 'Search', + 'Property': 'searchString', + 'title': $JCL("youSearchedFor")+': ', + 'mode': 'full' + }; + obj.jsipe$start = function(){ + del.style.display = "none"; + line.style.border = "0px"; + title.style.display = "none"; + return true; + } + obj.jsk$on_submit_exit = function(value){ + self.searchString = value; + self.viewControl({name: "search"}); + } + line.wasEdited = function(value){ + JSKitLib.text(JSKitLib.truncate(value, 15, "...", true), line, true); + del.style.display = ""; + line.style.borderBottom = ""; + title.style.display = ""; + } + del.onclick = function(){ + this.name="del-line"; + self.viewControl(this); + } + var jsipe = new JSIPE(obj); + return sExit; +} + +JSCC.prototype.navSym = { "prev": "←", "next": "→" }; + +JSCC.prototype.rePageNavigator = function(pageIdx) { + var s = this; + var hasMultiplePages = s.jspg.pageCount > 1 || s.jspg.echo_after; + var display = s.searchString || hasMultiplePages ? "" : "none"; + var assemblePageNavigation = function() { + var navigation = ''; + if (hasMultiplePages) { + navigation = s.useEcho() + ? s.pageNavigatorEchoLive(s.jspg.pageCount, s.jspg.echo_after) + : s.getSkin() == "echo" + ? s.pageNavigatorEcho(s.jspg.pageCount, s.curPage) + : s.pageNavigator(s.jspg.pageCount, s.curPage); + } + return (typeof(navigation) == "string") + ? JSKitLib.html('
    ' + (navigation || '') + '
    ') + : navigation; + }; + var nvs = s.useEcho() ? ['Bottom'] : ['Top','Bottom']; + for(var i = 0; i < nvs.length; i++) { + var bar = s.TC['js-PageNav' + nvs[i]]; + if (!bar) continue; + JSKitLib.replaceChildren(bar, assemblePageNavigation()); + JSKitLib.preventSelect(bar); + bar.style.display = display; + if(i) bar.style.display = ((pageIdx==undefined) ? 'none' : ''); + if(s.searchString) s.addChild(bar, s.SearchLine(), true); + } +} + +JSCC.prototype.pageNavigator = function(pages, cur) { + var self = this; + var arr = []; + var postingProcessValidation = "if ($JCA["+self.jcaIndex+"].commentPostingProcess) { alert($JCL('messagePostingInProgress')); return false; }"; + var f = function(i, txt, cmt, cls, cf) { + return '' + txt + ' '; } + arr.push($JCL('page')); + arr.push(f(cur - 1, this.navSym.prev, $JCL('pagePrevious'), + 'js-PageArrow' + ((cur == 1)?' js-PageArrowCur':''))); + for(var i = 1; i <= pages; i++) { + if((i == 4 || i == 3) && (cur - i) > 3) { + i = Math.floor((cur - i) / 2 + i); + arr.push(f(i, '…', 'Page-' + i)); + i = cur - ((pages - cur > 3 || cur == pages) ? 2 : 1); + } + if((i == cur + 3) && (pages - cur) > 4) { + i = Math.floor((pages - cur) / 2 + cur); + arr.push(f(i, '…', 'Page-' + i)); + i = pages - 1; + } + if(i == cur) { + arr.push(f(i, i, 'Page-' + i, "js-PageNCur", '$JCA['+self.jcaIndex+'].jspg.invalidate(); $JCA['+self.jcaIndex+'].rerender();')); + } else { + arr.push(f(i, i, 'Page-' + i)); + } + } + arr.push(f(cur + 1, this.navSym.next, $JCL('pageNext'), + 'js-PageArrow' + ((pages == cur)?' js-PageArrowCur':''))); + return arr.join(''); +} + +JSCC.prototype.pageNavigatorEcho = function(pages, cur) { + var self = this; + var assemble = function(container, i, txt, cmt, cls, cf) { + var isInactive = function(cls) { + return cls && cls.match(/PrevOff|NextOff|Active/); + }; + var template = + '
  • ' + + (isInactive(cls) ? txt : '' + txt + '') + + '
  • '; + var scroll = function() { + var anchor = self.TC['jsk-HeaderWrapper']; + if (!anchor || JSKitLib.getStyleProperty(anchor, 'display') == 'none') { + anchor = self.TC['jsk-ThreadWrapper']; + } + if (anchor) anchor.scrollIntoView(true); + }; + var linkHandler = function(element) { + element.href = "#" + cmt; + element.onclick = function() { + if (self.commentPostingProcess) { + alert($JCL('messagePostingInProgress')); + return false; + } + if (cf) { + cf(); + return false; + } + self.displayPage(i, function() { + self.hideExpirationBanner(); + setTimeout(scroll, 0); + }); + return false; + }; + JSKitLib.setMouseEvent(element, "over", function() { + window.status = cmt; + }); + JSKitLib.setMouseEvent(element, "out", function() { + window.status = ''; + }); + }; + container.appendChild(JSKitLib.toDOM(template, "js-Page", + {"Link": linkHandler}).content); + } + var template = + '
    ' + + '
      ' + + '
      '; + var assemblePages = function(element) { + assemble(element, cur - 1, $JCL('btnPagePrevious'), $JCL('pagePrevious'), + ((cur == 1) ? 'jsk-PrevOff' : 'jsk-Prev')); + for(var i = 1; i <= pages; i++) { + if((i == 4 || i == 3) && (cur - i) > 3) { + i = Math.floor((cur - i) / 2 + i); + assemble(element, i, '…', 'Page-' + i); + i = cur - ((pages - cur > 3 || cur == pages) ? 2 : 1); + } + if((i == cur + 3) && (pages - cur) > 4) { + i = Math.floor((pages - cur) / 2 + cur); + assemble(element, i, '…', 'Page-' + i); + i = pages - 1; + } + if(i == cur) { + var cb = function() { + self.jspg.invalidate(); + self.rerender(); + }; + assemble(element, i, i, 'Page-' + i, 'jsk-Active', cb); + } else { + assemble(element, i, i, 'Page-' + i); + } + } + assemble(element, cur + 1, $JCL('btnPageNext'), $JCL('pageNext'), + ((pages == cur) ? 'jsk-NextOff' : 'jsk-Next')); + }; + return JSKitLib.toDOM(template, "jsk-", {"Pager": assemblePages}).content; +} + +JSCC.prototype.pageNavigatorEchoLive = function(pages, cur) { + var self = this; + var template = + '
      ' + + '{Label:More}' + + '
      '; + var moreButtonHandler = function(element) { + element.onclick = function() { + self.displayPage(2); + }; + JSKitLib.setMouseEvent(element, "over", function() { + JSKitLib.addClass(element, "jsk-PagerItemHover"); + }); + JSKitLib.setMouseEvent(element, "out", function() { + JSKitLib.removeClass(element, "jsk-PagerItemHover"); + }); + }; + return JSKitLib.toDOM(this.gtmpl(template), "js-Page", {"More": moreButtonHandler}).content; +} + +JSCC.prototype.hideSettingsWindow = function(wname) { + if(this[wname]) this.settingsWindow(wname); +} + +JSCC.prototype.showProgress = function(wname, on) { + if(this[wname]) this[wname].showProgress(on); +} + +JSCC.prototype.settingsWindow = function(wname, atDiv, html) { + var s = this; + if(s[wname]) { + if(!s.sWHideable) return; + s[wname].parentNode.removeChild(s[wname]); + delete s[wname]; + return; + } + var nohide = function() { + s.sWHideable = false; + if(s.swsHidt) clearTimeout(s.swsHidt); + s.swsHidt = setTimeout(function(){s.sWHideable=true}, 100); + } + var div = this.cr("div"); + div.className = "js-SettingsWindow"; + if (s.config.nolc) JSKitLib.addClass(div, "js-SettingsWindowNolc"); + div.style.background = '#FFFFFF url('+this.uriDomain + +'/images/bg-header-gray.png) bottom repeat-x'; + div.onclick = nohide; + div.onselectstart = function() { return false; } + if(typeof(html) == 'string') { + div.innerHTML = html; + } else { + if(!html.dropWidth) div.style.width = '20em'; + div.appendChild(html); + } + + if (wname == 'ctWnd' && s.TC['js-WelcomePanel']) { + var aoh = s.cr('div'); + aoh.className = 'js-SettingsWindowHeader'; + JSKitLib.text($JCL('administratorOptions'), aoh); + div.appendChild(aoh); + var wp = s.TC['js-WelcomePanel']; + var links = JSKitLib.html('' + + '' + + '' + + '' + + '
      '); + var tc = JSKitLib.mapClass2Object({}, links); + div.appendChild(links); + tc['js-WelcomeOpenPanel'].onclick = function() { + JSKitLib.toggle(wp); + JSKitLib.text($JCL(JSKitLib.visible(wp) ? 'closeWelcome' : 'openWelcome'), this.lastChild.lastChild); + }; + tc['js-WelcomeContact'].onclick = function(){location.href = s.uriDomain + '/comments/qa.html';}; + } + + var pgr = this.cr('div'); + pgr.className = "js-Progress"; + var url = this.uriDomain + '/images/progress-wg.png'; + if(document.body.filters) { + pgr.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + url + ", sizingMethod=crop)"; + } else pgr.style.backgroundImage = 'url(' + url + ')'; + div.appendChild(pgr); + div.showProgress = function(on) { + if(!on) { + if(div.pIntvl) clearInterval(div.pIntvl); + div.pIntvl = null; + pgr.style.visibility = 'hidden'; + return; + } else if(div.pIntvl) return; + var f = function() { + pgr.vison = !pgr.vison; + pgr.style.visibility = pgr.vison + ? 'visible' : 'hidden'; + } + f(); + div.pIntvl = setInterval(f, 500); + } + + s[wname] = div; + var swh = this.cr("div"); + swh.className = "js-SettingsWindowHeader"; + JSKitLib.text($JCL(wname == 'ctWnd' ? "viewOptions" : "moderation"), swh); + div.insertBefore(swh, div.firstChild); + div.style.position = "absolute"; + + var jsd = new JSDL(div, [swh]); + document.body.appendChild(div); + div.style.left = jsd.getElmAbsPos(atDiv, false).x + "px"; + div.style.top = jsd.getElmAbsPos(atDiv, false).y + atDiv.offsetHeight + "px"; + + try { + if (document.body.clientWidth < jsd.getElmAbsPos(atDiv, false).x + div.offsetWidth) + div.style.left = document.body.clientWidth - div.offsetWidth - + (parseInt(div.style.marginLeft) || 0) - + (parseInt(div.style.marginRight) || 0) + "px"; + } catch(e) {;} + + var ifrWr; + if(JSKitLib.getBrowser() == 'gecko' && !atDiv.notShowIfr) { + ifrWr = this.cr("div"); + ifrWr.id = "jsk-yIfr"; + var yIfr = this.cr("iframe"); + yIfr.style.position = "absolute"; + yIfr.style.top = 0; + yIfr.style.left = 0; + yIfr.style.zIndex = -1; + yIfr.style.display = "block"; + yIfr.style.height = div.offsetHeight + "px"; + yIfr.style.width = div.offsetWidth + "px"; + yIfr.scrolling = "no"; + yIfr.frameBorder = "0"; + ifrWr.appendChild(yIfr); + div.appendChild(ifrWr); + } + div.jsk$on_start_drag = function(){if(ifrWr) ifrWr.style.display = "none"}; + div.jsk$on_stop_drag = function(){if(ifrWr) ifrWr.style.display = ""}; + nohide(); +} + +JSCC.prototype.getImages = function(id) { + var arg = {rnd: id, jx: this.jcaIndex}; + this.server(this.uriDomain + '/api/images/pick-attachments.js', arg); +} + +JSCC.prototype.prepareImgData = function(msg) { + if(this.images){ + JSKitLib.removeChildren(this.imgArea); + JSKitLib.map(function(elem, i){ + JSKitLib.fmap(['img','orig','width','height','descr','mime'], + function(E) { msg.push({'Name': 'js-CmtattachFile_'+i+'_'+E, 'Value': elem[E]})} + ); + },this.images); + } +} + +JSCC.prototype.parseImgData = function(obj) { + var re = /attachFile_(\d+)_(\w+)/; + var imgs = []; + for (var i in obj){ + var keys = re.exec(i); + if (keys) { + if (!imgs[keys[1]]) imgs[keys[1]] = {}; + imgs[keys[1]][keys[2]] = obj[i]; + } + } + return imgs; +} + +JSCC.prototype.createImages = function(imgs, isPreview){ + var s = this; + var d=function(){return s.div.apply(s,arguments);} + + var content = isPreview ? d() : + d("js-all-previewImages",d("js-previewImageTitle jsk-ItemAttachmentsTitle jsk-SecondaryBackgroundColor", $JCL('picTitle')), + JSKitLib.html('
      ')); + + var bloburl = function(name) { + return name.match(/^[^\/]+$/)?(s.uriDomain+"/blob/"+name):""; + } + + var crImg = function(elem, i){ + var img = d("js-previewImage jsk-ItemAttachmentWrapper"); + var thumb = s.cr("img"); + elem.descr = elem.descr || ''; + thumb.src = bloburl(elem.img); + JSKitLib.setStyle(thumb, " width: "+elem.width+"px; height: "+elem.height+"px; cursor: pointer;"); + JSKitLib.addClass(thumb, "jsk-ItemAttachmentIcon"); + var wrap = d("js-imageWrap jsk-ItemAttachmentIconWrapper"); + JSKitLib.setStyle(wrap, "margin-top: " + ((96-elem.height)/2) + "px; margin-bottom: " + ((96-elem.height)/2) + "px;"); + thumb.onclick = function() { window.open(bloburl(elem.orig)); } + var text = d("js-previewImageDescr jsk-ItemAttachmentLabel"); + s.addChild(wrap, thumb); + s.addChild(img, wrap); + if (isPreview) { + var wasEdited = function(){ + if(elem.descr != "" ) JSKitLib.removeClass(text,"js-uploadGreyDescr"); + else JSKitLib.addClass(text,"js-uploadGreyDescr"); + } + var jsipe = new JSIPE2({obj: elem, + property: 'descr', + title: 'Description', + defaultText: 'Add caption', + width: '90px', + maxLength: 80, + hideApplyBtn: true, + jsk$wasEdited: wasEdited + }); + text.appendChild(jsipe.div); + var onEditBtnClick = function(e){ + if(jsipe.editMode) jsipe.editMode(e); + JSKitLib.stopEventPropagation(e || window.event); + } + var onDeleteBtnClick = function(e){ + img.parentNode.removeChild(img); + if(imgs && imgs[i]) imgs.splice(i, 1); + JSKitLib.stopEventPropagation(e || window.event); + } + var editBtn = s.crImgCtrl("edit", {top: "60px", left: "15px"}, onEditBtnClick); + var deleteBtn = s.crImgCtrl("delete", {top: "60px", left: "57px"}, onDeleteBtnClick); + var displayMode = function(mode){ + editBtn.style.display = mode; + deleteBtn.style.display = mode; + } + img.onmouseover = function(e) { displayMode("inline"); } + img.onmouseout = function(e) { displayMode("none"); } + s.addChild(img, editBtn); + s.addChild(img, deleteBtn); + if(elem.descr == "") JSKitLib.addClass(text,"js-uploadGreyDescr"); + } else { + text.innerHTML = elem.descr.replace(//g,">"); + } + thumb.title = JSKitLib.htmlUnquote(elem.descr); + s.addChild(img, text); + s.addChild(content, img); + } + JSKitLib.map(crImg,imgs); + s.addChild(content, JSKitLib.html('
      ')); + + return content; +} + +JSCC.prototype.crImgCtrl = function(type, position, onClick) { + var btn = this.cr("div"); + var ctrlBtn = { width : "30px", height : "30px", imgWidth : "30px", imgHeight : "30px" }; + JSKitLib.setStyle(btn, "display:none; background:transparent; position:absolute; float:left; padding:0; margin:0; " + + "width:" + ctrlBtn.width + "; height:" + ctrlBtn.height + "; cursor: pointer;" + + "top:" + position.top + "; left:" + position.left); + btn.title = $JCL(type + "Image"); + btn.onclick = onClick; + imgUrl = this.uriDomain + "/images/" + "avatar-" + type + ".png"; + JSKitLib.addPNG(btn, imgUrl); + + return btn; +} + + +JSCC.prototype.addImage = function(img) { + if(this.lbliChange) this.lbliChange(0); + if (typeof(img) == "object"){ + if (img.error) { + switch (img.error) { + case 'big_image': + alert($JCL('imgUploadErrorBigImage')); + break; + case 'wrong_format': + alert($JCL('imgUploadErrorWrongFormat')); + break; + case 'internal_error': + default: + alert($JCL('imgUploadErrorInternal')); + } + return; + } + if (this.images) this.images.push(img) + else this.images = [img]; + if (!this.imgArea) return; + JSKitLib.removeChildren(this.imgArea); + var content = this.createImages(this.images, true); + this.addChild(this.imgArea, content); + } +} + +JSCC.prototype.viewControl = function(sel) { + var s = this; + var ap = { "usr": "yes" }; + switch(sel.name) { + case "jss-srt": + var newSortBy = sel.options[sel.selectedIndex].value; + if(newSortBy == s.config.sort) return true; + s.config.sort = newSortBy; + s.showProgress('ctWnd', true); + break; + case "jss-rev": + var backwardsNewStatus = sel.selectedIndex?'yes':'no'; + if(s.config.backwards == backwardsNewStatus) return true; + s.config.backwards = backwardsNewStatus; + s.showProgress('ctWnd', true); + break; + case "jss-prs": + var newThr = sel.options[sel.selectedIndex].value == 'flat' ? 'no' : 'yes'; + if(newThr == s.config.thread) return true; + s.config.thread = newThr; + s.showProgress('ctWnd', true); + break; + case "search": + ap.srch = s.searchString; + break; + case "del-line": + break; + default: return false; + } + s.dataLoader = function() { + this.showProgress('ctWnd', false); + this.curPage = 0; + this.displayPage(1); } + if(this.curPage) { + var p = this.jspg.getPage(this.curPage - 1); + if(p && p.target && p.target.parentNode) + p.target.parentNode.removeChild(p.target); + } + s.ctag = null; + ap.opts = s.config.sort+'|'+(s.config.backwards == "yes" ? "desc" : "asc")+'|'+(s.config.thread == "yes" ? "thr" : "flat"); + s.getpages(0, ap); + return true; +} + +JSCC.prototype.placeAvatar = function(obj, div) { + div = div || obj.avatarPlace; + if(!div) return; + + if(this.getSkin() != 'echo' && !obj.avatar && !obj.GravatarID) { + obj.avatarPlace = div; + return; + } + var container = { + "instance": div, + "width": obj.avatarPlaceWidth, + "height": obj.avatarPlaceWidth + }; + this.appendAvatarImage(container, obj); + this.appendProfileHandler(div, obj); + return div; +} + +JSCC.prototype.appendAvatarImage = function(container, obj) { + var self = this; + obj = obj || {}; + var avtCtrl = this.avatarsManager; + var data = obj.avatar ? + {"name": obj.avatar, "width": obj.avatarWidth, "height": obj.avatarHeight} : + avtCtrl.anonymousAvatarData(); + + var avatar = avtCtrl.calcAvatarDim(container, data); + avatar.name = obj.GravatarID ? + avtCtrl.getGravatarURL(obj.GravatarID, this.maxAvatarDims) : + avtCtrl.avatarURL(avatar.name); + avatar.onerror = function() { + this.onerror = null; + self.appendAvatarImage(container); + } + avtCtrl.assembleAvatar(container, avatar); +} + +JSCC.prototype.placeProcessAvatar = function(div) { + if(!div) return; + JSKitLib.removeChildren(div); + JSKitLib.addPNG(div, '//cdn.js-kit.com/images/progress-wg.png'); + JSKitLib.addStyle(div, "width: 15px; height: 15px;"); +} + +JSCC.prototype.refreshComments = function(params) { + var s = this; + params = params || {}; + s.deleteWelcomePanel(); + s.hideExpirationBanner(); + s.invalidateJSPG(); + s.objById = {}; + if (s.curPage == 1) s.curPage = 0; + s.displayPage(1, function() { + if (!s.isSourceAvailable("Comments")) return; + s.preventAnonymousComments(); + s.makeWelcomePanel(); + s.ShowCommentDialog(s.replyForId, params); + }); +} + +JSCC.prototype.preventAnonymousComments = function() { + var anonymCond = this.anonymousCmt && !this.jskauth.isLogged(); + this.setControlsStateLCF(anonymCond ? "disable" : "enable"); +} + +JSCC.prototype.setControlsStateLCF = function(state, extraControls) { + var s = this; + var disable = state == "disable"; + var disableCtrls = JSKitLib.merge([s.TC['js-CmtText'], s.TC['js-CmtTextEdit'], s.TC['js-Cmtsubmit'], s.TC['js-CmtsubmitEdit'], s.TC['js-CmtcancelEdit'], s.TC['js-CmtName'], s.TC['js-CmtEmail'], s.imgUpload], extraControls || []); + var lockCtrls = [s.TC['js-Cmtsubmit']]; + var imgArea = s.TC['js-commentImageArea']; + + JSKitLib.fmap(disableCtrls, function(V){ if (V) V.disabled = disable; }); + JSKitLib.fmap(lockCtrls, function(V){ if (V) V.btnLocked = (disable) ? "true" : null; }); + if (imgArea) imgArea.disableUpload = disable; +} + +JSCC.prototype.setThirdPartyShare = function() { + var s = this; + var po = s.TC["js-commentPubOptions"]; + if(!po) return; + JSKitLib.removeChildren(po); + var appendSharingControl = function(type, extraElement) { + var identity = s.jskauth.getAuthIdentity(type); + var publish = identity && identity.publish; + var control = JSKitLib.html(''); + control.defaultChecked = !!publish; + control.checked = !!publish; + control.value = control.checked ? "on" : "off"; + control.onchange = function() { + this.value = this.checked ? "on" : "off"; + }; + var label = JSKitLib.html('
      ' + $JCL('shareVia_' + type) + '
      '); + po.appendChild(control); + po.appendChild(label); + if (extraElement) po.appendChild(extraElement); + }; + JSKitLib.fmap(s.jskauth.getIdentities("auth"), function(identity) { + if (identity.can_publish && identity.user) { + var extraElement = (identity.type == "yahoo") ? JSKitLib.html('') : undefined; + appendSharingControl(identity.type, extraElement); + } + }); +} + +JSCC.prototype.wrapJSKAuth = function() { + var s = this; + var tc = s.TC; + var appendAuthSelector = !tc["js-kit-lcf-userInfoWrapper"]; + + if (s.config.nolc) return; + if (!tc['js-AuthAreaWrap']) { + var items = ['js-commentOpenID', 'js-commentInputOpenID', 'js-CmtOpenID', 'js-OpenIDError']; + JSKitLib.fmap(items, function(item) { + if (tc[item]) tc[item].parentNode.removeChild(tc[item]); + }); + if (appendAuthSelector) return; + } + + var authAreaTmpl = + '
      ' + + '
      {Label:leaveCommentAs}
      ' + + '
      ' + + '
      ' + + '[{Label:logout}]' + + '
      ' + + '
      '; + + if (tc['js-commentInputOpenID']) JSKitLib.hide(tc['js-commentInputOpenID']); + + if (appendAuthSelector) { + var authAreaContainer = JSKitLib.html(s.gtmpl(authAreaTmpl)); + tc['js-AuthAreaWrap'].appendChild(authAreaContainer); + JSKitLib.mapClass2Object(tc, authAreaContainer); + } +} + +JSCC.prototype.initAvatarsManager = function(size) { + var s = this; + var so = s.serverOptions; + if (s.avatarsManager) s.avatarsManager.deActivateEvents(); + var identities = JSKitLib.foldl({}, s.jskauth.identities.auth, function(identity, acc) { + if (identity.group != "third_party") return; + acc[identity.type] = { + "title": s.jskauth.getIdentityLabel(identity.type, true), + "action": identity.user ? null : function() { + s.jskauth.show(identity.type); + }, + "authenticated": !!identity.user + }; + }); + var avatars = so.avatars || []; + var addEPBAvatar = function(identity) { + if (JSKitEPB.isExists() && identity) { + var type = 'http://' + s.config.domain; + var index = -1; + JSKitLib.fmap(avatars, function(av, i) { + if (av.type == type) { + index = i; + } + }); + var avatar = JSKitEPB.getValue('Avatar'); + if (avatar) { + if (index < 0) { + JSKitLib.fmap(avatars, function(av) { delete av.chosen; }); + avatars.push({name: avatar, width: 64, height: 64, type: type, params: identity.params, chosen: true}); + } else { + avatars[index].name = avatar; + } + } else if (index >= 0) { + avatars.splice(index, 1); + } + } + } + addEPBAvatar(s.jskauth.getAuthIdentity('epb')); + + var config = { + "id": "comments-" + s.jcaIndex, + "ref": JSKitLib.getRef(s), + "size": size, + "yours": !s.config.nolc, + "layer": s.getSkin() == "smoothgray" ? this.target : undefined, + "target": this.target, + "labels": $JCL, + "avatars": avatars, + "autoSave": false, + "controls": [s.TC["js-Cmtsubmit"]], + "uriAvatar": s.uriAvatar, + "identities": identities, + "gravatarEmail": so.gravatarEmail + }; + return new JSKAvatars(config); +} + +JSCC.prototype.setFormFields = function(fields) { + var s = this; + var tc = s.TC; + var emptyLabels = { + 'Url': $JCL('urlIsOptional'), + 'Email': $JCL('emailIsOptional') + } + + JSKitLib.fmap(fields, function(v, name) { + var o = tc['js-Cmt'+name]; + if(o) { + o.jsk$setdfl = function(val) { + o.style.color = ''; + o.jsk$setdfl = false; + o.jsk$not_specified = false; + o.value = val || ''; + } + if (v) { + o.jsk$setdfl(v); + } else { + o.style.color = '#808080'; + o.value = emptyLabels[name]; + o.jsk$not_specified = true; + } + o.onfocus = function() { if (o.jsk$setdfl) o.jsk$setdfl(); } + } + }); +} + +JSCC.prototype.getThreadHeader = function() { + var s = this; + var header; + if (s.config.skin == 'echo') { + var replacements = { + "Title": s.config["thread-title"], + "CountLabel": $JCL("commentsCountLabel", {"Count": s.serverOptions.pages.tc}) + }; + var template = s.dtHeaderEcho; + JSKitLib.fmap(replacements, function(replacement, pattern) { + template = template.replace(new RegExp("{" + pattern + "}", "g"), replacement); + }); + header = JSKitLib.html(s.gtmpl(template)); + JSKitLib.mapClass2Object(s.TC, header); + if (s.TC["jsk-HeaderInfoBoxImg"]) JSKitLib.addPNG(s.TC["jsk-HeaderInfoBoxImg"], "//cdn.js-kit.com/images/echo.png"); + s.renderPauseIndicator(); + s.renderPauseCounter(); + } else { + header = s.div(); + } + return header; +} + +JSCC.prototype.assembleImagesUploadForm = function(uInp, imgArea) { + var s = this; + var tc = s.TC; + s.imgArea = imgArea; + var handler = function(e){ + e = e || window.event; + if(e.keyCode == 27 || e.which == 27) JSKitLib.preventDefaultEvent(e); + }; + if (uInp && !uInp.ifri){ + var frmi = s.cr('form'); + JSKitLib.setStyle(frmi, "clear: both;"); + JSKitLib.addClass(frmi, "js-uploadImageForm"); + frmi.method = 'post'; + frmi.acceptCharset = 'UTF-8'; + frmi.encoding = 'multipart/form-data'; + frmi.style.margin = "0px"; + var lbli = s.cr('div'); + JSKitLib.addClass(lbli, "js-uploadImageInputLabel"); + s.lbliChange = function(mode) { + JSKitLib.removeChildren(lbli); + lbli.appendChild(JSKitLib.html("" + $JCL(mode ? "loading" : "uploadImage") + "")); + } + s.lbliChange(0); + + params = JSKitEPB.getAsHash({ref: JSKitLib.getRef(s)}); + JSKitLib.fmap(params, function(v, k) { + var item = s.cr('input'); + item.type = 'hidden'; + item.name = k; + item.value = encodeURIComponent(v); + frmi.appendChild(item); + }); + + var upfi = s.cr('input'); + s.imgUpload = upfi; + upfi.disabled = ( s.imgArea && s.imgArea.disableUpload ) ? true : false ; + upfi.type = 'file'; + upfi.name = 'image'; + var formitems = JSKitLib.mapClass2Object({}, frmi); + var val; + var fi = function() { + if(val) { + var subi = s.TC["js-Cmtsubmit"]; + subi.disabled = false; + upfi.disabled = false; + frmi.reset(); + JSKitLib.fmap(params, function(v, k) { + formitems[k].value = encodeURIComponent(v); + }); + JSKitLib.removeEventHandler(document, ["keydown"], handler); + s.getImages(val); + val = undefined; + } + } + var tgti = 'js-ifrm-'+s.jcaIndex + Math.random(); + var ifri = JSKitLib.createHiddenIframe(tgti, uInp, fi, false); + frmi.target = tgti; + upfi.onchange = function() { + val = (new Date()).getUTCMilliseconds() + "-" + Math.random( ); + frmi.action = s.uriImage+'add?rnd='+val; + s.lbliChange(1); + frmi.submit(); + var subi = s.TC["js-Cmtsubmit"]; + subi.disabled = true; + upfi.disabled = true; + JSKitLib.addEventHandler(document, ["keydown"], handler); + }; + uInp.appendChild(lbli) + frmi.appendChild(upfi); + uInp.appendChild(frmi); + uInp.ifri = ifri; + } + s.preventAnonymousComments(); +} + +JSCC.prototype.assembleEchoBrand = function() { + var template = + '
      ' + + '' + + '
      ' + + '
      '; + return JSKitLib.toDOM(template, "js-poweredBy-", {}).content; +} + +JSCC.prototype.isSourceAvailable = function(source) { + var filter = this.sourceFilter; + if (!filter || !this.useEcho()) return true; + source = filter.normalize(source); + var sourceInList = filter.sources.hash.hasOwnProperty(source); + return sourceInList ? filter.sources.hash[source] : filter.type == "exclude"; +} + +JSCC.prototype.avatarsManagerWrapper = function(element) { + this.avatarsManager.assembleAvatarArea(element); +} + +JSCC.prototype.dataLoader = function(so, nc) { + var s = this; + var so = s.serverOptions; + var tc = s.TC; + var d = function(){return s.div.apply(s,arguments);} + + if (this.config.disabled != 'no') return; + + var cc = JSKitLib.html(s.gtmpl(s.utmpl['js-CreateComment'] || (s.config.nolc ? s.dtProfileCreate : s.dtCreate))); + JSKitLib.mapClass2Object(tc, cc); + JSKitLib.attachDescriptors2Elements(tc, "js-kit-lcf-", this); + if (JSKitEPB.isExists()) { + JSKitLib.fmap(['Name', 'Email'], function(field) { + if (tc['js-Cmt' + field]) { + tc['js-Cmt' + field].disabled = true; + } + }); + } + var ec = JSKitLib.html(s.gtmpl(s.dtEditComment)); + JSKitLib.mapClass2Object(tc, ec); + if(s.config.profileLC) { + var cin = tc['js-commentInputName']; + if(cin) cin.style.display = 'none'; + var cie = tc['js-commentInputEmail']; + if(cie) cie.style.display = 'none'; + } + if(so.extraFieldURL) { + var ciu = tc['js-commentInputUrl']; + if (ciu) ciu.style.display = 'block'; + } + var ac = function(name, cb) { + var o = tc['js-'+name]; + if(!o) return; + if(o.tagName == 'A') o.href="javascript:void(0);"; + o.style.cursor = 'pointer'; + o.onselectstart = function() { return false; } + o.onclick = cb; + } + + var uInp = tc['js-uploadImageInput']; + var uInpW = tc['js-uploadImageInputWrapper1']; + + s.clearImgs = function(){ + JSKitLib.removeChildren(s.imgArea); + if(uInpW) uInpW.style.paddingTop = '0px'; + if(uInp && uInp.ifri) { + JSKitLib.removeChildren(uInp); + JSKitLib.hide(uInp); + uInp.ifri = undefined; + } + if(s.images) delete(s.images); + } + + JSKitLib.fmap(['', 'Edit'], function(el, i) { + ac('Cmtsubmit' + el, function() { + s.pause.forced = false; + s.CommentSubmitted(); + return false; + }); + ac('Cmtcancel' + el, function() { + s.clearImgs(); + if(s.onCancel) s.onCancel(); + s.CommentCancelled(); + if (s.useReplyThreadsCollapsing() && s.replyForId) { + var pageNo = s.curPage; + var comment = s.objById[s.replyForId]; + delete s.replyForId; + if (comment) s.markCollapsedReplies(comment); + s.pause.forced = false; + s.curPage = 0; + s.displayPage(pageNo); + } + return false; + }); + }); + if (JSKitLib.isIE()) { + var op = tc['js-commentOptions']; + var sub = tc['js-commentSubmit']; + if (op) op.style.paddingLeft = "3px"; + if (sub) sub.style.paddingLeft = "3px"; + } + + s.anonymousCmt = so.anonymousCmt; + + if (tc["js-commentAvatar"]) s.avatarsManager.assembleAvatarArea(tc["js-commentAvatar"]); + + if (s.getSkin() != 'echo') { + s.setFormFields({'Email': '', 'Url': ''}); + s.wrapJSKAuth(); + } + s.preventAnonymousComments(); + + ac('commentOpenIDLogout', function() { + setTimeout(function(){ + var gfc = s.jskauth.getAuthIdentity("gfc"); + if(gfc && gfc.params.site && gfc.user) { + new JSKitGFC( + JSKitLib.getRef(s), + s.target, + gfc.params.site, + function(){ + this.processLogout(); + }); + } + s.server(s.uriDomain + '/api/session/logout.js', {}); + }, 0); + return false; + }); + if(!tc['js-commentMore']) { + var m = tc['js-CCMore']; + if(m) m.style.display = 'none'; + } + + s.onAddImgButton = function(isShow) { + if(s.commentPostingProcess) { + alert($JCL('messagePostingInProgress')); + return; + } + if(s.config.uploadImages) { + s.imgArea = tc['js-commentImageArea']; + if(uInp && s.imgArea) { + uInp.style.display = isShow ? 'block' : 'none'; + if(uInpW) uInpW.style.paddingTop = isShow ? '15px' : '0px'; + s.imgShow = isShow; + } + } + s.assembleImagesUploadForm(uInp, s.imgArea); + }; + + var uImg = tc['js-uploadImageButton']; + if (uInp) JSKitLib.hide(uInp); + if(uInp && uImg && !s.config.uploadImages) { + JSKitLib.hide(uImg); + JSKitLib.hide(uInp); + } + ac('uploadImageButton', function(){ + s.onAddImgButton(!JSKitLib.visible(uInp)); + }); + + var toggleAvatarArea = function(isVisible) { + JSKitLib.fmap(["Avatar", "AvatarLabel"], function(key) { + var element = tc["js-comment" + key]; + if (!element) return; + JSKitLib[isVisible ? "show" : "hide"](element); + }); + }; + if (s.getSkin() == "") { + toggleAvatarArea(false); + } + var onCommentMore = function(obj, label) { + obj.ashown = !obj.ashown; + JSKitLib.text(obj.ashown ? label.less : label.more, obj, true); + s.onAddImgButton(obj.ashown); + toggleAvatarArea(obj.ashown); + return false; + }; + + ac('commentAddAvatar', function() { + var label = {'less': '-', 'more': '+'}; + return onCommentMore(this, label); + }); + ac('commentMore', function() { + var label = {'less': this.getAttribute("less") || $JCL('less'), + 'more': this.getAttribute("more") || $JCL('more') }; + return onCommentMore(this, label); + }); + + if (!tc["js-commentAvatar"] && (!s.config.uploadImages || tc['js-uploadImageButton'] || !tc['js-uploadImageInput'])) { + JSKitLib.fmap(['js-commentMore', 'js-CCMore'], function(element) { if (tc[element]) JSKitLib.hide(tc[element]); }); + } + + if(so.mmode == "pause" || !s.isSourceAvailable("Comments")) { + var lca = null; + } else { + var lca = d('js-commentControl', s.a(s.JCL('leaveComment'))); + lca.onclick = function() { return s.ShowCommentDialog(); }; + } + + var jmg = d('js-commentControl js-commentTool', JSKitLib.html('@ '), s.a($JCL("controls"))); + jmg.onclick = function() { + var srt = ["date", "name"]; + if(!s.config.moderate && s.scoringEnabled()) srt.push("karma"); + if(s.adminMode) srt.push("status"); + /* s.submitRating check is not good for all the cases */ + if ( $JSKitGlobal.isRatingsAppAvailable() ) srt.push("rating"); + var srtOpts = []; + for(var i = 0; i < srt.length; i++) { + srtOpts.push(''); + } + var bkw = ["ascending", "descending"]; + var bkwOpts = []; + for(var i = 0; i < bkw.length; i++) { + bkwOpts.push(''); + } + var prs = ["on (threaded)", "off (flat)"]; + var prsMap = {'on (threaded)':'yes','off (flat)':'no'} + var prsOpts = []; + for(var i = 0; i < prs.length; i++) { + prsOpts.push(''); + } + var div = s.cr("div"); + div.innerHTML = + "" + + "" + + "" + + "" + + "' + + (s.adminMode && !s.config.moderate?(''):'') + + "
      " + $JCL("sortBy") + '
      " + $JCL("order") + '
      " + $JCL("threading") + '
      " + $JCL("search") + '
      Moderate whole site
      " + this.notShowIfr = true; + s.settingsWindow('ctWnd', this, div); + var obj={'mode': 'form', 'inpSize': '121px', type: 'Search'}; + var form = new JSIPE(obj); + obj.jsk$on_submit_exit = function(){ + s.searchString = form.input.value; + s.viewControl({name: "search"}); + s.hideSettingsWindow('ctWnd'); + } + form.input.value = s.searchString || ""; + if (s.searchString) form.cleaner.style.visibility = "visible"; + var sCell = document.getElementById("js-SearchCell-"+s.jcaIndex); + if (sCell) s.addChild(sCell, form.main); + + return false; + } + s.controls = jmg; + if(nc || s.config.moderate) { + s.controls.reveal = function(){}; + } else { + s.controls.style.display = 'none'; + s.controls.reveal = function(){s.controls.style.display=''} + } + + var pb; + if(so.subs || so.noJunk || so.whitelabel) { + pb = ""; + } else { + if (s.getSkin() != "echo") { + var propLink = JSKitLib.html('Powered by JS-Kit'); + var prop = d('', "(", propLink, ")"); + prop.style.position = 'relative'; + pb = d("js-commentControl js-poweredBy", prop); + } + } + + var ca = d("js-CommentsArea", + (s.config.nolc && !s.IM)?null:d("js-LeaveComment", s.config.moderate || s.IM=='own' ?null:lca, s.IM ? null : jmg, !s.config.nolc ? pb : null, + JSKitLib.html('
      ')), + tc["js-CreateComment"], tc["js-EditComment"]); + this.makeWelcomePanel(); + + if (!so.wysiwyg && so.smiley) { + JSKitLib.fmap(['Text', 'TextEdit'], function(v) { + var sd = s.cr('div'); + sd.style.margin = '3px 0px 0px 3px'; + var text = tc['js-Cmt' + v]; + var processed = {}; + var index = 0; + JSKitLib.fmap(s.smiles, function(el, i) { + if (!processed[el.file]) { + processed[el.file] = 1; + var smile = JSKitLib.html(s.smileTag(el)); + smile.style.display = 'inline'; + smile.style.cursor = 'pointer'; + smile.style.marginRight = '5px'; + smile.onclick = function() { + if (s.getSkin() == "echo" && JHI2.isEmpty(text)) { + JHI2.set(text, i); + } else text.value += ' ' + i; + text.focus(); + if (JSKitLib.isSafari()) { + text.setSelectionRange(text.value.length, text.value.length); + } + }; + sd.appendChild(smile); + } + }); + var element = (s.getSkin() == "echo") ? s.TC[v == "Text" ? "jsk-CommentFormBody" : "jsk-CommentEditFormBody"] : text; + element.parentNode.insertBefore(sd, element.nextSibling); + }); + } + + var pageNavTop = s.config.skin == 'echo' ? null : d('js-PageNavTop'); + var pageNavBottom = d('js-PageNavBottom'); + var header = s.getThreadHeader(); + var thread = d("jsk-ThreadWrapper jsk-PrimaryFont jsk-PrimaryBackgroundColor", pageNavTop, d("js-OldCommentsWrap jsk-StreamWrapper", d("js-OldComments")), pageNavBottom); + s.TC["jsk-ThreadWrapper"] = thread; + if(s.config.backwards == 'yes') { + s.addChild(ca, header); + s.addChild(ca, thread); + } else { + s.addChild(ca, thread, true); + s.addChild(ca, header, true); + } + if (s.getSkin() == "echo" && !so.whitelabel) s.addChild(thread, s.assembleEchoBrand()); + if(s.useEcho()) { + JSKitLib.setMouseEvent(thread, "over", function() { s.setStreamState(true); }); + JSKitLib.setMouseEvent(thread, "out", function() { s.setStreamState(false); }); + } + var pageToDisplay = so.pages.sp; + var dpCB; + if(s.comment_location) { + var obj = s.jspg.getItemById(s.comment_location); + if(obj) { + pageToDisplay = s.jspg.getPageByItemId(s.comment_location) + 1; + dpCB = function() { + if(obj.div) s.flash(obj.div); + }; + } + delete s.comment_location; + } + s.displayPage(pageToDisplay, dpCB); + + var closeControlsPopup = function() { + s.hideSettingsWindow('ctWnd'); + s.hideSettingsWindow('ctBlock'); + } + JSKW$Events.registerEventCallback(undefined, closeControlsPopup, "comments_closeControlsPopup"); + + ca.onclick = function() { + closeControlsPopup(); + JSKW$Events.syncBroadcast("miniProfile_collapseAll"); + } + s.addChild(s.target, ca); + if (lca && !s.config.moderate && (s.config.nolc && s.IM == 'foreign' || (so.expandLeaveCmt && !s.config.noautoexpand)) && !s.config.userProfileComments) { + s.ShowCommentDialog(undefined, {nofocus: true}); + } +} + +JSCC.prototype.objRerender = function(obj, cmt) { + cmt.ctls['js-singleCommentText'].innerHTML = + this.tmpl("{Text}", obj, true); +} + +JSCC.prototype.getLastReply = function(pobjId) { + var pobj = this.jspg.getItemById(pobjId); + var lreplyObj = null; + for(var i=pobj.obj.thread.length-1; i>=0; i--){ + if(pobj.obj.thread[i].status!='D') { + var c = this.jspg.getItemById(pobj.obj.thread[i].ID); + if(c) { + lreplyObj = this.getLastReply(c.obj.ID); + break; + } + } + } + return lreplyObj || pobj; +} + +JSCC.prototype.reCalcPages = function() { + if(this.curPage>this.jspg.pageCount) this.displayPage(this.jspg.pageCount); + this.rePageNavigator(this.jspg.pageCount>0 ? this.jspg.pageCount-1 : undefined); +} + +JSCC.prototype.appendConversation = function (cmt, conversation) { + var cnvsObj = {}; + var cnvs = this.conversations[conversation]; + if(!cnvs) return; + JSKitLib.fmap(["Name","avatar","avatarHeight","avatarWidth"], + function(V){ cnvsObj[V] = cnvs.direction=="in" ? cnvs[V] : cnvs["dest"+V] }); + cnvsObj.Label = "Conversation with "; + var dtc = JSKitLib.html(this.tmpl(this.dtConversation, cnvsObj)); + var ctls = JSKitLib.mapClass2Object({}, dtc); + var nm = ctls['js-ConversationName']; + if(nm && this.serverOptions.showProfile) { + nm.style.textDecoration = 'underline'; + this.appendProfileHandler(nm, {profile: cnvs.profile}); + } + cmt.insertBefore(dtc, cmt.firstChild); + JSKitLib.addClass(cmt, "js-singleCommentConversationHead"); +} + +JSCC.prototype.removeConversation = function (cmt) { + JSKitLib.removeClass(cmt, "js-singleCommentConversationHead"); + cmt.removeChild(cmt.firstChild); +} + +JSCC.prototype.appendConversationChild = function (cmt) { + JSKitLib.addClass(cmt, "js-singleCommentConversationChild"); +} + +JSCC.prototype.removeConversationChild = function (cmt) { + JSKitLib.removeClass(cmt, "js-singleCommentConversationChild"); +} + +JSCC.prototype.getSkin = function() { + return this.config.skin==="wireframe" ? "" : (this.config.skin || ""); +} + +JSCC.prototype.generateEventParams = function(extra_params) { + extra_params = extra_params || {}; + var s = this; + var params = { + jcaIndex: s.jcaIndex, + uniq: s.config.path.replace(/^\//, ''), + domain: s.config.domain + }; + JSKitLib.fmap(extra_params, function(v, k) { + params[k] = v; + }); + return params; +} + +JSCC.prototype.publishEvent = function(event_name, params) { + JSKitAPI.publish(event_name, + this.generateEventParams(params)); +} + +JSCC.prototype.eventsHandler = function(eventName, eventParams) { + var self = this; + var so = self.serverOptions; + eventParams = eventParams || {}; + switch (eventName) { + case "comment-deleting": + var item = self.jspg.getItemById(eventParams.cmtId); + if(!item || !item.div) return; + var div = item.div; + if(div.domCtls) div.domCtls.style.visibility = "hidden"; + var av = div.ctls['js-singleCommentAvatar']; + self.placeProcessAvatar(av); + item.obj.origstatus = item.obj.status; + item.obj.status = 'DP'; + item.obj.dTimer = setTimeout(function(){ + item.obj.status = 'A'; + if(div.domCtls) div.domCtls.style.visibility = ""; + if(av) self.placeAvatar(item.obj, av); + delete item.obj.dTimer; + }, 30000); + break; + + case "comment-deleted": + var item = self.jspg.getItemById(eventParams.cmtId); + if(!item || !item.div) return; + var div = item.div; + if(item.obj.dTimer) clearTimeout(item.obj.dTimer); + if(item.obj.ParentID) { + var parentCmt = self.objById[item.obj.ParentID]; + if (parentCmt) { + parentCmt.thread = JSKitLib.filter(function(obj) { + return obj.ID != eventParams.cmtId; + }, parentCmt.thread); + } + self.markCollapsedReplies(self.objById[eventParams.cmtId]); + } else { + if (self.useReplyThreadsCollapsing()) { + self.removeRepliesExpandMarker(item.obj); + } + } + so.pages.tc -= self.removeComment(div, true); + self.publishEvent("comments-count-updated", {'count': so.pages.tc}); + break; + + case "comment-added": + so.pages.tc++; + self.publishEvent("comments-count-updated", {'count': so.pages.tc}); + break; + + case "comments-data-loaded": + self.publishEvent("comments-count-updated", {'count': so.pages.tc}); + break; + + case "comments-count-updated": + self.refreshThreadHeader(); + if(self.popupInstance) { + var title = self.replaceCountTemplate(self.config['popup-title'], + eventParams.count); + self.popupInstance.updateTitle(title); + } + if(self.parentWidget && self.parentWidget.popupLink) { + self.drawCommentLink.call(self.parentWidget, eventParams.count); + } + break; + case "user-login": + if (self.config['display-mode'] == "inline") { + var nofocus = typeof(eventParams.nofocus) == "undefined" + || eventParams.nofocus; + self.refreshComments({"nofocus": nofocus}); + } + break; + case "user-logout": + if (self.config['display-mode'] == "inline") { + var nofocus = typeof(eventParams.nofocus) == "undefined" + || eventParams.nofocus; + JSKW$Events.invalidateContext(self.miniProfileCtx); + setTimeout(function(){ + self.refreshComments({"nofocus": nofocus}); + }, 0); + } + break; + } +} + +JSCC.prototype.refreshThreadHeader = function() { + var hdr = this.TC['jsk-HeaderWrapper']; + if(hdr && hdr.parentNode) { + hdr.parentNode.replaceChild(this.getThreadHeader(), hdr); + this.addAdminMenu(this.TC['jsk-MenuAdmin']); + } +} + +JSCC.prototype.makeWelcomePanel = function() { + var s = this; + if (s.jcaIndex) return; + if (!s.adminMode) { + s.deleteWelcomePanel(); + return; + } + if (s.TC['js-WelcomePanel'] || s.config.moderate || s.config.nolc) return; + + var wp_html = '' + + ''; + var wp = JSKitLib.html(s.gtmpl(wp_html)); + JSKitLib.mapClass2Object(s.TC, wp); + s.TC['js-WelcomePanelClose'].onclick = function() { + s.TC['js-WelcomePanel'].style.display = 'none'; + if (s.serverOptions.welcome && s.serverOptions.welcome.ts) { + s.server('s-welcome-close', {'ts': + s.serverOptions.welcome.ts}); + } + } + s.appendProfileHandler(s.TC['js-WelcomeProfileLink'], {profile: s.serverOptions.profile}); + JSKitLib.addPNG(s.TC['js-WelcomePanelArrow'], s.uriDomain + "/images/welcome/triangle.png"); + var lc = s.TC['js-LeaveComment']; + if (lc) lc.parentNode.insertBefore(wp, lc); +} + +JSCC.prototype.deleteWelcomePanel = function() { + if (this.TC['js-WelcomePanel']) { + this.TC['js-WelcomePanel'].parentNode.removeChild(this.TC['js-WelcomePanel']); + delete this.TC['js-WelcomePanel']; + } +} + +JSCC.prototype.addMenu = function(cmt, obj) { + var self = this; + var showOffensive = this.serverOptions.commod && !obj.yours && !this.config.nolc && (!obj.msgtype || !obj.msgtype.match(/T|P/) || this.serverOptions.trackbackreply); + var showProfile = obj.profile && self.serverOptions.showProfile && !(obj.msgtype && obj.msgtype.match(/T|P/)) && !this.config.nolc; + var cmtURL = ((obj.permalink || this.config.permalink).replace(/#jsid-*/, "") + "#") + obj.ID; + var data = [ + {title: $JCL("showUserProfile"), action: function() {self.showProfile(cmt.firstChild, obj);}, hidden: !showProfile, icon: this.uriDomain + "/images/menu/show-user-profile.png"}, + {title: $JCL("markAsOffensive"), icon: this.uriDomain + "/images/menu/mark-comment-as-offensive.png", action: function(){self.markOffensive(obj.ID)}, hidden: !showOffensive}, + {title: $JCL("getPermalinkURL"), icon: this.uriDomain + "/images/menu/comment-permalink.png", inputValue: cmtURL, type: "DTI"} + ]; + if (!this.serverOptions.whitelabel) { + data.push({type: "Delimeter"}); + data.push({title: $JCL("getWidgetLikeThis"), action: function() { window.open("http://js-kit.com/comments?menu", "_blank");}, statusText: "http://js-kit.com/comments?menu"}); + } + var mtgt = this.config.nolc ? self.target.parentNode.parentNode : undefined; + return JSMenu($JCL("options"), data); +} + +JSCC.prototype.addAdminMenu = function(container) { + if (!container) return; + var s = this; + var so = s.serverOptions; + var isEPB = JSKitEPB.isExists(); + var isLogged = s.jskauth.isLogged(); + var isCmtAvailable = s.isSourceAvailable("Comments"); + var showProfile = function() { + s.showProfile(container, {"profile": so.profile}, {"activeSection": "editProfile"}); + }; + var mkItem = function(label, icon, action, guard, extra) { + return guard ? JSKitLib.foldl({ + "icon": icon ? '//cdn.js-kit.com/images/menu/' + icon : undefined, + "title": $JCL("menu" + label), + "action": action + }, extra || {}, function(value, acc, key) { acc[key] = value; }) : []; + }; + var mkLink = function(label, icon, url, guard, disabled) { + return mkItem(label, icon, function() { window.open(url, '_blank'); }, guard, { + "disabled": disabled, + "statusText": url + }); + }; + var mkDelimeter = function(guard) { + return guard ? {"type": "Delimeter"} : []; + }; + var items = JSKitLib.merge( + mkItem("Logout", "key.png", function() { s.jskauth.logout(); }, + !isEPB && isLogged && isCmtAvailable), + mkItem("Login", "key.png", function() { s.jskauth.show(); }, + !isEPB && !isLogged && isCmtAvailable), + mkItem("EditProfile", "user-edit.png", function() { showProfile(); }, + so.showProfile && isCmtAvailable && !so.isNullSession), + mkItem("Follow", "follow.png", function() { s.openFollowPopup(); }, + !isEPB && isCmtAvailable, {"disabled" : so.anonymousCmt && !isLogged}), + mkDelimeter(isCmtAvailable), + mkLink("Moderation", "comment-edit.png", s.uriDomain + "/moderate/", + isCmtAvailable, !so.adminMode), + mkLink("Settings", "wrench.png", s.uriDomain + "/settings/", + isCmtAvailable, !so.adminMode), + mkLink("AdminNotices", null, "http://blog.js-kit.com/tag/admin/", + isCmtAvailable, !so.adminMode), + mkDelimeter(isCmtAvailable && !so.whitelabel), + mkLink("GetThis", "script-code.png", s.uriDomain + "/comments?menu", + !so.whitelabel), + mkLink("JSKBlog", "newspaper.png", "http://blog.js-kit.com/", + !so.whitelabel), + mkLink("JSKTwitter", "twitter-favicon.png", "http://twitter.com/echoenabled", + !so.whitelabel), + mkLink("Help", "information.png", s.uriDomain + '/support/', + !so.whitelabel) + ); + if (!items.length) { + JSKitLib.removeChildren(container); + return; + } + JSKitLib.replaceChildren(container, JSMenu($JCL("menuAdmin"), items, "", s.target)); +} + +JSCC.prototype.getSelectedIdentities = function() { + var self = this; + var format = function(type, prefix, filter) { + return JSKitLib.fmap(self.jskauth.getIdentities(type), function(identity) { + if (!filter || filter(identity)) { + var flag = identity.use_as_from ? "checked" : "unchecked"; + return [prefix + identity.type, identity.url || '', flag, false]; + } + }); + } + var identities = JSKitLib.merge( + format("auth", "login-", function(identity) { return !!identity.user; }), + format("web", "")); + return JSKitLib.Object2JSON(identities); +} + +JSCC.prototype.constructFromToButtons = function(type) { + var template = + '
      ' + + '
      ' + + '
      ' + $JCL(type) + '
      ' + + '
      ' + + '
      '; + var descriptors = { + "BarExpandMarker" : function(element){ JSKitLib.addPNG(element, "//cdn.js-kit.com/images/common/arrow-down-10x10.png") } + }; + return JSKitLib.toDOM(template, "jskit-GoogleLikeMenu", descriptors).content; +} + +JSCC.prototype.fromMenuAnonymous = function() { + var self = this; + var template = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + var updateAnonymousURL = function(url) { + if (typeof url == "object") url = url[1]; + self.extraFormFields["Url"] = url; + }; + var identities = JSKitLib.fmap(self.jskauth.getIdentities("auth"), function(identity) { + return { + "icon": JSKAuth.prototype.getIdentityParam('favicon', identity, "//cdn.js-kit.com/images/favicons/" + identity.type + ".png"), + "type": "Checkbox", + "state": "disabled", + "title": JSKAuth.prototype.getIdentityParam('long_label', identity, JSKAuth.prototype.getIdentityLabel(identity.type, true)), + "action": function() { self.jskauth.show(identity.type); } + }; + }); + var items = JSKitLib.merge( + {"type": "HTML", "title": JSKitLib.html('
      ' + $JCL("Iam") + '
      ')}, + identities, + self.serverOptions.extraFieldURL ? [ + { + "type": "HTML", + "title": JSKitLib.html('
      ' + $JCL("myWebsites") + '
      '), + "hidden": self.serverOptions.anonymousCmt + }, + { + "type": "SRCheckbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "title": self.extraFormFields["Url"] || $JCL("myURL"), + "oncreate": updateAnonymousURL, + "onupdate": updateAnonymousURL, + "deletable": false, + "unclonable": true, + "hideCheckbox": true, + "hidden": self.serverOptions.anonymousCmt + } + ] : [], + {"type": "HTML", "title": JSKitLib.html('')} + ); + var menu = JSMenu(self.constructFromToButtons("from"), items, "HTML"); + var descriptors = { + "control": function() { + return menu; + }, + "field": function(element) { + self.renderNameField(element, "js-kit-from-name"); + if (self.serverOptions.anonymousCmt) { + JSKitLib.preventSelect(element); + JSKitLib.addEventHandler(element, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + JSKW$Events.syncBroadcast('JSMenu-Opened', menu); + }); + } + } + }; + return JSKitLib.toDOM(template, "js-kit-from-", descriptors).content; +} + +JSCC.prototype.setNameFieldValue = function() { + var input = this.TC["js-CmtName"]; + if (!input) return; + JHI2.remove(input); + input.value = (!JHI2.isEmpty(input) && input.value) || this.extraFormFields["Name"] || ""; + JHI2.create(this.serverOptions.requireUsername ? $JCL("yourNameRequired") : $JCL("yourNameHere"), input); +} + +JSCC.prototype.renderNameField = function(container, className, readonly) { + var element; + var anonymousCondition = this.serverOptions.anonymousCmt && !this.jskauth.isLogged(); + if (readonly || anonymousCondition) { + var text = this.extraFormFields["Name"] || ""; + if (anonymousCondition) { + text = $JCL("loginRequiredNotice"); + JSKitLib.addClass(container, "js-kit-disabledNameField"); + } + element = JSKitLib.html("
      " + text + "
      "); + } else { + element = JSKitLib.html(""); + if(this.TC) this.TC["js-CmtName"] = element; + JSKitLib.addEventHandler(container, ["click"], function(e) { + JSKitLib.stopEventPropagation(e); + element.focus(); + }); + element.title = $JCL("clickToEdit"); + this.setNameFieldValue(); + } + JSKitLib.replaceChildren(container, element); +} + +JSCC.prototype.fromMenuActionsHandler = function(identity, action, data) { + var self = this; + var rerenderUserInfo = function() { + self.userInfoWrapper(self.TC["js-kit-lcf-userInfoWrapper"]); + } + var rerenderLinksIcon = function() { + self.miniProfile.render("siteLinksIcons", {"identities": self.jskauth.getIdentities()}); + } + switch (action) { + case "delete": if (identity.group == "web") { + self.jskauth.identityServerAction("unbind", identity, {}, rerenderLinksIcon); + break; + }; + case "delete": + var loggedCount = JSKitLib.foldl(0, self.jskauth.getIdentities("auth"), function(identity, acc) { + return acc += identity.user ? 1 : 0; + }); + var firstConfirmed; + if ( + (firstConfirmed = confirm($JCL("confirmMessage_unbindAccount"))) && loggedCount > 1 + || firstConfirmed && loggedCount == 1 && confirm($JCL("confirmMessage_unbindLastAccount")) + ) { + self.jskauth.identityServerAction("unbind", identity, {}, rerenderUserInfo); + } + break; + case "create": + self.jskauth.identityServerAction("bind", identity, {}, rerenderLinksIcon); + break; + case "update": + self.jskauth.identityServerAction("update", identity, {url: data[1]}, rerenderLinksIcon); + break; + case "check": + identity.use_as_from = true; + rerenderLinksIcon(); + break; + case "uncheck": + identity.use_as_from = false; + rerenderLinksIcon(); + break; + } +} + +JSCC.prototype.fromMenuLoggedIn = function() { + var self = this; + var identities = {"auth": {}, "web": {}}; + var applyCallbacks = function(item) { + JSKitLib.fmap(["check", "uncheck", "delete", "update", "create"], function(action) { + item["on" + action] = function(data) { + if (!this.identity) + this.identity = self.jskauth.assembleIdentity(data, "home", "web"); + self.fromMenuActionsHandler(this.identity, action, data); + } + }); + return item; + } + var validateURLs = function(url) { + if(!url) { + alert($JCL("urlIsEmpty")); + return false; + } + for(var i = 0; i < this.parent.items.length; i++) { + if(this.parent.items[i].title == url && this.parent.items[i] != this) { + alert($JCL("urlAlreadyExists")); + return false; + } + } + return true; + } + identities.auth = JSKitLib.fmap(this.jskauth.getIdentities("auth"), function(identity) { + var state; + if (!identity.user) { + state = "disabled"; + } else if (identity.use_as_from) { + state = "checked"; + } else { + state = "unchecked"; + } + return applyCallbacks({ + "type": "Checkbox", + "icon": JSKAuth.prototype.getIdentityParam('favicon', identity, "//cdn.js-kit.com/images/favicons/" + identity.type + ".png"), + "state": state, + "title": identity.url, + "action": state == "disabled" ? function() { self.jskauth.show(identity.type); } : null, + "identity": identity, + "displayTitle": (function(){ + if(identity.user) { + var Name; + if(identity.group == "epb" && JSKitEPB.isExists()) + Name = JSKitEPB.getValue("Name"); + Name = Name || identity.name || identity.user; + return Name + " @ " + JSKAuth.prototype.getIdentityParam('short_label', identity, JSKAuth.prototype.getIdentityLabel(identity.type)); + } else { + return JSKAuth.prototype.getIdentityParam('long_label', identity, JSKAuth.prototype.getIdentityLabel(identity.type, true)); + } + }()), + "deletable": identity.user && identity.group != 'epb', + "deleteLabel": $JCL("menuUnbindIdentity") + }); + }); + identities.web = JSKitLib.fmap(this.jskauth.getIdentities("web"), function(identity) { + return applyCallbacks({ + "type": "SRCheckbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "state": identity.use_as_from ? "checked" : "unchecked", + "title": identity.url, + "identity": identity, + "alreadyEdited": true + }); + }); + var items = JSKitLib.merge( + {"type": "HTML", "title": JSKitLib.html('
      ' + $JCL("Iam") + '
      ')}, + identities.auth, + self.serverOptions.extraFieldURL ? JSKitLib.merge( + { + "type": "HTML", + "title": JSKitLib.html('
      ' + $JCL("myWebsites") + '
      ') + }, + identities.web, + applyCallbacks({ + "type": "SRCheckbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "title": $JCL("myURL"), + "hideCheckbox": true + }) + ) : [], + {"type": "HTML", "title": JSKitLib.html('')} + ); + return JSMenu($JCL("addAnotherSite"), items); +} + +JSCC.prototype.toMenu = function() { + var self = this; + var share = function(identity, publish) { + identity.publish = publish; + self.extraFormFields["Share-" + identity.type] = publish ? "on" : "off"; + } + var sharingServices = JSKitLib.fmap(this.jskauth.getIdentities("auth"), function(identity) { + if (!identity.can_publish) return; + self.extraFormFields["Share-" + identity.type] = "off"; + var sharing_available = identity.user && !identity.expired; + return { + "type": "Checkbox", + "icon": "//cdn.js-kit.com/images/favicons/" + identity.type + ".png", + "title": $JCL("shareWith_" + identity.type), + "state": sharing_available ? (identity.publish || self.$temp_publish == identity.type ? "checked" : "unchecked") : "disabled", + "action": sharing_available ? null : function() { + self.$temp_publish = identity.type; + self.jskauth.show(identity.type); + }, + "oninit": function() { + if (sharing_available && (identity.publish || self.$temp_publish == identity.type)) this.oncheck(this.title); + }, + "oncheck": function(title) { + var item = this; + share(identity, true); + item.dt = cnt.insertBefore( + JSDogtag({ + "text": title, + "icon": "//cdn.js-kit.com/images/favicons/" + identity.type + ".png", + "onclose": function() { + item.setState("unchecked"); + cnt.removeChild(item.dt); + share(identity, false); + } + }), + cnt.lastChild); + }, + "onuncheck": function(title) { + share(identity, false); + if (this.dt) cnt.removeChild(this.dt); + } + }; + }); + var items = JSKitLib.merge( + {"type": "HTML", "title": JSKitLib.html('
      ' + $JCL("shareWith") + '
      ')}, + { + "type": "Checkbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "title": $JCL("thisPage"), + "state": "checked-disabled" + }, + sharingServices, + {"type": "HTML", "title": JSKitLib.html('')}); + + var cnt = JSKitLib.cr({className: "js-kit-lcf-toField"}); + cnt.appendChild(new JSDogtag({"text": $JCL("thisPage"), "icon": "//cdn.js-kit.com/images/favicons/default.png"}, cnt)); + cnt.appendChild(JSKitLib.html('
      ')); + var menu = JSMenu(self.constructFromToButtons("to"), items, "HTML"); + cnt.insertBefore(menu, cnt.firstChild); + JSKitLib.addEventHandler(cnt, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + JSKW$Events.syncBroadcast('JSMenu-Opened', menu); + }); + delete this.$temp_publish; + return cnt; +} + +JSCC.prototype.miniProfileWrapper = function(target) { + var self = this; + var so = this.serverOptions; + var avatar = this.avatarsManager.getActiveAvatar() || this.avatarsManager.anonymousAvatarData(); + this.miniProfileCtx = JSKW$Events.registerEventCallback(undefined, function(name, newSites) { + if (!self.serverOptions.extraFieldURL) return; + self.jskauth.setWebIdentities(JSKitLib.fmap(newSites, function(site) { + return self.jskauth.assembleIdentity(site.data[1], site.data[0], 'web'); + })); + self.miniProfile.render("addAnotherSite"); + self.miniProfile.render("siteLinksIcons", {"identities": self.jskauth.getIdentities()}); + }, "profile_socialSitesUpdated"); + var descriptors = { + "name": function(element) { + self.renderNameField(element, "js-kit-miniProfile-name-ipe", JSKitEPB.isExists()); + }, + "avatar": function(element) { + self.avatarsManager.assembleAvatarArea(element); + }, + "logout": function(element) { + element.onclick = function() { + if (element.busy) return; + element.busy = true; + JSKitLib.text($JCL("loggingOut"), element, true); + self.jskauth.logout(); + }; + }, + "logoutLink": function(element) { JSKitLib.text($JCL("menuLogout"), element); }, + "logoutIcon": function(element) { JSKitLib.addPNG(element, "//cdn.js-kit.com/images/cross.png"); }, + "addAnotherSite": function(element) { + return self.fromMenuLoggedIn(); + } + }; + var gfc = this.jskauth.getAuthIdentity("gfc"); + if (gfc && gfc.params.site) gfc.params.domain = this.config.domain; + var data = { + "Name": this.getUserProperty("Name", $JCL("guest")), + "profile": so.profile, + "avatarData": avatar, + "identities": this.jskauth.getIdentities() + }; + var config = { + "mode": "embedded", + "labels": $JCL, + "template": this.dtMiniProfileLeaveComment, + "uriDomain": this.uriDomain, + "uriAvatar": this.uriAvatar, + "cssPrefix": "js-kit-lcf-miniProfile", + "avatarSize": {"width": "64", "height": "64"}, + "descriptors": descriptors, + "openFullProfile": function() { self.showProfile(target, data); }, + "isNativeProfileDisabled": !self.serverOptions.showProfile + }; + this.miniProfile = new JSKitMiniProfile(target, data, config); +} + +JSCC.prototype.renderLeaveCommentForm = function() { + var s = this; + if (s.getSkin() != 'echo') { + if (s.TC["js-commentAvatar"]) { + JSKitLib.removeChildren(s.TC["js-commentAvatar"]); + s.avatarsManager.assembleAvatarArea(s.TC["js-commentAvatar"]); + } + return; + } + JSKitLib.fmap(["userInfoWrapper", "extraControlsMenuWrapper"], function(name) { + var element = s.TC["js-kit-lcf-" + name]; + if (element && typeof(s[name]) == "function") s[name](element); + }); +} + +JSCC.prototype.userInfoWrapper = function(target) { + var template = this["dtCreateUserInfo" + (this.jskauth.isLogged() ? "" : "Non") + "Logged"]; + JSKitLib.replaceChildren(target, JSKitLib.toDOM(template, "js-kit-lcf-", this).content); +} + +JSCC.prototype.getRSSUrl = function() { + var config = this.config; + return this.serverOptions.customRSSLink + ? window.location.protocol + "//rss." + config.domain + "/comments" + config.path + : window.location.protocol + "//js-kit.com/rss/" + config.domain + config.path; +} + +JSCC.prototype.openFollowPopup = function() { + var self = this; + var dialog, eventCtx; + if (window.JSKW$currentProfile) { + window.JSKW$currentProfile.hideProfile(); + } + var notifyMode = self.serverOptions.notifyMode; + var followPanel = this.followPanelPopup = this.assembleFollowPanel("popup"); + followPanel.get("rssThreadInput").value = this.getRSSUrl(); + var closeDialog = function() { + dialog.close(); + JSKW$Events.invalidateContext(eventCtx); + delete self.followPanelPopup; + }; + var template = this.gtmpl(this.dtFollowPanelPopup); + var descriptors = { + "content": function() { + return followPanel.content; + }, + "doneButton": function(element, dom) { + element.onclick = function() { + new JSRVC({ + "uri": self.uriDomain + "/manage-email-subscription", + "ref": JSKitLib.getRef(self), + "target": self.target, + "request": { + "p": self.pathOverride, + "mode": self.serverOptions.notifyMode + } + }); + element.value = $JCL("follow_subscriptionInProgress"); + JSKitLib.fmap([ + element, + dom.get("cancelButton") + ], function(control) { + if (control) control.disabled = true; + }); + } + }, + "cancelButton": function(element) { + element.onclick = function() { + closeDialog(); + self.serverOptions.notifyMode = notifyMode; + }; + }, + "editNotifications": function(element) { + element.onclick = function() { + window.open(self.uriDomain + "/settings/pctl.cgi?site=" + self.config.domain); + } + } + }; + var dom = JSKitLib.toDOM(template, "js-kit-follow-popup-", descriptors); + var config = { + "width": 450, + "height": 230, + "cssClass": "js-kit-follow-popup" + }; + dialog = new JSKitModalDialog(dom.content, config); + dialog.open(); + var handleServerResponse = function(eventName, data) { + self.serverOptions.profile = data.profile; + if (data.hasOwnProperty("mode")) { + self.serverOptions.notifyMode = data.mode; + } + self.updateFollowPanel(self.followPanel); + closeDialog(); + } + eventCtx = JSKW$Events.registerEventCallback(undefined, + handleServerResponse, "JSKit_emailSubscription"); +} + +JSCC.prototype.updateFollowPanel = function(dom) { + var self = this; + JSKitLib.fmap(["noemail", "email", "anymails"], function(notifyMode) { + self.setInputState("radio", + dom.get("notifyOptionRadio-" + notifyMode), + self.serverOptions.notifyMode == notifyMode ? "checked" : "unchecked"); + }); +} + +JSCC.prototype.assembleFollowPanel = function(postfix) { + var self = this; + var rssUrl = this.getRSSUrl(); + var template = this.gtmpl(this.dtFollowPanel); + var getEmail = function(emptyEmailLabel) { + return self.extraFormFields["Email"] || emptyEmailLabel; + }; + var descriptors = { + "rssIcon": function(element) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/rss.png"); + }, + "rssThreadInput": function(element) { + element.title = rssUrl; + }, + "rssThreadButton": function(element) { + element.onclick = function() { window.open(rssUrl); }; + }, + "emailAddress": function(element) { + JSKitLib.text(getEmail($JCL("follow_emptyEmail")), element, true); + }, + "editProfileLink": function(element) { + element.onclick = function() { + var profile = window.JSKW$currentProfile; + if (profile && profile.isYours()) return; + setTimeout(function() { + self.showProfile(self.target, + {"profile": self.serverOptions.profile}, + {"activeSection": "editProfile"}); + }, 0); + JSKitLib.text($JCL("follow_openingProfile"), element, true); + JSKitLib.addClass(element, "js-kit-follow-openingProfile"); + }; + }, + "emailIcon": function(element) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/email.png"); + } + }; + JSKitLib.fmap(["noemail", "email", "anymails"], function(mode) { + var notifyOptionHandler = function(element, dom) { + var updateNotifyControlsLayout = function(previousMode) { + if (!getEmail()) { + var link = dom.get("emailAddress"); + var getClass = function(notifyMode) { + return "js-kit-follow-activeNotifyMode-" + notifyMode; + }; + if (previousMode) { + JSKitLib.removeClass(link, getClass(previousMode)); + } + JSKitLib.addClass(link, getClass(mode)); + } + self.updateFollowPanel(dom); + }; + if (self.serverOptions.notifyMode == mode) { + updateNotifyControlsLayout(); + } + element.onclick = function() { + var previousMode = self.serverOptions.notifyMode; + self.serverOptions.notifyMode = mode; + updateNotifyControlsLayout(previousMode); + }; + }; + descriptors["notifyOptionRadio-" + mode] = notifyOptionHandler; + descriptors["notifyOptionLabel-" + mode] = notifyOptionHandler; + }); + return JSKitLib.toDOM(template, "js-kit-follow-", descriptors); +} + +JSCC.prototype.extraControlsMenuWrapper = function(target) { + var self = this; + var container = this.TC["js-kit-lcf-extraControlsMenuContent"]; + if (!container) return; + var tabs = []; + if (this.config.uploadImages) tabs.push({ + "name": "images", + "icon": "//cdn.js-kit.com/images/picture_add.png", + "title": $JCL("addImgText"), + "content": function() { + var template = + '
      ' + + '
      {Label:addImagesSectionNotice}
      ' + + '
      ' + + '
      ' + + '
      '; + var dom = JSKitLib.toDOM(self.gtmpl(template), "js-kit-images-", {}); + self.assembleImagesUploadForm(dom.get("form"), dom.get("list")); + return dom.content; + } + }); + var panel = this.followPanel = this.assembleFollowPanel(); + tabs.push({ + "name": "follow", + "icon": "//cdn.js-kit.com/images/follow.png", + "title": $JCL("follow"), + "callbacks" : { + "onTabOpened": function() { + self.updateFollowPanel(panel); + setTimeout(function() { + panel.get("rssThreadInput").value = self.getRSSUrl(); + }, 0); + }, + "onTabClosed": function() { + panel.get("rssThreadInput").value = ""; + } + }, + "content": function() { + return panel.content; + } + }); + var template = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + var marker = function(element) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/menu/vertical-menu-expand-marker.png"); + }; + this.extraControlsMenu = new JSTabsManager(tabs, { + "titles": target, + "content": container + }, { + "mode": "toggle", + "template": template, + "descriptors": {"expandMarker": marker} + }); +} + +JSCC.prototype.renderSubscribeEvents = function(subscribeEvents) { + var s = this; + if(subscribeEvents.error) { + alert(subscribeEvents.errorDescription); + return; + } + var appliedEvents = 0; + JSKitLib.fmap(subscribeEvents, function(subscribeEvent){ + var item = s.jspg.getItemById(subscribeEvent.ID); + var f; + f = function(operation) { + if(operation=='add') { + if(!item) { + var cmtobj = subscribeEvent.content; + if(cmtobj.ParentID && !s.jspg.getItemById(cmtobj.ParentID)) return; + s.pause.visible = true; + s.renderPauseIndicator(); + if(!s.pause.state) { + cmtobj.ID = subscribeEvent.ID; + if (s.serverOptions.clustering) + cmtobj.ParentID = JSFSearch.search(s.jspg.getItemsToDisplay(), cmtobj); + cmtobj.echoItem = true; + cmtobj.echoItemFirstTime = true; + cmtobj.imgs = s.parseImgData(cmtobj); + s.cmtInPlace(s.prepareCommentObj(cmtobj)); + s.publishEvent('comment-added', {'cmtId': cmtobj.ID}); + appliedEvents++; + } + } else { + f('edit'); + } + } + if(s.pause.state) { + s.pause.queue.push(subscribeEvent); + if(operation=='add') { + s.renderPauseCounter(); + } + return; + } + if(operation=='edit') { + if(item) { + var msgId = subscribeEvent.ID; + var cobj = s.objById[msgId]; + JSKitLib.fmap(subscribeEvent.content, + function(v,k){ + cobj[k] = v; + }); + JSKW$Events.syncBroadcast("smileys-newCommentInDiv", cobj); + s.jspg.invalidateItemView(msgId); + if(s.jspg.getPageByItemId(msgId)==s.curPage-1){ + var pageNo = s.curPage; + s.curPage = 0; + s.displayPage(pageNo); + } + JSKW$Events.syncBroadcast("comment-edited", s.jcaIndex, msgId); + appliedEvents++; + } + } + if(operation=='delete') { + if(item) { + s.postHandlerDelete(item.div); + appliedEvents++; + } + } + if(operation=='like_vote') { + if(item) { + var cobj = s.objById[subscribeEvent.ID]; + cobj.likeInstance.vote(subscribeEvent.content.action, subscribeEvent.content); + } + } + } + f(subscribeEvent.operation); + }); + if(appliedEvents > 0) { + s.reCalcPages(); + s.controls.reveal(); + } +} + +JSCC.prototype.useEcho = function() { + return (this.getSkin() == 'echo') && this.serverOptions.echoLiveUpdates && !this.IM && !this.config.nolc && !this.config.moderate; +} + +JSCC.prototype.useReplyThreadsCollapsing = function() { + return this.useEcho() && this.serverOptions.collapseReplyThreads; +} + +JSCC.prototype.replaceCountTemplate = function(template, count) { + return template.replace(/{Count}/, count); +} + +JSCC.prototype.constructPopupLink = function(count) { + var s = this; + var so = s.serverOptions; + var tmpl = s.utmpl['js-CommentsPopupLink'] || s.dtCommentsPopupLink; + var link = tmpl.replace(/{LinkLabel}/, s.constructCommentsLabel(count, so.countLabels)); + link = s.replaceCountTemplate(link, count); + popupLink = JSKitLib.html(s.gtmpl(link)); + JSKitLib.addEventHandler(popupLink, ['click'], + function(e) { + s.popComments(); + JSKitLib.preventDefaultEvent(e); + }); + return popupLink; +} + +JSCC.prototype.drawCommentLink = function(count) { + var s = this; + if (s.popupLink) { + var oldPopupLink = s.popupLink; + s.popupLink = s.constructPopupLink(count); + s.target.parentNode.replaceChild(s.popupLink, oldPopupLink); + } else { + s.popupLink = s.constructPopupLink(count); + s.target.parentNode.insertBefore(s.popupLink, s.target); + JSKitLib.hide(s.target); + } +} + +JSCC.prototype.constructCommentsLabel = function(c, labels) { + if (typeof window.JSKitCommentsCountFilter == 'function') + return JSKitCommentsCountFilter(c); + labels = labels || ["Comments", "Comments (1)", "Comments ({Count})"]; + switch (c) { + case 0: return labels[0]; + case 1: return labels[1]; + default: return this.replaceCountTemplate(labels[2], c); + } +} + +JSCC.prototype.popComments = function() { + var self = this; + var config = this.config; + switch (config['display-mode']) { + case 'ext-popup': + var wl = window.location; + var url = this.uriDomain + "/api/static/pop_comments?ref=" + + encodeURIComponent(JSKitLib.getRef(self)) + + "&title=" + encodeURIComponent(config['page-title']); + + url += '&' + JSKitLib.fmap(config, function(v, k) { + if (v && !k.match(/^(domain|popup-width|popup-height|display-mode|disabled|noDataRequest)$/)) + return k + "=" + encodeURIComponent(v); + }).join('&'); + + var params = 'width=' + config['popup-width'] + ", height=" + config['popup-height'] + ", status=yes, resizable=yes, scrollbars=yes"; + var w = window.open(url, "js_kit_popup_" + self.jcaIndex, params); + w.focus(); + break; + case 'int-popup': + var divc = this.target.cloneNode(false); + divc.jsk$initialized = false; + var title = this.config['popup-title']; + var popupWidget = new JSCC(divc, {'config': {'display-mode': 'inline'}}); + var popupInstance = new JSKitUniversalContainer(divc, + { + 'mode': 'popup', 'title': self.replaceCountTemplate(title, '0'), + 'backdrop': 'yes', 'opacity': 0.4, + 'size': {'width': config['popup-width'], 'height': config['popup-height']}, + 'cssPrefix': 'js-kit-popupComments', + 'whiteLabel': self.serverOptions.whitelabel + }, + { + 'onContainerBeforeClose': function() { + if (window.JSKW$currentProfile) window.JSKW$currentProfile.hideProfile(); + JSKW$Events.syncBroadcast("comments_closeControlsPopup"); + popupWidget.CommentCancelled(); + } + } + ); + popupWidget.parentWidget = this; + popupWidget.popupInstance = popupInstance; + break; + } +} + +JSCC.prototype.initAuth = function() { + var s = this; + + var old_facebook = s.jskauth && s.jskauth.getAuthIdentity("facebook"); + + if (s.jskauth) s.jskauth.destroy(); + s.jskauth = new JSKAuth({ + ref: JSKitLib.getRef(s), + mode: "popup", + target: s.target, + identities: s.serverOptions.identities, + withBackdrop: "true" + }); + + var facebook = s.jskauth.getAuthIdentity("facebook"); + if (facebook) { + JSKitFBSDK.prototype.detectXD(s.target); + } + if (old_facebook && old_facebook.user + && (!facebook || facebook.user != old_facebook.user)) { + new JSKitFBSDK( + JSKitLib.getRef(s), + old_facebook.params.app_id, + old_facebook.params.xd_receiver, + function() { + this.logout(); + } + ); + } +} + +JSCC.prototype.updateConfigFromServer = function(so) { + var s = this; + JSKitLib.fmap({ + 'display-mode': 'displayMode', + 'popup-title': 'popupTitle', + 'popup-width': 'popupWidth', + 'popup-height': 'popupHeight' + }, function(v, k) { s.config[k] = s.config[k] || so[v]; }); + s.config.skin = s.hasOwnProperty("dtComment") ? s.config.skin : (s.config.skin || so.skin); + s.config['display-mode'] = s.config['display-mode'] || "inline"; +} + +JSCC.prototype.findRootParent = function(comment) { + return (comment && comment.ParentID) ? + this.findRootParent(this.objById[comment.ParentID]) : comment; +} + +JSCC.prototype.assembleExpandRepliesMarker = function(comment) { + var self = this; + var template = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + var descriptors = { + "label": function() { + return JSKitLib.text($JCL("expandXMoreReplies", {"count": comment.extra.collapsedCmtsCount})); + }, + "container": function(element) { + JSKitLib.addStyle(element, "margin-left: " + self.level4margin(1) + ";"); + JSKitLib.setEventHandler(element, ["click"], function() { + var pageNo = self.curPage; + self.markCollapsedReplies(comment, false); + self.curPage = 0; + self.displayPage(pageNo); + }); + } + }; + return JSKitLib.toDOM(template, "js-kit-replies-expand-", descriptors).content; +} + +JSCC.prototype.removeRepliesExpandMarker = function(comment) { + if (!comment.extra.expandMarker) return; + var marker = comment.extra.expandMarker; + if (JSKitLib.hasParentNode(marker)) { + marker.parentNode.removeChild(marker); + delete comment.extra.expandMarker; + } + +} + +JSCC.prototype.markCollapsedReplies = function(comment, collapse) { + if (!this.useReplyThreadsCollapsing()) return; + var self = this; + if (comment.ParentID) { + comment = this.findRootParent(comment); + } + if (!comment) return; + if (typeof(collapse) == "undefined") { + collapse = typeof(comment.extra.areRepliesCollapsed) == "undefined" || + comment.extra.areRepliesCollapsed; + } + var threadWalk = function(cmt, callback, idx) { + if (!idx) idx = 0; + JSKitLib.fmap(cmt.thread, function(reply) { + idx++; + if (callback) callback(reply, idx); + idx = threadWalk(reply, callback, idx); + }); + return idx; + }; + var limits = {"chunk": 2, "full": 5}; + var totalRepliesCount = threadWalk(comment); + threadWalk(comment, function(cmt, idx) { + cmt.extra.collapsed = collapse && + totalRepliesCount > limits.full && + idx - limits.chunk > 0 && + idx + limits.chunk <= totalRepliesCount; + cmt.extra.cssClass = (collapse && totalRepliesCount - idx == limits.chunk - 1) ? + "jsk-ItemWrapper-borderless" : undefined; + + if (cmt.extra.collapsed && cmt.ID == self.replyForId) { + cmt.extra.cssClass = "jsk-ItemWrapper-borderless"; + cmt.extra.collapsed = false; + } + + if (self.jspg) { + self.jspg.invalidateItemView(cmt.ID); + } + }); + var collapsedCmtsCount = totalRepliesCount - limits.chunk*2; + comment.extra.collapsedCmtsCount = collapsedCmtsCount > 0 ? collapsedCmtsCount : 0; + comment.extra.areRepliesCollapsed = collapse; + this.removeRepliesExpandMarker(comment); +} + +JSCC.prototype.newCount = function(count, so) { + var s = this; + s.serverOptions = so; + s.updateConfigFromServer(so); + s.drawCommentLink(count); + s.publishEvent('comments-count-updated', {'count': count}); +} + +/* Must be last to support Opera */ +JSCC.prototype.newData = function(arr, so) { + var s = this; + + s.updateConfigFromServer(so); + + if (s.config['display-mode'] == "inline") { + s.target.style.display = "block"; + s.target.style.visibility = "visible"; + } + JSKitLib.fmap(arr, function(obj) { + obj.Name = obj.Name || $JCL("guest"); + }); + s.serverOptions = so; + s.account = so.account || {}; + s.searchString = so.srch; + s.adminMode = !!so.adminMode; + s.ownerMode = !!so.ownerMode; + s.inlineModeration = (s.adminMode && !s.config.moderate); + + s.initAuth(); + + so.smiley = so.smiley || s.config.smiles == "yes"; + s.config.uploadImages = so.uploadImages; + if (s.useEcho()) { + s.config.backwards = 'yes'; + if (s.extraFormFields["Url"]) { + var identity = s.jskauth.assembleIdentity(s.extraFormFields["Url"], "home", "web"); + s.jskauth.appendIdentity(identity); + } + } + + if(so.TS) + this.serverDiffTS = so.TS - Math.round((new Date()).valueOf() / 1000); + + var dims = { + "form": (s.getSkin() == 'echo') ? '64x64' : '96x96', + "thread": (s.config.nolc || s.getSkin() == 'echo') ? '48x48' : so.avatardim + }; + s.avatarsManager = s.initAvatarsManager(dims.form); + s.maxAvatarDims = s.avatarsManager.splitAvatarDim(dims.thread); + + JSKitLib.addClass(s.target, "js-CommentsSkin-" + (s.getSkin() || "wireframe")); + + switch (s.config.skin) { + case "smoothgray": + s.navSym = JSKitLib.isIE() ? { "prev": '←', "next": '→'} : { "prev": '◀', "next": '▶' }; + if(!s.hasOwnProperty("dtComment")) s.dtComment = JSCC.prototype.dtComment2; + s.dtCreate = JSCC.prototype.dtCreate2; + s.dtEditComment = JSCC.prototype.dtEditComment2; + break; + case "haloscan": + s.dtComment = JSCC.prototype.dtComment3; + s.dtCreate = JSCC.prototype.dtCreate3; + s.dtEditComment = JSCC.prototype.dtEditComment; + if (window.JK$HS$haloscan_style) + JSKitLib.addCss(window.JK$HS$haloscan_style, "comments-skin-haloscan-custom"); + break; + case "echo": + s.dtComment = JSCC.prototype.dtCommentEcho; + s.dtCreate = JSCC.prototype.dtCreateEcho; + s.dtEditComment = JSCC.prototype.dtEditComment; + break; + } + + if (so.smiley) { + s.smiles = { + "O:-)" : {file: 'innocent.gif', title: 'Innocent'}, + ">:o": {file: 'yell.gif', title: 'Yell'}, + ":)" : {file: 'smile.gif', title: 'Smile'}, + ":-)" : {file: 'smile.gif', title: 'Smile'}, + ";)" : {file: 'wink.gif', title: 'Wink'}, + ";-)" : {file: 'wink.gif', title: 'Wink'}, + ":'(" : {file: 'cry.gif', title: 'Cry'}, + "8-)" : {file: 'cool.gif', title: 'Cool'}, + ":(" : {file: 'frown.gif', title: 'Frown'}, + ":-(" : {file: 'frown.gif', title: 'Frown'}, + ":*" : {file: 'kiss.gif', title: 'Kiss'}, + ":-*" : {file: 'kiss.gif', title: 'Kiss'}, + ":-D" : {file: 'laughing.gif', title: 'Laughing'}, + "=-O" : {file: 'surprised.gif', title: 'Surprised'}, + "=-X" : {file: 'sealed.gif', title: 'Sealed'}, + ":-[" : {file: 'embarassed.gif', title: 'Embarassed'}, + ":-$" : {file: 'money-mouth.gif', title: 'Money mouth'}, + ":-P" : {file: 'tongue-out.gif', title: 'Tongue out'}, + ":-E" : {file: 'foot-in-mouth.gif', title: 'Foot in mouth'}, + "*DONT_KNOW*" : {file: 'undecided.gif', title: 'Undecided'} + }; + var f = function(v) { return v.replace(/([\W])/g,"\\$1"); }; + JSKitLib.fmap(s.smiles, function(el, i) { + /* fix for case ">)" */ + s.smiles[i].regexpText = new RegExp('(>|<)?' + f(i), 'g'); + s.smiles[i].regexpTag = new RegExp(' ?' + f(s.smileTag(el)) + ' ?', 'g'); + }); + } + var cb = function(name, obj, jcaIndex) { + switch(name) { + case "smileys-onchangeCommentText": + if(so.smiley && obj && obj.Text) obj.Text = s.textSmiles2Graphical(obj.Text.replace(/&/g, "&")); + break; + case "smileys-beforePostNewComment": + if(so.smiley && obj && obj.value) obj.value = s.textSmiles2Graphical(obj.value, 1); + break; + case "smileys-loadCommentsWidget": + if (s.jcaIndex != jcaIndex) return; + /* no break needed !!! */ + case "smileys-newCommentInDiv": + var needAutolink = (so.htmlMode || s.config.nolc); + if ((so.smiley || needAutolink) && obj && obj.Text) { + obj.Text = obj.Text.split('').join(''); + if (needAutolink) { + var tags; + var tags2meta = function(t){tags = []; t = t.replace(/]*>.*?<\/a>|<.*?>/ig, function(m){tags.push(m); return ' %#HTML_TAG#% ';}); return t;}; + var meta2tags = function(t){JSKitLib.map(function(v){t = t.replace(' %#HTML_TAG#% ', v);}, tags); return t;}; + obj.Text = tags2meta(obj.Text); + obj.Text = obj.Text.replace(/((?:http|ftp|https):\/\/(?:[a-z0-9#:\/\;\?\-\.\+,@&=%!\*\'(){}\[\]$_|^~`](?!gt;|lt;))+)/ig, '$1'); + obj.Text = tags2meta(meta2tags(obj.Text)); + } + obj.Text = obj.Text.replace(/&/g, '&'); + if (so.smiley) obj.Text = s.textSmiles2Graphical(obj.Text); + if (needAutolink) { + obj.Text = meta2tags(obj.Text); + } + obj.Text = obj.Text.replace(/(]*)?([^&<>\s\/\-]{12})([^&<>\s\/\-]{12})/ig, function($0, $1, $2, $3){if($1)return $0; return $2+''+$3;}); + } + break; + } + } + var ctx = JSKW$Events.registerEventCallback(undefined, cb, "smileys-newCommentInDiv"); + JSKW$Events.registerEventCallback(ctx, cb, "smileys-loadCommentsWidget"); + JSKW$Events.registerEventCallback(ctx, cb, "smileys-beforePostNewComment"); + JSKW$Events.registerEventCallback(ctx, cb, "smileys-onchangeCommentText"); + + if(so.req) { + s.config.sort = so.req.srt; + s.config.backwards = so.req.ord == 'desc' ? 'yes' : 'no'; + s.config.thread = ((so.req.prs == 'flat') ? 'no' : 'yes'); + } + + s.gen++; + s.loading = false; + + if(s.ctag != so.tag) { + s.objById = {}; + if(s.jspg) s.invalidateJSPG(); + } + + var flat = (s.searchString) ? true : s.config.thread != 'yes'; + + var ttt = []; // top level thread + var newChildren = {}; + var nc = 0; + JSKitLib.fmap(arr, function(obj) { + if(!obj.ID) return; + if(s.IM && obj.yours) obj.Name = 'Me'; + if(flat) { + delete(obj.ParentID); + delete(obj.depth); + } + s.objById[obj.ID] = obj; + obj.extra = {}; + obj.thread = []; + JSKW$Events.syncBroadcast("smileys-loadCommentsWidget", obj, s.jcaIndex); + obj.karma = new JSCCKarma(obj, s); + if(obj.status != 'D') nc++; + var prn = s.objById[obj.ParentID]; + if(prn) { + if(!newChildren[obj.ParentID]) { + ttt.push(obj); + } + prn.thread.push(obj); + } else { + ttt.push(obj); + } + newChildren[obj.ID] = 1; + obj.imgs = s.parseImgData(obj); + }); + if (s.useReplyThreadsCollapsing()) { + JSKitLib.fmap(ttt, function(cmt) { + s.markCollapsedReplies(cmt, true); + }); + } + s.divPages(so, s.htmlPaginate(ttt)); + + if(this.IM) this.conversations = so.conversations; + + s.ctag = so.tag; + + if (so.wysiwyg) { + if (so.smiley) { + so.allowedHTMLTags.push('img/src', 'img/title', 'img/border', 'img/alt'); + } + var attrsByTag = {}; + JSKitLib.fmap(so.allowedHTMLTags, function(v) { + var p = v.split('/'); + var tag = p[0] || p; + var attr = p[1]; + if (!attrsByTag[tag]) { + attrsByTag[tag] = ["style"]; + } + if (attr) { + attrsByTag[tag].push(attr); + } + }); + var allowedTags = JSKitLib.fmap(attrsByTag, function(attrs, tag) { + return tag + (attrs.length ? '[' + attrs.join('|') + ']' : ''); + }).join(','); + s.tmce = { foreign: true, cfg: { + document_base_url: '//cdn.js-kit.com', + convert_newlines_to_brs: true, + relative_urls: 0, + remove_script_host: 0, + uri_domain: '//cdn.js-kit.com', + width: '100%', + closePopups: function() { + var cns = document.body.childNodes; + var i = 0; + while(i < cns.length) { + if(cns[i].id && cns[i].id.match(/^mce_\d+$/) && cns[i].className.match(/clearlooks2/)) document.body.removeChild(cns[i]); + else i++; + } + }, + bookMark: function() { + tinyMCE.settings.curBM = tinyMCE.activeEditor.selection.getBookmark(); + }, + mode: "none", + plugins: "inlinepopups" + (so.smiley?",emotions":"") + (so.media?",youtube":""), + theme: "advanced", + theme_advanced_buttons1: + "bold,italic,underline,|,undo,redo,link,unlink" + + (so.media?",youtube":"") + (so.smiley?",emotions":""), + theme_advanced_buttons2: "", + theme_advanced_buttons3: "", + theme_advanced_toolbar_location: "top", + theme_advanced_toolbar_align: "left", + valid_elements: allowedTags, + setup: function(ed) { + var setContent = function(ed, value, extra) { + if(JSKitLib.isIE()) { + ed.setContent(value, extra); + tinyMCE.execInstanceCommand(ed.id, 'selectall'); + ed.selection.collapse(0); + } else { + ed.setContent('', extra); + ed.execCommand('mceInsertContent', false, value, extra); + } + }; + JSKitLib.fmap(["onClick","onKeyUp"], function(ev) { + ed[ev].add(function(ed, e){ + tinyMCE.settings.bookMark(); + if (ev == 'onClick') { + JSKW$Events.syncBroadcast('JSMenu-CollapseAll'); + JSKW$Events.syncBroadcast('miniProfile_collapseAll'); + } + }); + }); + if (ed.getElement().smoothWysiwygLoading) { + ed.onBeforeRenderUI.add(function(ed, e) { + var el = ed.getElement(); + el.jsk$cover.parentNode.replaceChild(el.jsk$wrapper, el.jsk$cover); + }); + ed[JSKitLib.getBrowser() == 'gecko' ? 'onInit' : 'onPostRender'].add(function(ed, e) { + var el = ed.getElement(); + JSKitLib.show(el.jsk$wrapper); + if (!el.jsk$nofocus && el.jsk$widget.config.backwards != 'yes') + el.jsk$widget.TC["js-Cmtsubmit"].scrollIntoView(false); + }); + } + if(JSKitLib.getBrowser() == 'gecko') { + ed.onInit.add(function(ed, e) { + var d = ed.getDoc(); + try { + d.designMode = 'on'; + } catch(e) { ; } + }); + } + if (ed.getElement().jsk$hasDefaultValue && (s.jskauth.loginStatus || !s.anonymousCmt)) { + ed.onInit.add(function(ed, e) { + var d = (JSKitLib.getBrowser() == 'gecko' ? ed.getDoc() : ed.getWin()); + tinymce.dom.Event.add(d, 'focus', function(e) { + var el = ed.getElement(); + if (!el.defaultRemoved) { + setContent(ed, '', {format: 'raw', skip_undo: true}); + el.defaultRemoved = true; + } + tinyMCE.settings.auto_focus = el.id; + }); + }); + } + if (!so.smiley) return; + ed.onKeyUp.add(function(ed, e) { + var content = {Text: ed.getContent({format: 'raw'})}; + JSKW$Events.syncBroadcast("smileys-onchangeCommentText", content); + if(tinyMCE.settings.smiley) { + setContent(ed, content.Text, {format: 'raw'}); + } + }); + } + }}; + } + + s.dataLoader(so, nc); + + var showCD = function() { + if(so.ShowSavedCommentDialog) + so.ShowSavedCommentDialog(s); + } + + if(so.wysiwyg && !window.tinyMCE) { + JSKitLib.preloadImg('//cdn.js-kit.com/images/loading.gif'); + var inittmce = function() { + s.tmce.foreign = false; + s.tmce.cfg.plugins = "inlinepopups"+(so.smiley?",emotions":"")+(so.media?",youtube":""); // !inl-pop + s.tmce.cfg.strict_loading_mode = true; + tinyMCE.init(s.tmce.cfg); + showCD(); + } + var oldcb = window.jsk$tmcecb; + if(oldcb) { + window.jsk$tmcecb = function() { if(oldcb) oldcb(); showCD(); }; + } else { + window.jsk$tmcecb = inittmce; + JSKitLib.addScript('//cdn.js-kit.com/extra/tiny_mce/tmce.js', this.target); + } + } else { + showCD(); + } + + var f = s.onDataLoad; + if(f) { s.onDataLoad = null; setTimeout(f, 0); } + s.publishEvent('comments-data-loaded', {'count': so.pages.tc}); + + if(this.useEcho() && (!s.echoSubscribed)) { + var jsk$echo = jskEchoInit(JSKitLib.getRef(s), s.target); + var voidRenderer = function(rendererIdx) { + if(!jsk$echo.getRendererById(rendererIdx)) { + jsk$echo.existingRenderers.push({ + id: rendererIdx, + content: function() {} + }); + } + } + voidRenderer(0); + voidRenderer(1); + var request = { + p: s.config.path, + permalink: s.config.permalink + }; + if (s.sourceFilter) request[s.sourceFilter.type] = s.sourceFilter.sources.list; + jsk$echo.subscribe([{ + request: request, + callback: function() { + s.renderSubscribeEvents.apply(s, arguments) + } + }]); + s.echoSubscribed = true; + } +} diff --git a/english/courses/StatisticalAnalysis/w2/tutorial2.html b/english/courses/StatisticalAnalysis/w2/tutorial2.html new file mode 100644 index 0000000..17a3957 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w2/tutorial2.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

      Şebnem Er

      +

      Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

      +

      2nd Week's Tutorial

      +

      Tutorial questions

      +

      It is easy to estimate a confidence interval in R. Please examine this website.

      + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportion.docx b/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportion.docx new file mode 100644 index 0000000..a30a564 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportion.docx differ diff --git a/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportion.pdf b/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportion.pdf new file mode 100644 index 0000000..da2eb62 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportion.pdf differ diff --git a/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportionSolutions.xlsx b/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportionSolutions.xlsx new file mode 100644 index 0000000..2276219 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w3/W3_ConfidenceIntervalProportionSolutions.xlsx differ diff --git a/english/courses/StatisticalAnalysis/w3/tutorial3.html b/english/courses/StatisticalAnalysis/w3/tutorial3.html new file mode 100644 index 0000000..18f3ded --- /dev/null +++ b/english/courses/StatisticalAnalysis/w3/tutorial3.html @@ -0,0 +1,43 @@ + + + + + + +Statistical Analysis + + + + + + +

      Şebnem Er

      +

      Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

      +

      3rd Week's Tutorial

      +

      Tutorial questions for Confidence Interval of a Population Ratio

      +

      If only you are willing to learn, not for passing the course, there are very nice examples on the web.

      +

      It is easy to estimate a confidence interval in R. Please examine this website.

      + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.docx b/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.docx new file mode 100644 index 0000000..1d8937b Binary files /dev/null and b/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.docx differ diff --git a/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.pdf b/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.pdf new file mode 100644 index 0000000..dfa585b Binary files /dev/null and b/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.pdf differ diff --git a/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.xlsx b/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.xlsx new file mode 100644 index 0000000..298aaef Binary files /dev/null and b/english/courses/StatisticalAnalysis/w4/W4_ConfidenceIntervalVariance_SampleSize.xlsx differ diff --git a/english/courses/StatisticalAnalysis/w4/tutorial4.html b/english/courses/StatisticalAnalysis/w4/tutorial4.html new file mode 100644 index 0000000..f665a14 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w4/tutorial4.html @@ -0,0 +1,43 @@ + + + + + + +Statistical Analysis + + + + + + +

      Şebnem Er

      +

      Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

      +

      4th Week's Tutorial

      +

      Tutorial questions for Confidence Interval of a Population Variance and Sample Size Determination

      + +

      It is easy to estimate a confidence interval in R. Please examine this website.

      + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w5/W5_TestMean.docx b/english/courses/StatisticalAnalysis/w5/W5_TestMean.docx new file mode 100644 index 0000000..242d92c Binary files /dev/null and b/english/courses/StatisticalAnalysis/w5/W5_TestMean.docx differ diff --git a/english/courses/StatisticalAnalysis/w5/W5_TestMean.pdf b/english/courses/StatisticalAnalysis/w5/W5_TestMean.pdf new file mode 100644 index 0000000..3832094 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w5/W5_TestMean.pdf differ diff --git a/english/courses/StatisticalAnalysis/w5/chap08.pdf b/english/courses/StatisticalAnalysis/w5/chap08.pdf new file mode 100644 index 0000000..ae0df0b Binary files /dev/null and b/english/courses/StatisticalAnalysis/w5/chap08.pdf differ diff --git a/english/courses/StatisticalAnalysis/w5/chap08.ppt b/english/courses/StatisticalAnalysis/w5/chap08.ppt new file mode 100644 index 0000000..b3eaa29 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w5/chap08.ppt differ diff --git a/english/courses/StatisticalAnalysis/w5/tutorial5.html b/english/courses/StatisticalAnalysis/w5/tutorial5.html new file mode 100644 index 0000000..45de9bb --- /dev/null +++ b/english/courses/StatisticalAnalysis/w5/tutorial5.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

      Şebnem Er

      +

      Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

      +

      5th Week's Tutorial

      +

      Test of Mean

      + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w6/W6_Test2Means.docx b/english/courses/StatisticalAnalysis/w6/W6_Test2Means.docx new file mode 100644 index 0000000..6d3fbd3 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w6/W6_Test2Means.docx differ diff --git a/english/courses/StatisticalAnalysis/w6/W6_Test2Means.pdf b/english/courses/StatisticalAnalysis/w6/W6_Test2Means.pdf new file mode 100644 index 0000000..4f46be1 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w6/W6_Test2Means.pdf differ diff --git a/english/courses/StatisticalAnalysis/w6/chap09.pdf b/english/courses/StatisticalAnalysis/w6/chap09.pdf new file mode 100644 index 0000000..5b9b836 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w6/chap09.pdf differ diff --git a/english/courses/StatisticalAnalysis/w6/chap09.ppt b/english/courses/StatisticalAnalysis/w6/chap09.ppt new file mode 100644 index 0000000..875cccf Binary files /dev/null and b/english/courses/StatisticalAnalysis/w6/chap09.ppt differ diff --git a/english/courses/StatisticalAnalysis/w6/tutorial6.html b/english/courses/StatisticalAnalysis/w6/tutorial6.html new file mode 100644 index 0000000..b9daf93 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w6/tutorial6.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

      Şebnem Er

      +

      Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

      +

      6th Week's Tutorial

      +

      Test of 2 Population Means

      + + + + \ No newline at end of file diff --git a/english/courses/StatisticalAnalysis/w7/W7_TestMoreThan2Pop.doc b/english/courses/StatisticalAnalysis/w7/W7_TestMoreThan2Pop.doc new file mode 100644 index 0000000..48c5e79 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w7/W7_TestMoreThan2Pop.doc differ diff --git a/english/courses/StatisticalAnalysis/w7/W7_TestMoreThan2Pop.pdf b/english/courses/StatisticalAnalysis/w7/W7_TestMoreThan2Pop.pdf new file mode 100644 index 0000000..42ffc3f Binary files /dev/null and b/english/courses/StatisticalAnalysis/w7/W7_TestMoreThan2Pop.pdf differ diff --git a/english/courses/StatisticalAnalysis/w7/chap11.pdf b/english/courses/StatisticalAnalysis/w7/chap11.pdf new file mode 100644 index 0000000..aebc922 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w7/chap11.pdf differ diff --git a/english/courses/StatisticalAnalysis/w7/chap11.ppt b/english/courses/StatisticalAnalysis/w7/chap11.ppt new file mode 100644 index 0000000..1b36974 Binary files /dev/null and b/english/courses/StatisticalAnalysis/w7/chap11.ppt differ diff --git a/english/courses/StatisticalAnalysis/w7/tutorial7.html b/english/courses/StatisticalAnalysis/w7/tutorial7.html new file mode 100644 index 0000000..448ea95 --- /dev/null +++ b/english/courses/StatisticalAnalysis/w7/tutorial7.html @@ -0,0 +1,42 @@ + + + + + + +Statistical Analysis + + + + + + +

      Şebnem Er

      +

      Statistical Analysis Spring Semester 2011-2012 Undergraduate Module

      +

      7th Week's Tutorial

      +

      Test of More Than 2 Population Means - Analysis of Variance (ANOVA)

      + + + + \ No newline at end of file diff --git a/english/courses/analytics2020/Unsupervised-Learning.epub b/english/courses/analytics2020/Unsupervised-Learning.epub new file mode 100644 index 0000000..3d5297b Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning.epub differ diff --git a/english/courses/analytics2020/Unsupervised-Learning.html b/english/courses/analytics2020/Unsupervised-Learning.html new file mode 100644 index 0000000..3d2dc1b --- /dev/null +++ b/english/courses/analytics2020/Unsupervised-Learning.html @@ -0,0 +1,149 @@ + + + + + + + Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + +
      + +
      +
      + + +
      +
      + +
      + + +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/Unsupervised-Learning.pdf b/english/courses/analytics2020/Unsupervised-Learning.pdf new file mode 100644 index 0000000..f9994b1 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning.pdf differ diff --git a/english/courses/analytics2020/Unsupervised-Learning.tex b/english/courses/analytics2020/Unsupervised-Learning.tex new file mode 100644 index 0000000..57c1bc8 --- /dev/null +++ b/english/courses/analytics2020/Unsupervised-Learning.tex @@ -0,0 +1,702 @@ +% Options for packages loaded elsewhere +\PassOptionsToPackage{unicode}{hyperref} +\PassOptionsToPackage{hyphens}{url} +% +\documentclass[ +]{book} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[T1]{fontenc} + \usepackage[utf8]{inputenc} + \usepackage{textcomp} % provide euro and other symbols +\else % if luatex or xetex + \usepackage{unicode-math} + \defaultfontfeatures{Scale=MatchLowercase} + \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} +\fi +% Use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +\IfFileExists{microtype.sty}{% use microtype if available + \usepackage[]{microtype} + \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} +\makeatletter +\@ifundefined{KOMAClassName}{% if non-KOMA class + \IfFileExists{parskip.sty}{% + \usepackage{parskip} + }{% else + \setlength{\parindent}{0pt} + \setlength{\parskip}{6pt plus 2pt minus 1pt}} +}{% if KOMA class + \KOMAoptions{parskip=half}} +\makeatother +\usepackage{xcolor} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\hypersetup{ + pdftitle={Unsupervised Learning Methods}, + pdfauthor={Dr Sebnem Er}, + hidelinks, + pdfcreator={LaTeX via pandoc}} +\urlstyle{same} % disable monospaced font for URLs +\usepackage{color} +\usepackage{fancyvrb} +\newcommand{\VerbBar}{|} +\newcommand{\VERB}{\Verb[commandchars=\\\{\}]} +\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} +% Add ',fontsize=\small' for more characters per line +\usepackage{framed} +\definecolor{shadecolor}{RGB}{248,248,248} +\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}} +\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}} +\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}} +\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\BuiltInTok}[1]{#1} +\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} +\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}} +\newcommand{\ExtensionTok}[1]{#1} +\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\ImportTok}[1]{#1} +\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\NormalTok}[1]{#1} +\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} +\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} +\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\RegionMarkerTok}[1]{#1} +\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\usepackage{longtable,booktabs} +% Correct order of tables after \paragraph or \subparagraph +\usepackage{etoolbox} +\makeatletter +\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{} +\makeatother +% Allow footnotes in longtable head/foot +\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}} +\makesavenoteenv{longtable} +\usepackage{graphicx,grffile} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +% Set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +\setcounter{secnumdepth}{5} +\usepackage{booktabs} +\usepackage{amsthm} +\makeatletter +\def\thm@space@setup{% + \thm@preskip=8pt plus 2pt minus 4pt + \thm@postskip=\thm@preskip +} +\makeatother +\usepackage[]{natbib} +\bibliographystyle{apalike} + +\title{Unsupervised Learning Methods} +\author{Dr Sebnem Er} +\date{2020-10-02} + +\begin{document} +\maketitle + +{ +\setcounter{tocdepth}{1} +\tableofcontents +} +\hypertarget{introduction}{% +\chapter{Introduction}\label{introduction}} + +This book will guide you through the R codes for the following Unsupervised Learning methods: + +\begin{itemize} +\tightlist +\item + Association Rules +\item + Cluster Analysis +\item + Self Organising Maps +\end{itemize} + +The chapters will be made available on Tuesdays when we start a new topic. So please update your browser to access the codes for the relevant chapter. + +\hypertarget{association-rules}{% +\chapter{Association Rules}\label{association-rules}} + +\hypertarget{prerequisites}{% +\section{Prerequisites}\label{prerequisites}} + +You need to have the following R packages installed and recalled into your library: + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{library}\NormalTok{(datasets)} +\KeywordTok{library}\NormalTok{(grid)} +\KeywordTok{library}\NormalTok{(tidyverse)} +\KeywordTok{library}\NormalTok{(readxl)} +\KeywordTok{library}\NormalTok{(knitr)} +\KeywordTok{library}\NormalTok{(ggplot2)} +\KeywordTok{library}\NormalTok{(lubridate)} +\KeywordTok{library}\NormalTok{(arules)} +\KeywordTok{library}\NormalTok{(arulesViz)} +\KeywordTok{library}\NormalTok{(plyr)} +\end{Highlighting} +\end{Shaded} + +\hypertarget{the-groceries-dataset}{% +\section{The Groceries Dataset}\label{the-groceries-dataset}} + +We shall mine Groceries dataset for association rules using the Apriori Algorithm. The Groceries dataset can be loaded from R. The steps for doing so are shown below. Note that you will only be able to load the data set once the package \texttt{arules} has been loaded into R. The Groceries dataset contains a collection of receipts with each line representing 1 receipt and the items purchased. Each line is called a transaction and each column in a row represents an item. + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{data}\NormalTok{(Groceries)} +\KeywordTok{summary}\NormalTok{(Groceries)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## transactions as itemMatrix in sparse format with +## 9835 rows (elements/itemsets/transactions) and +## 169 columns (items) and a density of 0.02609146 +## +## most frequent items: +## whole milk other vegetables rolls/buns soda +## 2513 1903 1809 1715 +## yogurt (Other) +## 1372 34055 +## +## element (itemset/transaction) length distribution: +## sizes +## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +## 2159 1643 1299 1005 855 645 545 438 350 246 182 117 78 77 55 46 +## 17 18 19 20 21 22 23 24 26 27 28 29 32 +## 29 14 14 9 11 4 6 1 1 1 1 3 1 +## +## Min. 1st Qu. Median Mean 3rd Qu. Max. +## 1.000 2.000 3.000 4.409 6.000 32.000 +## +## includes extended item information - examples: +## labels level2 level1 +## 1 frankfurter sausage meat and sausage +## 2 sausage sausage meat and sausage +## 3 liver loaf sausage meat and sausage +\end{verbatim} + +As you can see, the data is in ``transactions'' format with a density of 0.0261 (check slides to remember what this value means). There are 9835 transactions with 169 distinct items that can be bought in this database (\(D\)). + +The summary function also provides the distribution of number items per transaction and the most popular items. + +Now let us examine the first 3 transactions in \(D\). + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{inspect}\NormalTok{(}\KeywordTok{head}\NormalTok{(Groceries, }\DecValTok{3}\NormalTok{))} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## items +## [1] {citrus fruit, +## semi-finished bread, +## margarine, +## ready soups} +## [2] {tropical fruit, +## yogurt, +## coffee} +## [3] {whole milk} +\end{verbatim} + +The first customer bought {\{citrus fruit,semi-finished bread,margarine,ready soups\}}, whereas the third customer bought only {\{whole milk\}}. + +We can also find how many items each transaction contains, for the first 10 transactions: + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{head}\NormalTok{(}\KeywordTok{size}\NormalTok{(Groceries), }\DecValTok{10}\NormalTok{)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## [1] 4 3 1 4 4 5 1 5 1 2 +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{hist}\NormalTok{(}\KeywordTok{size}\NormalTok{(Groceries), }\DataTypeTok{main =} \StringTok{"Distribution of the number of items purchased"}\NormalTok{, }\DataTypeTok{xlab =} \StringTok{"Number of items"}\NormalTok{, }\DataTypeTok{ylab=}\StringTok{"Number of Transactions"}\NormalTok{)} +\end{Highlighting} +\end{Shaded} + +\includegraphics{Unsupervised-Learning_files/figure-latex/unnamed-chunk-4-1.pdf} + +As it is clear, the distribution of the number of items is skewed to right, clearly most transactions inlcude fewer number of items, only very few have more than 10 items purchased together. + +\hypertarget{support-count-item-frequencies-and-item-frequency-plot}{% +\section{Support Count (Item Frequencies) and Item Frequency Plot}\label{support-count-item-frequencies-and-item-frequency-plot}} + +We can check the support count (\(freq(A)\)) for the top 25 products with the following R code: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{itemSupportCount =}\StringTok{ }\KeywordTok{itemFrequency}\NormalTok{(Groceries, }\DataTypeTok{type =} \StringTok{"absolute"}\NormalTok{) }\CommentTok{# obtain the counts for individual items} +\NormalTok{itemSupportCount =}\StringTok{ }\KeywordTok{sort}\NormalTok{(itemSupportCount, }\DataTypeTok{decreasing =} \OtherTok{TRUE}\NormalTok{) }\CommentTok{# sort the counts in descending order} +\KeywordTok{head}\NormalTok{(itemSupportCount, }\DecValTok{25}\NormalTok{) }\CommentTok{# check the support count for the top 25 items} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## whole milk other vegetables rolls/buns +## 2513 1903 1809 +## soda yogurt bottled water +## 1715 1372 1087 +## root vegetables tropical fruit shopping bags +## 1072 1032 969 +## sausage pastry citrus fruit +## 924 875 814 +## bottled beer newspapers canned beer +## 792 785 764 +## pip fruit fruit/vegetable juice whipped/sour cream +## 744 711 705 +## brown bread domestic eggs frankfurter +## 638 624 580 +## margarine coffee pork +## 576 571 567 +## butter +## 545 +\end{verbatim} + +We can also plot the support count, it is possible to change the colours of the bars as well. + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{itemFrequencyPlot}\NormalTok{(Groceries, }\DataTypeTok{topN =} \DecValTok{25}\NormalTok{, }\DataTypeTok{type=}\StringTok{"absolute"}\NormalTok{)} +\end{Highlighting} +\end{Shaded} + +\includegraphics{Unsupervised-Learning_files/figure-latex/unnamed-chunk-6-1.pdf} + +We can see that top purchased product is \{whole milk\} and it appears in 2513 transactions out of 9835. Therefore the support count for \{whole milk\} is 2513. + +\hypertarget{support}{% +\section{Support}\label{support}} + +Remember the support (\(S(A)\)) is calculated as follows: + +\[S(A)=\frac{\texttt{freq({A})}}{n}\] +The support for \{whole milk\} would be + +\[S(\texttt{{whole milk}})=\frac{\texttt{freq({whole milk})}}{n}=\frac{2513}{9835}=25.55\%\] + +It is possible to obtain this information with the same code as shown previously by simply replacing \(\texttt{type="absolute"}\) with the \(\texttt{type="relative"}\) option: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{itemSupport =}\StringTok{ }\KeywordTok{itemFrequency}\NormalTok{(Groceries, }\DataTypeTok{type =} \StringTok{"relative"}\NormalTok{) }\CommentTok{# obtain the counts for individual items} +\NormalTok{itemSupport =}\StringTok{ }\KeywordTok{sort}\NormalTok{(itemSupport, }\DataTypeTok{decreasing =} \OtherTok{TRUE}\NormalTok{) }\CommentTok{# sort the counts in descending order} +\KeywordTok{head}\NormalTok{(itemSupport, }\DecValTok{25}\NormalTok{) }\CommentTok{# check the support count for the top 25 items} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## whole milk other vegetables rolls/buns +## 0.25551601 0.19349263 0.18393493 +## soda yogurt bottled water +## 0.17437722 0.13950178 0.11052364 +## root vegetables tropical fruit shopping bags +## 0.10899847 0.10493137 0.09852567 +## sausage pastry citrus fruit +## 0.09395018 0.08896797 0.08276563 +## bottled beer newspapers canned beer +## 0.08052872 0.07981698 0.07768175 +## pip fruit fruit/vegetable juice whipped/sour cream +## 0.07564820 0.07229283 0.07168277 +## brown bread domestic eggs frankfurter +## 0.06487036 0.06344687 0.05897306 +## margarine coffee pork +## 0.05856634 0.05805796 0.05765125 +## butter +## 0.05541434 +\end{verbatim} + +We can also plot the support. + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{itemFrequencyPlot}\NormalTok{(Groceries, }\DataTypeTok{topN =} \DecValTok{25}\NormalTok{, }\DataTypeTok{type=}\StringTok{"relative"}\NormalTok{)} +\end{Highlighting} +\end{Shaded} + +\includegraphics{Unsupervised-Learning_files/figure-latex/unnamed-chunk-8-1.pdf} + +Note that the maximum support is low. To ensure that the top 25 frequent items are included in the analysis the minimum support would have to be less than 0.10! (\(10\%\)) Suppose we set the minimum support to 0.001 and minimum confidence to 0.8. We can mine some rules by executing the following R code: + +\hypertarget{rule-generation-with-apriori-algorithm}{% +\section{Rule Generation with Apriori Algorithm}\label{rule-generation-with-apriori-algorithm}} + +\begin{itemize} +\item + We are going to use the Apriori algorithm within the \(\texttt{arules}\) library to mine frequent itemsets and association rules.. +\item + Assume that we want to generate all the rules that satisfy the support threshold of \(0.1\%\) and confidence threshold of \(80\%\), then we need to enter \(\texttt{supp=0.001}\) and \(\texttt{conf=0.8}\) values in the \(\texttt{apriori()}\) function. If you want stronger rules, you can increase the value of \(\texttt{conf}\) and for more extended rules give higher value to \(\texttt{maxlen}\). +\item + It might be desirable to sort the rules according either confidence or support, here we chose sorting according to confidence in a descending manner. +\item + Finally we can examine the rules using \(\texttt{summary()}\) function. +\end{itemize} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{rules <-}\StringTok{ }\KeywordTok{apriori}\NormalTok{(Groceries, }\DataTypeTok{parameter =} \KeywordTok{list}\NormalTok{(}\DataTypeTok{supp=}\FloatTok{0.001}\NormalTok{, }\DataTypeTok{conf=}\FloatTok{0.8}\NormalTok{))} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## Apriori +## +## Parameter specification: +## confidence minval smax arem aval originalSupport maxtime support minlen +## 0.8 0.1 1 none FALSE TRUE 5 0.001 1 +## maxlen target ext +## 10 rules TRUE +## +## Algorithmic control: +## filter tree heap memopt load sort verbose +## 0.1 TRUE TRUE FALSE TRUE 2 TRUE +## +## Absolute minimum support count: 9 +## +## set item appearances ...[0 item(s)] done [0.00s]. +## set transactions ...[169 item(s), 9835 transaction(s)] done [0.03s]. +## sorting and recoding items ... [157 item(s)] done [0.00s]. +## creating transaction tree ... done [0.00s]. +## checking subsets of size 1 2 3 4 5 6 done [0.02s]. +## writing ... [410 rule(s)] done [0.00s]. +## creating S4 object ... done [0.00s]. +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{rules <-}\StringTok{ }\KeywordTok{sort}\NormalTok{(rules, }\DataTypeTok{by=}\StringTok{'confidence'}\NormalTok{, }\DataTypeTok{decreasing =} \OtherTok{TRUE}\NormalTok{)} +\KeywordTok{summary}\NormalTok{(rules)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## set of 410 rules +## +## rule length distribution (lhs + rhs):sizes +## 3 4 5 6 +## 29 229 140 12 +## +## Min. 1st Qu. Median Mean 3rd Qu. Max. +## 3.000 4.000 4.000 4.329 5.000 6.000 +## +## summary of quality measures: +## support confidence coverage lift +## Min. :0.001017 Min. :0.8000 Min. :0.001017 Min. : 3.131 +## 1st Qu.:0.001017 1st Qu.:0.8333 1st Qu.:0.001220 1st Qu.: 3.312 +## Median :0.001220 Median :0.8462 Median :0.001322 Median : 3.588 +## Mean :0.001247 Mean :0.8663 Mean :0.001449 Mean : 3.951 +## 3rd Qu.:0.001322 3rd Qu.:0.9091 3rd Qu.:0.001627 3rd Qu.: 4.341 +## Max. :0.003152 Max. :1.0000 Max. :0.003559 Max. :11.235 +## count +## Min. :10.00 +## 1st Qu.:10.00 +## Median :12.00 +## Mean :12.27 +## 3rd Qu.:13.00 +## Max. :31.00 +## +## mining info: +## data ntransactions support confidence +## Groceries 9835 0.001 0.8 +\end{verbatim} + +In this output we are provided with the following information: + +\begin{itemize} +\tightlist +\item + There are 410 rules based on 0.001 support and 0.8 confidence thresholds. +\item + The distribution of the number of items in each rule (rule length distribution): Most rules are 4 items long. +\end{itemize} + +We need use the \(\texttt{inspect()}\) function to see the actual rules. + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{inspect}\NormalTok{(rules[}\DecValTok{1}\OperatorTok{:}\DecValTok{5}\NormalTok{])} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## lhs rhs support confidence coverage lift count +## [1] {rice, +## sugar} => {whole milk} 0.001220132 1 0.001220132 3.913649 12 +## [2] {canned fish, +## hygiene articles} => {whole milk} 0.001118454 1 0.001118454 3.913649 11 +## [3] {root vegetables, +## butter, +## rice} => {whole milk} 0.001016777 1 0.001016777 3.913649 10 +## [4] {root vegetables, +## whipped/sour cream, +## flour} => {whole milk} 0.001728521 1 0.001728521 3.913649 17 +## [5] {butter, +## soft cheese, +## domestic eggs} => {whole milk} 0.001016777 1 0.001016777 3.913649 10 +\end{verbatim} + +If we look at the confidence we see that for the top 5 rules it is \(1\), this indicates \(100\%\) confidence: + +\begin{itemize} +\item + \(100\%\) customers who bought ``\{rice, sugar\}'' end up buying ``\{whole milk\}'' as well. +\item + \(100\%\) customers who bought ``\{canned fish, hygiene articles\}'' end up buying ``\{whole milk\}'' as well. +\end{itemize} + +In the following section we will look at visualizing the rules. + +\hypertarget{visualisation-of-the-rules}{% +\subsection{Visualisation of the Rules}\label{visualisation-of-the-rules}} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{topRules <-}\StringTok{ }\NormalTok{rules[}\DecValTok{1}\OperatorTok{:}\DecValTok{10}\NormalTok{]} +\KeywordTok{plot}\NormalTok{(topRules)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter. +\end{verbatim} + +\includegraphics{Unsupervised-Learning_files/figure-latex/unnamed-chunk-11-1.pdf} + +The scatter plot of support and confidence of the top ten rules shows us that high confidence rules have low support values. + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{plot}\NormalTok{(rules)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter. +\end{verbatim} + +\includegraphics{Unsupervised-Learning_files/figure-latex/unnamed-chunk-12-1.pdf} + +In the following section we will look at removing redundant rules. + +\hypertarget{removing-redundant-rules}{% +\subsection{Removing redundant rules}\label{removing-redundant-rules}} + +You may want to remove rules that are subsets of larger rules. Use the code below to remove such rules: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{subset.rules <-}\StringTok{ }\KeywordTok{which}\NormalTok{(}\KeywordTok{colSums}\NormalTok{(}\KeywordTok{is.subset}\NormalTok{(rules, rules)) }\OperatorTok{>}\StringTok{ }\DecValTok{1}\NormalTok{) }\CommentTok{# get subset rules in vector} +\CommentTok{# is.subset() determines if elements of one vector contain all the elements of other} +\KeywordTok{length}\NormalTok{(subset.rules)} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## [1] 91 +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{subset.rules <-}\StringTok{ }\NormalTok{rules[}\OperatorTok{-}\NormalTok{subset.rules] }\CommentTok{# remove subset rules.} +\end{Highlighting} +\end{Shaded} + +\hypertarget{finding-rules-related-to-given-items}{% +\subsection{Finding rules related to given items}\label{finding-rules-related-to-given-items}} + +In the case of specific product in interest, either as a precedent (LHS) or as a consequent (RHS) in the rule, you need to set the ``\(\texttt{appearance=}\)'' parameter in the apriori rule generating function: + +Let us say we are interested in those transactions that end up in buying ``root vegetables'': + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{rveg.rules <-}\StringTok{ }\KeywordTok{apriori}\NormalTok{(Groceries, }\DataTypeTok{parameter =} \KeywordTok{list}\NormalTok{(}\DataTypeTok{supp=}\FloatTok{0.001}\NormalTok{, }\DataTypeTok{conf=}\FloatTok{0.8}\NormalTok{),}\DataTypeTok{appearance =} \KeywordTok{list}\NormalTok{(}\DataTypeTok{default=}\StringTok{"lhs"}\NormalTok{,}\DataTypeTok{rhs=}\StringTok{"root vegetables"}\NormalTok{))} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## Apriori +## +## Parameter specification: +## confidence minval smax arem aval originalSupport maxtime support minlen +## 0.8 0.1 1 none FALSE TRUE 5 0.001 1 +## maxlen target ext +## 10 rules TRUE +## +## Algorithmic control: +## filter tree heap memopt load sort verbose +## 0.1 TRUE TRUE FALSE TRUE 2 TRUE +## +## Absolute minimum support count: 9 +## +## set item appearances ...[1 item(s)] done [0.00s]. +## set transactions ...[169 item(s), 9835 transaction(s)] done [0.01s]. +## sorting and recoding items ... [157 item(s)] done [0.00s]. +## creating transaction tree ... done [0.01s]. +## checking subsets of size 1 2 3 4 5 6 done [0.03s]. +## writing ... [5 rule(s)] done [0.00s]. +## creating S4 object ... done [0.00s]. +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{inspect}\NormalTok{(}\KeywordTok{head}\NormalTok{(rveg.rules))} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## lhs rhs support confidence coverage lift count +## [1] {other vegetables, +## whole milk, +## yogurt, +## rice} => {root vegetables} 0.001321810 0.8666667 0.001525165 7.951182 13 +## [2] {tropical fruit, +## other vegetables, +## whole milk, +## oil} => {root vegetables} 0.001321810 0.8666667 0.001525165 7.951182 13 +## [3] {beef, +## citrus fruit, +## tropical fruit, +## other vegetables} => {root vegetables} 0.001016777 0.8333333 0.001220132 7.645367 10 +## [4] {citrus fruit, +## other vegetables, +## soda, +## fruit/vegetable juice} => {root vegetables} 0.001016777 0.9090909 0.001118454 8.340400 10 +## [5] {tropical fruit, +## other vegetables, +## whole milk, +## yogurt, +## oil} => {root vegetables} 0.001016777 0.9090909 0.001118454 8.340400 10 +\end{verbatim} + +\hypertarget{using-your-own-dataset-stored-as-a-csv-file}{% +\section{Using your own dataset stored as a csv file}\label{using-your-own-dataset-stored-as-a-csv-file}} + +You might want to use a dataset from a csv file. The format of this file should be as follows: + +\begin{itemize} +\tightlist +\item + Transactions in the rows (remember in our small example, we had 5 transactions.) +\item + Items per transaction should be entered separately in different columns (items were A, B, C, D, E, and F) +\end{itemize} + +\begin{figure} +\centering +\includegraphics{example.png} +\caption{How the data looks like in csv format:} +\end{figure} + +\begin{itemize} +\tightlist +\item + The data should be extracted using the \(\texttt{read.transactions()}\) function. +\end{itemize} + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{slideExample <-}\StringTok{ }\KeywordTok{read.transactions}\NormalTok{(}\StringTok{'C:/Users/01438475/Google Drive/UCTcourses/Analytics/UnsupervisedLearning/Arules/example.csv'}\NormalTok{, }\DataTypeTok{format =} \StringTok{'basket'}\NormalTok{, }\DataTypeTok{sep=}\StringTok{','}\NormalTok{)} +\NormalTok{slideExample} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## transactions in sparse format with +## 5 transactions (rows) and +## 6 items (columns) +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{inspect}\NormalTok{(}\KeywordTok{head}\NormalTok{(slideExample, }\DecValTok{6}\NormalTok{))} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## items +## [1] {A,D} +## [2] {A,B,C,E} +## [3] {B,C,D,F} +## [4] {A,B,C,D} +## [5] {A,B,D,F} +\end{verbatim} + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{size}\NormalTok{(}\KeywordTok{head}\NormalTok{(slideExample))} +\end{Highlighting} +\end{Shaded} + +\begin{verbatim} +## [1] 2 4 4 4 4 +\end{verbatim} + +I will leave all the rest for you to obtain. + +\hypertarget{references}{% +\section{References:}\label{references}} + +\begin{itemize} +\tightlist +\item + \href{http://www.rdatamining.com/examples/association-rules}{R and Data Mining} +\item + \href{https://github.com/susanli2016/Data-Analysis-with-R/blob/master/Market_Basket_Analysis.Rmd}{Susan Li - MBA} +\item + \href{https://www.datacamp.com/community/tutorials/market-basket-analysis-r}{Datacamp} +\item + Dr Juwa Nyirenda's lecture notes +\end{itemize} + +\hypertarget{cluster-analysis}{% +\chapter{Cluster Analysis}\label{cluster-analysis}} + +For this section, please update your browser on the 13th of October Tuesday. + +\hypertarget{self-organising-maps}{% +\chapter{Self Organising Maps}\label{self-organising-maps}} + +For this section, please update your browser on the 20th of October Tuesday. + + \bibliography{book.bib,packages.bib} + +\end{document} diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-10-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-10-1.png new file mode 100644 index 0000000..8b5a42d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-11-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-11-1.png new file mode 100644 index 0000000..3a5a150 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-1.png new file mode 100644 index 0000000..31314ea Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-2.png new file mode 100644 index 0000000..5beb0f7 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-3.png new file mode 100644 index 0000000..788a1ed Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-12-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-13-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-13-1.png new file mode 100644 index 0000000..9752916 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-13-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-13-2.png new file mode 100644 index 0000000..dbb0f40 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-13-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-14-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-14-1.png new file mode 100644 index 0000000..22f9bcb Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-14-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-15-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-15-1.png new file mode 100644 index 0000000..0e01c24 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-15-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-16-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-16-1.png new file mode 100644 index 0000000..d916c79 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-16-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-16-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-16-2.png new file mode 100644 index 0000000..f4b247d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-16-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-17-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-17-1.png new file mode 100644 index 0000000..f212107 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-18-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-18-1.png new file mode 100644 index 0000000..e37953b Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-19-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-19-1.png new file mode 100644 index 0000000..d93ead1 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-19-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-24-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-24-1.png new file mode 100644 index 0000000..956cb9d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-24-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-25-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-25-1.png new file mode 100644 index 0000000..956cb9d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-25-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-26-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-26-1.png new file mode 100644 index 0000000..7bc745b Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-26-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-1.png new file mode 100644 index 0000000..4ce4cfe Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-2.png new file mode 100644 index 0000000..d9515b4 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-3.png new file mode 100644 index 0000000..22f5326 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-27-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-1.png new file mode 100644 index 0000000..eba9305 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-2.png new file mode 100644 index 0000000..d9515b4 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-3.png new file mode 100644 index 0000000..22f5326 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-28-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-1.png new file mode 100644 index 0000000..4ce4cfe Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-2.png new file mode 100644 index 0000000..d9515b4 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-3.png new file mode 100644 index 0000000..22f5326 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-29-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-30-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-30-1.png new file mode 100644 index 0000000..9e0aa47 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-30-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-31-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-31-1.png new file mode 100644 index 0000000..5a94688 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-31-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-31-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-31-2.png new file mode 100644 index 0000000..dbb0f40 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-31-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-32-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-32-1.png new file mode 100644 index 0000000..ca27d81 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-32-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-32-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-32-2.png new file mode 100644 index 0000000..dbb0f40 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-32-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-33-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-33-1.png new file mode 100644 index 0000000..ca89d56 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-33-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-33-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-33-2.png new file mode 100644 index 0000000..dbb0f40 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-33-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-34-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-34-1.png new file mode 100644 index 0000000..d916c79 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-34-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-34-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-34-2.png new file mode 100644 index 0000000..f4b247d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-34-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-35-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-35-1.png new file mode 100644 index 0000000..cc494bf Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-35-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-35-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-35-2.png new file mode 100644 index 0000000..f4b247d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-35-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-36-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-36-1.png new file mode 100644 index 0000000..54ed587 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-36-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-36-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-36-2.png new file mode 100644 index 0000000..f4b247d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-36-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-37-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-37-1.png new file mode 100644 index 0000000..6630dac Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-37-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-38-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-38-1.png new file mode 100644 index 0000000..1299c74 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-38-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-39-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-39-1.png new file mode 100644 index 0000000..44c5a01 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-39-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-4-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-4-1.png new file mode 100644 index 0000000..10b7344 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-40-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-40-1.png new file mode 100644 index 0000000..87724b6 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-40-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-41-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-41-1.png new file mode 100644 index 0000000..44c5a01 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-41-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-42-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-42-1.png new file mode 100644 index 0000000..e8f1149 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-42-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-43-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-43-1.png new file mode 100644 index 0000000..e8f1149 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-43-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-44-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-44-1.png new file mode 100644 index 0000000..e8f1149 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-44-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-45-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-45-1.png new file mode 100644 index 0000000..ffa3342 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-45-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-1.png new file mode 100644 index 0000000..21899b6 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-2.png new file mode 100644 index 0000000..5beb0f7 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-3.png new file mode 100644 index 0000000..788a1ed Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-46-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-47-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-47-1.png new file mode 100644 index 0000000..b60715c Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-47-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-48-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-48-1.png new file mode 100644 index 0000000..ffa3342 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-48-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-49-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-49-1.png new file mode 100644 index 0000000..5d02eb4 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-49-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-5-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..10b7344 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-50-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-50-1.png new file mode 100644 index 0000000..8860815 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-50-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-1.png new file mode 100644 index 0000000..5b0d113 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-2.png new file mode 100644 index 0000000..5beb0f7 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-3.png new file mode 100644 index 0000000..788a1ed Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-51-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-52-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-52-1.png new file mode 100644 index 0000000..8860815 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-52-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-53-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-53-1.png new file mode 100644 index 0000000..a38ce64 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-53-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-1.png new file mode 100644 index 0000000..d7e16ec Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-2.png new file mode 100644 index 0000000..5beb0f7 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-3.png new file mode 100644 index 0000000..788a1ed Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-54-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-1.png new file mode 100644 index 0000000..a38ce64 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-2.png new file mode 100644 index 0000000..5beb0f7 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-3.png new file mode 100644 index 0000000..788a1ed Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-55-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-1.png new file mode 100644 index 0000000..d7e16ec Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-2.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-2.png new file mode 100644 index 0000000..5beb0f7 Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-2.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-3.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-3.png new file mode 100644 index 0000000..788a1ed Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-56-3.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-6-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..1367cfd Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-7-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..1367cfd Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-8-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 0000000..8b5a42d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-9-1.png b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-9-1.png new file mode 100644 index 0000000..8b5a42d Binary files /dev/null and b/english/courses/analytics2020/Unsupervised-Learning_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/english/courses/analytics2020/a-visualisation-map-weights-onto-colors.html b/english/courses/analytics2020/a-visualisation-map-weights-onto-colors.html new file mode 100644 index 0000000..7b03163 --- /dev/null +++ b/english/courses/analytics2020/a-visualisation-map-weights-onto-colors.html @@ -0,0 +1,332 @@ + + + + + + + Chapter 5 A. Visualisation - Map Weights onto Colors | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      +
      +

      Chapter 5 A. Visualisation - Map Weights onto Colors

      +
      +

      5.1 Vis - 1) Training Process

      +

      As the SOM training iterations progress, the distance from each node’s weights to the samples represented by that node is reduced. Ideally, this distance should reach a minimum plateau. +This plot option shows the progress over time. +If the curve is continually decreasing, more iterations are required.

      +
      plot(som_model, type="changes")
      +

      +
      +
      +

      5.2 Vis - 2) Node Counts

      +

      The Kohonen packages allows us to visualise the count of how many samples are mapped to each node on the map. +This metric can be used as a measure of map quality - ideally the sample distribution is relatively uniform. +Large values in some map areas suggests that a larger map would be benificial. +Empty nodes indicate that your map size is too big for the number of samples. +Aim for at least 5-10 samples per node when choosing map size.

      +
      plot(som_model, type="counts")
      +

      +
      +
      +

      5.3 Vis - 3) Neighbour Distance

      +
      plot(som_model, type="dist.neighbours")
      +

      +
      +
      +

      5.4 Vis - 4) Codes / Weight vectors

      +
      plot(som_model, type="codes")
      +

      +
      +
      +

      5.5 Vis - 5) Heatmaps

      +
      a=som_model$codes[[1]]
      +par(mfrow=c(4,4))
      +for(i in 2:17){
      +plot(som_model, type = "property", property = a[,i-1], main=names(animals)[i])
      +}
      +

      +
      dev.off()
      +
      ## null device 
      +##           1
      +
      +
      +

      5.6 B. Clustering

      +
      data <- som_model$codes[[1]]
      +wss <- (nrow(data)-1)*sum(apply(data,2,var)) 
      +for (i in 2:15) {
      +  wss[i] <- sum(kmeans(data, centers=i)$withinss)
      +}
      +plot(wss)
      +

      +
      +
      +

      5.7 use hierarchical clustering to cluster the codebook vectors

      +
      som_cluster <- cutree(hclust(dist(som_model$codes[[1]])), 7)
      +
      +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/applications.html b/english/courses/analytics2020/applications.html new file mode 100644 index 0000000..8bba686 --- /dev/null +++ b/english/courses/analytics2020/applications.html @@ -0,0 +1,250 @@ + + + + + + + Chapter 5 Applications | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      +
      +

      Chapter 5 Applications

      +

      Some significant applications are demonstrated in this chapter.

      +
      +

      5.1 Example one

      +
      +
      +

      5.2 Example two

      + +
      +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/association-rules.html b/english/courses/analytics2020/association-rules.html new file mode 100644 index 0000000..6044e4d --- /dev/null +++ b/english/courses/analytics2020/association-rules.html @@ -0,0 +1,574 @@ + + + + + + + Chapter 2 Association Rules | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      +
      +

      Chapter 2 Association Rules

      +
      +

      2.1 Prerequisites

      +

      You need to have the following R packages installed and recalled into your library:

      +
      library(datasets)
      +library(grid)
      +library(tidyverse)
      +library(readxl)
      +library(knitr)
      +library(ggplot2)
      +library(lubridate)
      +library(arules)
      +library(arulesViz)
      +library(plyr)
      +
      +
      +

      2.2 The Groceries Dataset

      +

      We shall mine Groceries dataset for association rules using the Apriori Algorithm. The Groceries dataset can be loaded from R. The steps for doing so are shown below. Note that you will only be able to load the data set once the package arules has been loaded into R. The Groceries dataset contains a collection of receipts with each line representing 1 receipt and the items purchased. Each line is called a transaction and each column in a row represents an item.

      +
      data(Groceries)
      +summary(Groceries)
      +
      ## transactions as itemMatrix in sparse format with
      +##  9835 rows (elements/itemsets/transactions) and
      +##  169 columns (items) and a density of 0.02609146 
      +## 
      +## most frequent items:
      +##       whole milk other vegetables       rolls/buns             soda 
      +##             2513             1903             1809             1715 
      +##           yogurt          (Other) 
      +##             1372            34055 
      +## 
      +## element (itemset/transaction) length distribution:
      +## sizes
      +##    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16 
      +## 2159 1643 1299 1005  855  645  545  438  350  246  182  117   78   77   55   46 
      +##   17   18   19   20   21   22   23   24   26   27   28   29   32 
      +##   29   14   14    9   11    4    6    1    1    1    1    3    1 
      +## 
      +##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      +##   1.000   2.000   3.000   4.409   6.000  32.000 
      +## 
      +## includes extended item information - examples:
      +##        labels  level2           level1
      +## 1 frankfurter sausage meat and sausage
      +## 2     sausage sausage meat and sausage
      +## 3  liver loaf sausage meat and sausage
      +

      As you can see, the data is in “transactions” format with a density of 0.0261 (check slides to remember what this value means). There are 9835 transactions with 169 distinct items that can be bought in this database (\(D\)).

      +

      The summary function also provides the distribution of number items per transaction and the most popular items.

      +

      Now let us examine the first 3 transactions in \(D\).

      +
      inspect(head(Groceries, 3))
      +
      ##     items                
      +## [1] {citrus fruit,       
      +##      semi-finished bread,
      +##      margarine,          
      +##      ready soups}        
      +## [2] {tropical fruit,     
      +##      yogurt,             
      +##      coffee}             
      +## [3] {whole milk}
      +

      The first customer bought {citrus fruit,semi-finished bread,margarine,ready soups}, whereas the third customer bought only {whole milk}.

      +

      We can also find how many items each transaction contains, for the first 10 transactions:

      +
      head(size(Groceries), 10)
      +
      ##  [1] 4 3 1 4 4 5 1 5 1 2
      +
      hist(size(Groceries), main = "Distribution of the number of items purchased", xlab = "Number of items", ylab="Number of Transactions")
      +

      +

      As it is clear, the distribution of the number of items is skewed to right, clearly most transactions inlcude fewer number of items, only very few have more than 10 items purchased together.

      +
      +
      +

      2.3 Support Count (Item Frequencies) and Item Frequency Plot

      +

      We can check the support count (\(freq(A)\)) for the top 25 products with the following R code:

      +
      itemSupportCount = itemFrequency(Groceries, type = "absolute") # obtain the counts for individual items
      +itemSupportCount = sort(itemSupportCount, decreasing = TRUE) # sort the counts in descending order
      +head(itemSupportCount, 25) # check the support count for the top 25 items
      +
      ##            whole milk      other vegetables            rolls/buns 
      +##                  2513                  1903                  1809 
      +##                  soda                yogurt         bottled water 
      +##                  1715                  1372                  1087 
      +##       root vegetables        tropical fruit         shopping bags 
      +##                  1072                  1032                   969 
      +##               sausage                pastry          citrus fruit 
      +##                   924                   875                   814 
      +##          bottled beer            newspapers           canned beer 
      +##                   792                   785                   764 
      +##             pip fruit fruit/vegetable juice    whipped/sour cream 
      +##                   744                   711                   705 
      +##           brown bread         domestic eggs           frankfurter 
      +##                   638                   624                   580 
      +##             margarine                coffee                  pork 
      +##                   576                   571                   567 
      +##                butter 
      +##                   545
      +

      We can also plot the support count, it is possible to change the colours of the bars as well.

      +
      itemFrequencyPlot(Groceries, topN = 25, type="absolute")
      +

      +

      We can see that top purchased product is {whole milk} and it appears in 2513 transactions out of 9835. Therefore the support count for {whole milk} is 2513.

      +
      +
      +

      2.4 Support

      +

      Remember the support (\(S(A)\)) is calculated as follows:

      +

      \[S(A)=\frac{\texttt{freq({A})}}{n}\] +The support for {whole milk} would be

      +

      \[S(\texttt{{whole milk}})=\frac{\texttt{freq({whole milk})}}{n}=\frac{2513}{9835}=25.55\%\]

      +

      It is possible to obtain this information with the same code as shown previously by simply replacing \(\texttt{type="absolute"}\) with the \(\texttt{type="relative"}\) option:

      +
      itemSupport = itemFrequency(Groceries, type = "relative") # obtain the counts for individual items
      +itemSupport = sort(itemSupport, decreasing = TRUE) # sort the counts in descending order
      +head(itemSupport, 25) # check the support count for the top 25 items
      +
      ##            whole milk      other vegetables            rolls/buns 
      +##            0.25551601            0.19349263            0.18393493 
      +##                  soda                yogurt         bottled water 
      +##            0.17437722            0.13950178            0.11052364 
      +##       root vegetables        tropical fruit         shopping bags 
      +##            0.10899847            0.10493137            0.09852567 
      +##               sausage                pastry          citrus fruit 
      +##            0.09395018            0.08896797            0.08276563 
      +##          bottled beer            newspapers           canned beer 
      +##            0.08052872            0.07981698            0.07768175 
      +##             pip fruit fruit/vegetable juice    whipped/sour cream 
      +##            0.07564820            0.07229283            0.07168277 
      +##           brown bread         domestic eggs           frankfurter 
      +##            0.06487036            0.06344687            0.05897306 
      +##             margarine                coffee                  pork 
      +##            0.05856634            0.05805796            0.05765125 
      +##                butter 
      +##            0.05541434
      +

      We can also plot the support.

      +
      itemFrequencyPlot(Groceries, topN = 25, type="relative")
      +

      +

      Note that the maximum support is low. To ensure that the top 25 frequent items are included in the analysis the minimum support would have to be less than 0.10! (\(10\%\)) Suppose we set the minimum support to 0.001 and minimum confidence to 0.8. We can mine some rules by executing the following R code:

      +
      +
      +

      2.5 Rule Generation with Apriori Algorithm

      +
        +
      • We are going to use the Apriori algorithm within the \(\texttt{arules}\) library to mine frequent itemsets and association rules..

      • +
      • Assume that we want to generate all the rules that satisfy the support threshold of \(0.1\%\) and confidence threshold of \(80\%\), then we need to enter \(\texttt{supp=0.001}\) and \(\texttt{conf=0.8}\) values in the \(\texttt{apriori()}\) function. If you want stronger rules, you can increase the value of \(\texttt{conf}\) and for more extended rules give higher value to \(\texttt{maxlen}\).

      • +
      • It might be desirable to sort the rules according either confidence or support, here we chose sorting according to confidence in a descending manner.

      • +
      • Finally we can examine the rules using \(\texttt{summary()}\) function.

      • +
      +
      rules <- apriori(Groceries, parameter = list(supp=0.001, conf=0.8))
      +
      ## Apriori
      +## 
      +## Parameter specification:
      +##  confidence minval smax arem  aval originalSupport maxtime support minlen
      +##         0.8    0.1    1 none FALSE            TRUE       5   0.001      1
      +##  maxlen target  ext
      +##      10  rules TRUE
      +## 
      +## Algorithmic control:
      +##  filter tree heap memopt load sort verbose
      +##     0.1 TRUE TRUE  FALSE TRUE    2    TRUE
      +## 
      +## Absolute minimum support count: 9 
      +## 
      +## set item appearances ...[0 item(s)] done [0.00s].
      +## set transactions ...[169 item(s), 9835 transaction(s)] done [0.00s].
      +## sorting and recoding items ... [157 item(s)] done [0.00s].
      +## creating transaction tree ... done [0.00s].
      +## checking subsets of size 1 2 3 4 5 6 done [0.01s].
      +## writing ... [410 rule(s)] done [0.00s].
      +## creating S4 object  ... done [0.00s].
      +
      rules <- sort(rules, by='confidence', decreasing = TRUE)
      +summary(rules)
      +
      ## set of 410 rules
      +## 
      +## rule length distribution (lhs + rhs):sizes
      +##   3   4   5   6 
      +##  29 229 140  12 
      +## 
      +##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      +##   3.000   4.000   4.000   4.329   5.000   6.000 
      +## 
      +## summary of quality measures:
      +##     support           confidence        coverage             lift       
      +##  Min.   :0.001017   Min.   :0.8000   Min.   :0.001017   Min.   : 3.131  
      +##  1st Qu.:0.001017   1st Qu.:0.8333   1st Qu.:0.001220   1st Qu.: 3.312  
      +##  Median :0.001220   Median :0.8462   Median :0.001322   Median : 3.588  
      +##  Mean   :0.001247   Mean   :0.8663   Mean   :0.001449   Mean   : 3.951  
      +##  3rd Qu.:0.001322   3rd Qu.:0.9091   3rd Qu.:0.001627   3rd Qu.: 4.341  
      +##  Max.   :0.003152   Max.   :1.0000   Max.   :0.003559   Max.   :11.235  
      +##      count      
      +##  Min.   :10.00  
      +##  1st Qu.:10.00  
      +##  Median :12.00  
      +##  Mean   :12.27  
      +##  3rd Qu.:13.00  
      +##  Max.   :31.00  
      +## 
      +## mining info:
      +##       data ntransactions support confidence
      +##  Groceries          9835   0.001        0.8
      +

      In this output we are provided with the following information:

      +
        +
      • There are 410 rules based on 0.001 support and 0.8 confidence thresholds.
      • +
      • The distribution of the number of items in each rule (rule length distribution): Most rules are 4 items long.
      • +
      +

      We need use the \(\texttt{inspect()}\) function to see the actual rules.

      +
      inspect(rules[1:5])
      +
      ##     lhs                     rhs              support confidence    coverage     lift count
      +## [1] {rice,                                                                                
      +##      sugar}              => {whole milk} 0.001220132          1 0.001220132 3.913649    12
      +## [2] {canned fish,                                                                         
      +##      hygiene articles}   => {whole milk} 0.001118454          1 0.001118454 3.913649    11
      +## [3] {root vegetables,                                                                     
      +##      butter,                                                                              
      +##      rice}               => {whole milk} 0.001016777          1 0.001016777 3.913649    10
      +## [4] {root vegetables,                                                                     
      +##      whipped/sour cream,                                                                  
      +##      flour}              => {whole milk} 0.001728521          1 0.001728521 3.913649    17
      +## [5] {butter,                                                                              
      +##      soft cheese,                                                                         
      +##      domestic eggs}      => {whole milk} 0.001016777          1 0.001016777 3.913649    10
      +

      If we look at the confidence we see that for the top 5 rules it is \(1\), this indicates \(100\%\) confidence:

      +
        +
      • \(100\%\) customers who bought “{rice, sugar}” end up buying “{whole milk}” as well.

      • +
      • \(100\%\) customers who bought “{canned fish, hygiene articles}” end up buying “{whole milk}” as well.

      • +
      +

      In the following section we will look at visualizing the rules.

      +
      +

      2.5.1 Visualisation of the Rules

      +
      topRules <- rules[1:10]
      +plot(topRules)
      +
      ## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.
      +

      +

      The scatter plot of support and confidence of the top ten rules shows us that high confidence rules have low support values.

      +
      plot(rules)
      +
      ## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.
      +

      +

      In the following section we will look at removing redundant rules.

      +
      +
      +

      2.5.2 Removing redundant rules

      +

      You may want to remove rules that are subsets of larger rules. Use the code below to remove such rules:

      +
      subset.rules <- which(colSums(is.subset(rules, rules)) > 1) # get subset rules in vector
      +# is.subset() determines if elements of one vector contain all the elements of other
      +length(subset.rules)
      +
      ## [1] 91
      +
      subset.rules <- rules[-subset.rules] # remove subset rules.
      +
      + +
      +
      +

      2.6 Using your own dataset stored as a csv file

      +

      You might want to use a dataset from a csv file. The format of this file should be as follows:

      +
        +
      • Transactions in the rows (remember in our small example, we had 5 transactions.)
      • +
      • Items per transaction should be entered separately in different columns (items were A, B, C, D, E, and F)
      • +
      +
      + +

      How the data looks like in csv format:

      +
      +
        +
      • The data should be extracted using the \(\texttt{read.transactions()}\) function.
      • +
      +
      slideExample <- read.transactions('C:/Users/01438475/Google Drive/UCTcourses/Analytics/UnsupervisedLearning/Arules/example.csv', format = 'basket', sep=',')
      +slideExample
      +
      ## transactions in sparse format with
      +##  5 transactions (rows) and
      +##  6 items (columns)
      +
      inspect(head(slideExample, 6))
      +
      ##     items    
      +## [1] {A,D}    
      +## [2] {A,B,C,E}
      +## [3] {B,C,D,F}
      +## [4] {A,B,C,D}
      +## [5] {A,B,D,F}
      +
      size(head(slideExample))
      +
      ## [1] 2 4 4 4 4
      +

      I will leave all the rest for you to obtain.

      +
      +
      +

      2.7 References:

      + + +
      +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/nice-fig-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/nice-fig-1.png new file mode 100644 index 0000000..344323b Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/nice-fig-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-14-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-14-1.png new file mode 100644 index 0000000..80ef7eb Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-14-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-17-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-17-1.png new file mode 100644 index 0000000..92597bc Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-18-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-18-1.png new file mode 100644 index 0000000..fb6cae2 Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-19-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-19-1.png new file mode 100644 index 0000000..d93ead1 Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-19-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-7-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-7-1.png new file mode 100644 index 0000000..b436caa Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-8-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-8-1.png new file mode 100644 index 0000000..4ac4716 Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-9-1.png b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-9-1.png new file mode 100644 index 0000000..3674e41 Binary files /dev/null and b/english/courses/analytics2020/bookdown-demo_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/english/courses/analytics2020/cluster-analysis.html b/english/courses/analytics2020/cluster-analysis.html new file mode 100644 index 0000000..c416de0 --- /dev/null +++ b/english/courses/analytics2020/cluster-analysis.html @@ -0,0 +1,250 @@ + + + + + + + Chapter 3 Cluster Analysis | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/compute-pairewise-distance-matrices.html b/english/courses/analytics2020/compute-pairewise-distance-matrices.html new file mode 100644 index 0000000..acea3c7 --- /dev/null +++ b/english/courses/analytics2020/compute-pairewise-distance-matrices.html @@ -0,0 +1,390 @@ + + + + + + + Chapter 4 Compute pairewise distance matrices | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      +
      +

      Chapter 4 Compute pairewise distance matrices

      +
      dist.out <- dist(df, method = "euclidean")
      +
      +

      4.0.1 Single Linkage

      +
      +
      +

      4.0.2 Complete Linkage

      +
      hc <- hclust(dist.out, method = "complete")
      +

      Visualization of hclust

      +
      plot(hc, labels = F,-1)
      +rect.hclust(hc, k = 2, border = 2:3) # Add rectangle around 3 groups
      +

      +
      +
      +

      4.0.3 Centroid

      +
      +
      +

      4.1 Methods for determining number of clusters

      +
      +

      4.1.1 Elbow method for k-means clustering

      +
      set.seed(123)
      +# Compute and plot wss for k = 2 to k = 15
      +k.max <- 15 # Maximal number of clusters
      +df.out <- df
      +wss <- sapply(1:k.max,
      +function(k){kmeans(df.out, k, nstart=10 )$tot.withinss})
      +plot(1:k.max, wss, type="b", pch = 19, frame = FALSE, xlab="Number of clusters K", ylab="Total within-clusters sum of squares")
      +abline(v = 3, lty =2)
      +

      +

      According to the elbow method, the optimal number of clusters suggested for the K-means algorithm is 3.

      +
      +
      +

      4.1.2 Average silhouette method for k-means clustering

      +
      k.max <- 15
      +data.out <- df
      +sil <- rep(0, k.max)
      +# Compute the average silhouette width for
      +# k = 2 to k = 15
      +for(i in 2:k.max){
      +km.res <- kmeans(df.out, centers = i, nstart = 25)
      +ss <- silhouette(km.res$cluster, dist(df.out))
      +sil[i] <- mean(ss[, 3])
      +}
      +
      # Plot the average silhouette width
      +plot(1:k.max, sil, type = "b", pch = 19,
      +frame = FALSE, xlab = "Number of clusters k")
      +abline(v = which.max(sil), lty = 2)
      +

      +

      According to the silhouette method the optimal number of clusters suggested for the Kmeans algorithm is 2.

      +
      +
      +

      4.1.3 Average silhouette method for PAM clustering

      +
      #clusplot(pam.out, main = "Cluster plot, k = 2", color = TRUE)
      +plot(pam.out)
      +

      +

      These two components explain 86.75% of the point variability.

      +

      This table shows how to use the average silhouette width value:

      +

      Range of SC : Interpretation +0.71-1.0 : A strong structure has been found +0.51-0.70 : A reasonable structure has been found +0.26-0.50 : The structure is weak and could be artificial +< 0.25 : No substantial structure has been found

      +

      According to the table, the fit is weak.

      +
      +
      +

      4.1.4 Average silhouette method for hierarchical clustering

      +
      plot(silhouette(cutree(hc,2),dist.out))
      +

      +

      Average silhouette width : 0.4

      +

      This table shows how to use the average silhouette width value:

      +

      Range of SC: Interpretation +0.71-1.0 : A strong structure has been found +0.51-0.70 : A reasonable structure has been found +0.26-0.50 : The structure is weak and could be artificial +< 0.25 : No substantial structure has been found

      +

      The result for hierarchical clustering is similar to that of PAM. The conclusion we can make is that fit is weak.

      +
      +
      +

      4.1.5 Gap Statistic for K means clustering

      +
      # Compute gap statistic
      +gap_stat <- clusGap(df, FUN = kmeans, nstart = 25, K.max = 10, B = 50)
      +# Print the result
      +plot(gap_stat, frame = FALSE, xlab = "Number of clusters k")
      +abline(v = 4, lty = 2)
      +

      +

      According to the Gap Statistic the ’optimal number of clusters chosen for the Kmeans algorithm is 4!

      +

      Using the NbClust package which uses a vote to chose the number of clusters. +The following example determine the number of clusters using all statistics:

      +
      res.nb <- NbClust(df, distance = "euclidean",min.nc = 2, max.nc
      += 10, method = "complete", index ="all")
      +

      +
      ## *** : The Hubert index is a graphical method of determining the number of clusters.
      +##                 In the plot of Hubert index, we seek a significant knee that corresponds to a 
      +##                 significant increase of the value of the measure i.e the significant peak in Hubert
      +##                 index second differences plot. 
      +## 
      +

      +
      ## *** : The D index is a graphical method of determining the number of clusters. 
      +##                 In the plot of D index, we seek a significant knee (the significant peak in Dindex
      +##                 second differences plot) that corresponds to a significant increase of the value of
      +##                 the measure. 
      +##  
      +## ******************************************************************* 
      +## * Among all indices:                                                
      +## * 9 proposed 2 as the best number of clusters 
      +## * 4 proposed 3 as the best number of clusters 
      +## * 6 proposed 4 as the best number of clusters 
      +## * 2 proposed 5 as the best number of clusters 
      +## * 1 proposed 8 as the best number of clusters 
      +## * 1 proposed 10 as the best number of clusters 
      +## 
      +##                    ***** Conclusion *****                            
      +##  
      +## * According to the majority rule, the best number of clusters is  2 
      +##  
      +##  
      +## *******************************************************************
      +

      When all statistics in the NbClust package are allowed to vote, the majority (in this case 9 out of 23) propose +that the ‘optimal’ number of clusters should be 2.

      +
      +
      +
      +

      4.2 Clustering with CLARA.

      + +
      +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/example.png b/english/courses/analytics2020/example.png new file mode 100644 index 0000000..8ff2711 Binary files /dev/null and b/english/courses/analytics2020/example.png differ diff --git a/english/courses/analytics2020/final-words.html b/english/courses/analytics2020/final-words.html new file mode 100644 index 0000000..050e27b --- /dev/null +++ b/english/courses/analytics2020/final-words.html @@ -0,0 +1,244 @@ + + + + + + + Chapter 6 Final Words | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      +
      +

      Chapter 6 Final Words

      +

      We have finished a nice book.

      + +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/index.html b/english/courses/analytics2020/index.html new file mode 100644 index 0000000..58fd285 --- /dev/null +++ b/english/courses/analytics2020/index.html @@ -0,0 +1,261 @@ + + + + + + + Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      + +
      +

      Chapter 1 Introduction

      +

      This book will guide you through the R codes for the following Unsupervised Learning methods:

      +
        +
      • Association Rules
      • +
      • Cluster Analysis
      • +
      • Self Organising Maps
      • +
      +

      The chapters will be made available on Tuesdays when we start a new topic. So please update your browser to access the codes for the relevant chapter.

      + +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/intro.html b/english/courses/analytics2020/intro.html new file mode 100644 index 0000000..e966d97 --- /dev/null +++ b/english/courses/analytics2020/intro.html @@ -0,0 +1,422 @@ + + + + + + + Chapter 2 Introduction | Unsupervised Learning Methods + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + + +
      +
      + +
      +
      +

      Chapter 2 Introduction

      +

      You can label chapter and section titles using {#label} after them, e.g., we can reference Chapter 2. If you do not manually label them, there will be automatic labels anyway, e.g., Chapter 4.

      +

      Figures and tables with captions will be placed in figure and table environments, respectively.

      +
      par(mar = c(4, 4, .1, .1))
      +plot(pressure, type = 'b', pch = 19)
      +
      +Here is a nice figure! +

      +Figure 2.1: Here is a nice figure! +

      +
      +

      Reference a figure by its code chunk label with the fig: prefix, e.g., see Figure 2.1. Similarly, you can reference tables generated from knitr::kable(), e.g., see Table 2.1.

      +
      knitr::kable(
      +  head(iris, 20), caption = 'Here is a nice table!',
      +  booktabs = TRUE
      +)
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Table 2.1: Here is a nice table!
      Sepal.LengthSepal.WidthPetal.LengthPetal.WidthSpecies
      5.13.51.40.2setosa
      4.93.01.40.2setosa
      4.73.21.30.2setosa
      4.63.11.50.2setosa
      5.03.61.40.2setosa
      5.43.91.70.4setosa
      4.63.41.40.3setosa
      5.03.41.50.2setosa
      4.42.91.40.2setosa
      4.93.11.50.1setosa
      5.43.71.50.2setosa
      4.83.41.60.2setosa
      4.83.01.40.1setosa
      4.33.01.10.1setosa
      5.84.01.20.2setosa
      5.74.41.50.4setosa
      5.43.91.30.4setosa
      5.13.51.40.3setosa
      5.73.81.70.3setosa
      5.13.81.50.3setosa
      +

      You can write citations, too. For example, we are using the bookdown package (Xie 2020) in this sample book, which was built on top of R Markdown and knitr (Xie 2015).

      + +
      +

      References

      +
      +
      +

      Xie, Yihui. 2015. Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC. http://yihui.name/knitr/.

      +
      +
      +

      Xie, Yihui. 2020. Bookdown: Authoring Books and Technical Documents with R Markdown. https://CRAN.R-project.org/package=bookdown.

      +
      +
      +
      + +
      +
      +
      + + +
      +
      + + + + + + + + + + + + + + + + diff --git a/english/courses/analytics2020/libs/accessible-code-block-0.0.1/empty-anchor.js b/english/courses/analytics2020/libs/accessible-code-block-0.0.1/empty-anchor.js new file mode 100644 index 0000000..ca349fd --- /dev/null +++ b/english/courses/analytics2020/libs/accessible-code-block-0.0.1/empty-anchor.js @@ -0,0 +1,15 @@ +// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> +// v0.0.1 +// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. + +document.addEventListener('DOMContentLoaded', function() { + const codeList = document.getElementsByClassName("sourceCode"); + for (var i = 0; i < codeList.length; i++) { + var linkList = codeList[i].getElementsByTagName('a'); + for (var j = 0; j < linkList.length; j++) { + if (linkList[j].innerHTML === "") { + linkList[j].setAttribute('aria-hidden', 'true'); + } + } + } +}); diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf b/english/courses/analytics2020/libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/english/courses/analytics2020/libs/gitbook-2.6.7/css/fontawesome/fontawesome-webfont.ttf differ diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-bookdown.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-bookdown.css new file mode 100644 index 0000000..8e5bb8a --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-bookdown.css @@ -0,0 +1,99 @@ +.book .book-header h1 { + padding-left: 20px; + padding-right: 20px; +} +.book .book-header.fixed { + position: fixed; + right: 0; + top: 0; + left: 0; + border-bottom: 1px solid rgba(0,0,0,.07); +} +span.search-highlight { + background-color: #ffff88; +} +@media (min-width: 600px) { + .book.with-summary .book-header.fixed { + left: 300px; + } +} +@media (max-width: 1240px) { + .book .book-body.fixed { + top: 50px; + } + .book .book-body.fixed .body-inner { + top: auto; + } +} +@media (max-width: 600px) { + .book.with-summary .book-header.fixed { + left: calc(100% - 60px); + min-width: 300px; + } + .book.with-summary .book-body { + transform: none; + left: calc(100% - 60px); + min-width: 300px; + } + .book .book-body.fixed { + top: 0; + } +} + +.book .book-body.fixed .body-inner { + top: 50px; +} +.book .book-body .page-wrapper .page-inner section.normal sub, .book .book-body .page-wrapper .page-inner section.normal sup { + font-size: 85%; +} + +@media print { + .book .book-summary, .book .book-body .book-header, .fa { + display: none !important; + } + .book .book-body.fixed { + left: 0px; + } + .book .book-body,.book .book-body .body-inner, .book.with-summary { + overflow: visible !important; + } +} +.kable_wrapper { + border-spacing: 20px 0; + border-collapse: separate; + border: none; + margin: auto; +} +.kable_wrapper > tbody > tr > td { + vertical-align: top; +} +.book .book-body .page-wrapper .page-inner section.normal table tr.header { + border-top-width: 2px; +} +.book .book-body .page-wrapper .page-inner section.normal table tr:last-child td { + border-bottom-width: 2px; +} +.book .book-body .page-wrapper .page-inner section.normal table td, .book .book-body .page-wrapper .page-inner section.normal table th { + border-left: none; + border-right: none; +} +.book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr, .book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr > td { + border-top: none; +} +.book .book-body .page-wrapper .page-inner section.normal table.kable_wrapper > tbody > tr:last-child > td { + border-bottom: none; +} + +div.theorem, div.lemma, div.corollary, div.proposition, div.conjecture { + font-style: italic; +} +span.theorem, span.lemma, span.corollary, span.proposition, span.conjecture { + font-style: normal; +} +div.proof:after { + content: "\25a2"; + float: right; +} +.header-section-number { + padding-right: .5em; +} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-clipboard.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-clipboard.css new file mode 100644 index 0000000..6844a70 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-clipboard.css @@ -0,0 +1,18 @@ +div.sourceCode { + position: relative; +} + +.copy-to-clipboard-button { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.copy-to-clipboard-button:focus { + outline: 0; +} + +div.sourceCode:hover > .copy-to-clipboard-button { + visibility: visible; +} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-fontsettings.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-fontsettings.css new file mode 100644 index 0000000..87236b4 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-fontsettings.css @@ -0,0 +1,292 @@ +/* + * Theme 1 + */ +.color-theme-1 .dropdown-menu { + background-color: #111111; + border-color: #7e888b; +} +.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { + border-bottom: 9px solid #111111; +} +.color-theme-1 .dropdown-menu .buttons { + border-color: #7e888b; +} +.color-theme-1 .dropdown-menu .button { + color: #afa790; +} +.color-theme-1 .dropdown-menu .button:hover { + color: #73553c; +} +/* + * Theme 2 + */ +.color-theme-2 .dropdown-menu { + background-color: #2d3143; + border-color: #272a3a; +} +.color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { + border-bottom: 9px solid #2d3143; +} +.color-theme-2 .dropdown-menu .buttons { + border-color: #272a3a; +} +.color-theme-2 .dropdown-menu .button { + color: #62677f; +} +.color-theme-2 .dropdown-menu .button:hover { + color: #f4f4f5; +} +.book .book-header .font-settings .font-enlarge { + line-height: 30px; + font-size: 1.4em; +} +.book .book-header .font-settings .font-reduce { + line-height: 30px; + font-size: 1em; +} +.book.color-theme-1 .book-body { + color: #704214; + background: #f3eacb; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section { + background: #f3eacb; +} +.book.color-theme-2 .book-body { + color: #bdcadb; + background: #1c1f2b; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section { + background: #1c1f2b; +} +.book.font-size-0 .book-body .page-inner section { + font-size: 1.2rem; +} +.book.font-size-1 .book-body .page-inner section { + font-size: 1.4rem; +} +.book.font-size-2 .book-body .page-inner section { + font-size: 1.6rem; +} +.book.font-size-3 .book-body .page-inner section { + font-size: 2.2rem; +} +.book.font-size-4 .book-body .page-inner section { + font-size: 4rem; +} +.book.font-family-0 { + font-family: Georgia, serif; +} +.book.font-family-1 { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { + color: #704214; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { + color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { + color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { + border-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { + color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { + background-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { + border-color: #c4b29f; + opacity: 0.9; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { + background: #fdf6e3; + color: #657b83; + border-color: #f8df9c; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { + background-color: inherit; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td { + border-color: #f5d06c; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { + color: inherit; + background-color: #fdf6e3; + border-color: #444444; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { + background-color: #fbeecb; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { + color: #bdcadb; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { + color: #3eb1d0; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { + color: #fffffa; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { + border-color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { + color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { + background-color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote { + border-color: #373b4e; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { + color: #9dbed8; + background: #2d3143; + border-color: #2d3143; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { + background-color: #282a39; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td { + border-color: #3b3f54; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { + color: #b6c2d2; + background-color: #2d3143; + border-color: #3b3f54; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { + background-color: #35394b; +} +.book.color-theme-1 .book-header { + color: #afa790; + background: transparent; +} +.book.color-theme-1 .book-header .btn { + color: #afa790; +} +.book.color-theme-1 .book-header .btn:hover { + color: #73553c; + background: none; +} +.book.color-theme-1 .book-header h1 { + color: #704214; +} +.book.color-theme-2 .book-header { + color: #7e888b; + background: transparent; +} +.book.color-theme-2 .book-header .btn { + color: #3b3f54; +} +.book.color-theme-2 .book-header .btn:hover { + color: #fffff5; + background: none; +} +.book.color-theme-2 .book-header h1 { + color: #bdcadb; +} +.book.color-theme-1 .book-body .navigation { + color: #afa790; +} +.book.color-theme-1 .book-body .navigation:hover { + color: #73553c; +} +.book.color-theme-2 .book-body .navigation { + color: #383f52; +} +.book.color-theme-2 .book-body .navigation:hover { + color: #fffff5; +} +/* + * Theme 1 + */ +.book.color-theme-1 .book-summary { + color: #afa790; + background: #111111; + border-right: 1px solid rgba(0, 0, 0, 0.07); +} +.book.color-theme-1 .book-summary .book-search { + background: transparent; +} +.book.color-theme-1 .book-summary .book-search input, +.book.color-theme-1 .book-summary .book-search input:focus { + border: 1px solid transparent; +} +.book.color-theme-1 .book-summary ul.summary li.divider { + background: #7e888b; + box-shadow: none; +} +.book.color-theme-1 .book-summary ul.summary li i.fa-check { + color: #33cc33; +} +.book.color-theme-1 .book-summary ul.summary li.done > a { + color: #877f6a; +} +.book.color-theme-1 .book-summary ul.summary li a, +.book.color-theme-1 .book-summary ul.summary li span { + color: #877f6a; + background: transparent; + font-weight: normal; +} +.book.color-theme-1 .book-summary ul.summary li.active > a, +.book.color-theme-1 .book-summary ul.summary li a:hover { + color: #704214; + background: transparent; + font-weight: normal; +} +/* + * Theme 2 + */ +.book.color-theme-2 .book-summary { + color: #bcc1d2; + background: #2d3143; + border-right: none; +} +.book.color-theme-2 .book-summary .book-search { + background: transparent; +} +.book.color-theme-2 .book-summary .book-search input, +.book.color-theme-2 .book-summary .book-search input:focus { + border: 1px solid transparent; +} +.book.color-theme-2 .book-summary ul.summary li.divider { + background: #272a3a; + box-shadow: none; +} +.book.color-theme-2 .book-summary ul.summary li i.fa-check { + color: #33cc33; +} +.book.color-theme-2 .book-summary ul.summary li.done > a { + color: #62687f; +} +.book.color-theme-2 .book-summary ul.summary li a, +.book.color-theme-2 .book-summary ul.summary li span { + color: #c1c6d7; + background: transparent; + font-weight: 600; +} +.book.color-theme-2 .book-summary ul.summary li.active > a, +.book.color-theme-2 .book-summary ul.summary li a:hover { + color: #f4f4f5; + background: #252737; + font-weight: 600; +} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-highlight.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-highlight.css new file mode 100644 index 0000000..2aabd3d --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-highlight.css @@ -0,0 +1,426 @@ +.book .book-body .page-wrapper .page-inner section.normal pre, +.book .book-body .page-wrapper .page-inner section.normal code { + /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + /* Tomorrow Comment */ + /* Tomorrow Red */ + /* Tomorrow Orange */ + /* Tomorrow Yellow */ + /* Tomorrow Green */ + /* Tomorrow Aqua */ + /* Tomorrow Blue */ + /* Tomorrow Purple */ +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-comment, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-comment, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-title { + color: #8e908c; +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-variable, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-variable, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-attribute, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-tag, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-tag, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-regexp, +.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant, +.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi, +.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype, +.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype, +.book .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype, +.book .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype, +.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id, +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-id, +.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class, +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-class, +.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo, +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo { + color: #c82829; +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-number, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-number, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-pragma, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-built_in, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-literal, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-literal, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-params, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-params, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-constant, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-constant { + color: #f5871f; +} +.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute, +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute { + color: #eab700; +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-string, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-string, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-value, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-value, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance, +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-header, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-header, +.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol, +.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, +.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { + color: #718c00; +} +.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor, +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor { + color: #3e999f; +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-function, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-function, +.book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator, +.book .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator, +.book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .python .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword, +.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword, +.book .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub, +.book .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub, +.book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title, +.book .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title { + color: #4271ae; +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword, +.book .book-body .page-wrapper .page-inner section.normal code .hljs-keyword, +.book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function, +.book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function { + color: #8959a8; +} +.book .book-body .page-wrapper .page-inner section.normal pre .hljs, +.book .book-body .page-wrapper .page-inner section.normal code .hljs { + display: block; + background: white; + color: #4d4d4c; + padding: 0.5em; +} +.book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript, +.book .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript, +.book .book-body .page-wrapper .page-inner section.normal pre .javascript .xml, +.book .book-body .page-wrapper .page-inner section.normal code .javascript .xml, +.book .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, +.book .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .javascript, +.book .book-body .page-wrapper .page-inner section.normal code .xml .javascript, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript, +.book .book-body .page-wrapper .page-inner section.normal code .xml .vbscript, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .css, +.book .book-body .page-wrapper .page-inner section.normal code .xml .css, +.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, +.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { + opacity: 0.5; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { + /* + +Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull + +*/ + /* Solarized Green */ + /* Solarized Cyan */ + /* Solarized Blue */ + /* Solarized Yellow */ + /* Solarized Orange */ + /* Solarized Red */ + /* Solarized Violet */ +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs { + display: block; + padding: 0.5em; + background: #fdf6e3; + color: #657b83; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc { + color: #93a1a1; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-request, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-status, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-status, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .nginx .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .nginx .hljs-title { + color: #859900; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-number, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-number, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-command, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-command, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-string, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-string, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag .hljs-value, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-tag .hljs-value, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-rules .hljs-value, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-rules .hljs-value, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-phpdoc, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-phpdoc, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-hexcolor, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-hexcolor, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_url, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_url { + color: #2aa198; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-localvars, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-localvars, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-chunk, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-chunk, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-decorator, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-decorator, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-identifier, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-identifier, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .vhdl .hljs-literal, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .vhdl .hljs-literal, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-id, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-id, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-function, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-function { + color: #268bd2; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-variable, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-body, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-body, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .smalltalk .hljs-number, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .smalltalk .hljs-number, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-constant, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-class .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-class .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-parent, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-parent, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .haskell .hljs-type, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .haskell .hljs-type, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_reference, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_reference { + color: #b58900; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor .hljs-keyword, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor .hljs-keyword, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-shebang, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-shebang, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol .hljs-string, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol .hljs-string, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-change, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-change, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-special, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-special, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attr_selector, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attr_selector, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-subst, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-subst, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-cdata, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-cdata, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .clojure .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .clojure .hljs-title, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-header, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-header { + color: #cb4b16; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-important, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-important { + color: #dc322f; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_label, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_label { + color: #6c71c4; +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula { + background: #eee8d5; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { + /* Tomorrow Night Bright Theme */ + /* Original theme - https://github.com/chriskempson/tomorrow-theme */ + /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + /* Tomorrow Comment */ + /* Tomorrow Red */ + /* Tomorrow Orange */ + /* Tomorrow Yellow */ + /* Tomorrow Green */ + /* Tomorrow Aqua */ + /* Tomorrow Blue */ + /* Tomorrow Purple */ +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-comment, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-title { + color: #969896; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-variable, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-tag, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-id, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-class, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo { + color: #d54e53; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-number, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-number, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-literal, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-literal, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-params, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-params, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-constant { + color: #e78c45; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute { + color: #e7c547; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-string, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-string, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-value, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-value, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-header, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-header, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { + color: #b9ca4a; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor { + color: #70c0b1; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-function, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-function, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title { + color: #7aa6da; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function { + color: #c397d8; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs { + display: block; + background: black; + color: #eaeaea; + padding: 0.5em; +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .xml, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .xml, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .javascript, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .javascript, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .vbscript, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .css, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .css, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { + opacity: 0.5; +} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-search.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-search.css new file mode 100644 index 0000000..c85e557 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-search.css @@ -0,0 +1,31 @@ +.book .book-summary .book-search { + padding: 6px; + background: transparent; + position: absolute; + top: -50px; + left: 0px; + right: 0px; + transition: top 0.5s ease; +} +.book .book-summary .book-search input, +.book .book-summary .book-search input:focus, +.book .book-summary .book-search input:hover { + width: 100%; + background: transparent; + border: 1px solid #ccc; + box-shadow: none; + outline: none; + line-height: 22px; + padding: 7px 4px; + color: inherit; + box-sizing: border-box; +} +.book.with-search .book-summary .book-search { + top: 0px; +} +.book.with-search .book-summary ul.summary { + top: 50px; +} +.with-search .summary li[data-level] a[href*=".html#"] { + display: none; +} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-table.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-table.css new file mode 100644 index 0000000..7fba1b9 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/plugin-table.css @@ -0,0 +1 @@ +.book .book-body .page-wrapper .page-inner section.normal table{display:table;width:100%;border-collapse:collapse;border-spacing:0;overflow:auto}.book .book-body .page-wrapper .page-inner section.normal table td,.book .book-body .page-wrapper .page-inner section.normal table th{padding:6px 13px;border:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.normal table tr{background-color:#fff;border-top:1px solid #ccc}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table th{font-weight:700} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/css/style.css b/english/courses/analytics2020/libs/gitbook-2.6.7/css/style.css new file mode 100644 index 0000000..b896892 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/css/style.css @@ -0,0 +1,10 @@ +/*! normalize.css v2.1.0 | MIT License | git.io/normalize */img,legend{border:0}*,.fa{-webkit-font-smoothing:antialiased}.fa-ul>li,sub,sup{position:relative}.book .book-body .page-wrapper .page-inner section.normal hr:after,.book-langs-index .inner .languages:after,.buttons:after,.dropdown-menu .buttons:after{clear:both}body,html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}.hidden,[hidden]{display:none}audio:not([controls]){display:none;height:0}html{font-family:sans-serif}body,figure{margin:0}a:focus{outline:dotted thin}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button{margin-right:10px;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}/*! + * Preboot v2 + * + * Open sourced under MIT license by @mdo. + * Some variables and mixins from Bootstrap (Apache 2 license). + */.link-inherit,.link-inherit:focus,.link-inherit:hover{color:inherit}.fa,.fa-stack{display:inline-block}/*! + * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(./fontawesome/fontawesome-webfont.ttf?v=4.1.0) format('truetype');font-weight:400;font-style:normal}.fa{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.book .book-header,.book .book-summary{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-square:before,.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.book-langs-index{width:100%;height:100%;padding:40px 0;margin:0;overflow:auto}@media (max-width:600px){.book-langs-index{padding:0}}.book-langs-index .inner{max-width:600px;width:100%;margin:0 auto;padding:30px;background:#fff;border-radius:3px}.book-langs-index .inner h3{margin:0}.book-langs-index .inner .languages{list-style:none;padding:20px 30px;margin-top:20px;border-top:1px solid #eee}.book-langs-index .inner .languages:after,.book-langs-index .inner .languages:before{content:" ";display:table;line-height:0}.book-langs-index .inner .languages li{width:50%;float:left;padding:10px 5px;font-size:16px}@media (max-width:600px){.book-langs-index .inner .languages li{width:100%;max-width:100%}}.book .book-header{overflow:visible;height:50px;padding:0 8px;z-index:2;font-size:.85em;color:#7e888b;background:0 0}.book .book-header .btn{display:block;height:50px;padding:0 15px;border-bottom:none;color:#ccc;text-transform:uppercase;line-height:50px;-webkit-box-shadow:none!important;box-shadow:none!important;position:relative;font-size:14px}.book .book-header .btn:hover{position:relative;text-decoration:none;color:#444;background:0 0}.book .book-header h1{margin:0;font-size:20px;font-weight:200;text-align:center;line-height:50px;opacity:0;padding-left:200px;padding-right:200px;-webkit-transition:opacity .2s ease;-moz-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book .book-header h1 a,.book .book-header h1 a:hover{color:inherit;text-decoration:none}@media (max-width:1000px){.book .book-header h1{display:none}}.book .book-header h1 i{display:none}.book .book-header:hover h1{opacity:1}.book.is-loading .book-header h1 i{display:inline-block}.book.is-loading .book-header h1 a{display:none}.dropdown{position:relative}.dropdown-menu{position:absolute;top:100%;left:0;z-index:100;display:none;float:left;min-width:160px;padding:0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fafafa;border:1px solid rgba(0,0,0,.07);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.open{display:block}.dropdown-menu.dropdown-left{left:auto;right:4%}.dropdown-menu.dropdown-left .dropdown-caret{right:14px;left:auto}.dropdown-menu .dropdown-caret{position:absolute;top:-8px;left:14px;width:18px;height:10px;float:left;overflow:hidden}.dropdown-menu .dropdown-caret .caret-inner,.dropdown-menu .dropdown-caret .caret-outer{display:inline-block;top:0;border-left:9px solid transparent;border-right:9px solid transparent;position:absolute}.dropdown-menu .dropdown-caret .caret-outer{border-bottom:9px solid rgba(0,0,0,.1);height:auto;left:0;width:auto;margin-left:-1px}.dropdown-menu .dropdown-caret .caret-inner{margin-top:-1px;top:1px;border-bottom:9px solid #fafafa}.dropdown-menu .buttons{border-bottom:1px solid rgba(0,0,0,.07)}.dropdown-menu .buttons:after,.dropdown-menu .buttons:before{content:" ";display:table;line-height:0}.dropdown-menu .buttons:last-child{border-bottom:none}.dropdown-menu .buttons .button{border:0;background-color:transparent;color:#a6a6a6;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.alert,.dropdown-menu .buttons .button:hover{color:#444}.dropdown-menu .buttons .button:focus,.dropdown-menu .buttons .button:hover{outline:0}.dropdown-menu .buttons .button.size-2{width:50%}.dropdown-menu .buttons .button.size-3{width:33%}.alert{padding:15px;margin-bottom:20px;background:#eee;border-bottom:5px solid #ddd}.alert-success{background:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-info{background:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-danger{background:#f2dede;border-color:#ebccd1;color:#a94442}.alert-warning{background:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.book .book-summary{position:absolute;top:0;left:-300px;bottom:0;z-index:1;width:300px;color:#364149;background:#fafafa;border-right:1px solid rgba(0,0,0,.07);-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-summary ul.summary{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;list-style:none;margin:0;padding:0;-webkit-transition:top .5s ease;-moz-transition:top .5s ease;-o-transition:top .5s ease;transition:top .5s ease}.book .book-summary ul.summary li{list-style:none}.book .book-summary ul.summary li.divider{height:1px;margin:7px 0;overflow:hidden;background:rgba(0,0,0,.07)}.book .book-summary ul.summary li i.fa-check{display:none;position:absolute;right:9px;top:16px;font-size:9px;color:#3c3}.book .book-summary ul.summary li.done>a{color:#364149;font-weight:400}.book .book-summary ul.summary li.done>a i{display:inline}.book .book-summary ul.summary li a,.book .book-summary ul.summary li span{display:block;padding:10px 15px;border-bottom:none;color:#364149;background:0 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.book .book-summary ul.summary li span{cursor:not-allowed;opacity:.3;filter:alpha(opacity=30)}.book .book-summary ul.summary li a:hover,.book .book-summary ul.summary li.active>a{color:#008cff;background:0 0;text-decoration:none}.book .book-summary ul.summary li ul{padding-left:20px}@media (max-width:600px){.book .book-summary{width:calc(100% - 60px);bottom:0;left:-100%}}.book.with-summary .book-summary{left:0}.book.without-animation .book-summary{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.book{position:relative;width:100%;height:100%}.book .book-body,.book .book-body .body-inner{position:absolute;top:0;left:0;overflow-y:auto;bottom:0;right:0}.book .book-body{color:#000;background:#fff;-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-body .page-wrapper{position:relative;outline:0}.book .book-body .page-wrapper .page-inner{max-width:800px;margin:0 auto;padding:20px 0 40px}.book .book-body .page-wrapper .page-inner section{margin:0;padding:5px 15px;background:#fff;border-radius:2px;line-height:1.7;font-size:1.6rem}.book .book-body .page-wrapper .page-inner .btn-group .btn{border-radius:0;background:#eee;border:0}@media (max-width:1240px){.book .book-body{-webkit-transition:-webkit-transform 250ms ease;-moz-transition:-moz-transform 250ms ease;-o-transition:-o-transform 250ms ease;transition:transform 250ms ease;padding-bottom:20px}.book .book-body .body-inner{position:static;min-height:calc(100% - 50px)}}@media (min-width:600px){.book.with-summary .book-body{left:300px}}@media (max-width:600px){.book.with-summary{overflow:hidden}.book.with-summary .book-body{-webkit-transform:translate(calc(100% - 60px),0);-moz-transform:translate(calc(100% - 60px),0);-ms-transform:translate(calc(100% - 60px),0);-o-transform:translate(calc(100% - 60px),0);transform:translate(calc(100% - 60px),0)}}.book.without-animation .book-body{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.buttons:after,.buttons:before{content:" ";display:table;line-height:0}.button{border:0;background:#eee;color:#666;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.button:hover{color:#444}.button:focus,.button:hover{outline:0}.button.size-2{width:50%}.button.size-3{width:33%}.book .book-body .page-wrapper .page-inner section{display:none}.book .book-body .page-wrapper .page-inner section.normal{display:block;word-wrap:break-word;overflow:hidden;color:#333;line-height:1.7;text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%}.book .book-body .page-wrapper .page-inner section.normal *{box-sizing:border-box;-webkit-box-sizing:border-box;}.book .book-body .page-wrapper .page-inner section.normal>:first-child{margin-top:0!important}.book .book-body .page-wrapper .page-inner section.normal>:last-child{margin-bottom:0!important}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal figure,.book .book-body .page-wrapper .page-inner section.normal img,.book .book-body .page-wrapper .page-inner section.normal pre,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal tr{page-break-inside:avoid}.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal p{orphans:3;widows:3}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5{page-break-after:avoid}.book .book-body .page-wrapper .page-inner section.normal b,.book .book-body .page-wrapper .page-inner section.normal strong{font-weight:700}.book .book-body .page-wrapper .page-inner section.normal em{font-style:italic}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal dl,.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal p,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal ul{margin-top:0;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal a{color:#4183c4;text-decoration:none;background:0 0}.book .book-body .page-wrapper .page-inner section.normal a:active,.book .book-body .page-wrapper .page-inner section.normal a:focus,.book .book-body .page-wrapper .page-inner section.normal a:hover{outline:0;text-decoration:underline}.book .book-body .page-wrapper .page-inner section.normal img{border:0;max-width:100%}.book .book-body .page-wrapper .page-inner section.normal hr{height:4px;padding:0;margin:1.7em 0;overflow:hidden;background-color:#e7e7e7;border:none}.book .book-body .page-wrapper .page-inner section.normal hr:after,.book .book-body .page-wrapper .page-inner section.normal hr:before{display:table;content:" "}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal h6{margin-top:1.275em;margin-bottom:.85em;}.book .book-body .page-wrapper .page-inner section.normal h1{font-size:2em}.book .book-body .page-wrapper .page-inner section.normal h2{font-size:1.75em}.book .book-body .page-wrapper .page-inner section.normal h3{font-size:1.5em}.book .book-body .page-wrapper .page-inner section.normal h4{font-size:1.25em}.book .book-body .page-wrapper .page-inner section.normal h5{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal h6{font-size:1em;color:#777}.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;direction:ltr;border:none;color:inherit}.book .book-body .page-wrapper .page-inner section.normal pre{overflow:auto;word-wrap:normal;margin:0 0 1.275em;padding:.85em 1em;background:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal pre>code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;font-size:.85em;white-space:pre;background:0 0}.book .book-body .page-wrapper .page-inner section.normal pre>code:after,.book .book-body .page-wrapper .page-inner section.normal pre>code:before{content:normal}.book .book-body .page-wrapper .page-inner section.normal code{padding:.2em;margin:0;font-size:.85em;background-color:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal code:after,.book .book-body .page-wrapper .page-inner section.normal code:before{letter-spacing:-.2em;content:"\00a0"}.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal ul{padding:0 0 0 2em;margin:0 0 .85em}.book .book-body .page-wrapper .page-inner section.normal ol ol,.book .book-body .page-wrapper .page-inner section.normal ol ul,.book .book-body .page-wrapper .page-inner section.normal ul ol,.book .book-body .page-wrapper .page-inner section.normal ul ul{margin-top:0;margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal ol ol{list-style-type:lower-roman}.book .book-body .page-wrapper .page-inner section.normal blockquote{margin:0 0 .85em;padding:0 15px;opacity:0.75;border-left:4px solid #dcdcdc}.book .book-body .page-wrapper .page-inner section.normal blockquote:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal blockquote:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal dl{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt{padding:0;margin-top:.85em;font-style:italic;font-weight:700}.book .book-body .page-wrapper .page-inner section.normal dl dd{padding:0 .85em;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal dd{margin-left:0}.book .book-body .page-wrapper .page-inner section.normal .glossary-term{cursor:help;text-decoration:underline}.book .book-body .navigation{position:absolute;top:50px;bottom:0;margin:0;max-width:150px;min-width:90px;display:flex;justify-content:center;align-content:center;flex-direction:column;font-size:40px;color:#ccc;text-align:center;-webkit-transition:all 350ms ease;-moz-transition:all 350ms ease;-o-transition:all 350ms ease;transition:all 350ms ease}.book .book-body .navigation:hover{text-decoration:none;color:#444}.book .book-body .navigation.navigation-next{right:0}.book .book-body .navigation.navigation-prev{left:0}@media (max-width:1240px){.book .book-body .navigation{position:static;top:auto;max-width:50%;width:50%;display:inline-block;float:left}.book .book-body .navigation.navigation-unique{max-width:100%;width:100%}}.book .book-body .page-wrapper .page-inner section.glossary{margin-bottom:40px}.book .book-body .page-wrapper .page-inner section.glossary h2 a,.book .book-body .page-wrapper .page-inner section.glossary h2 a:hover{color:inherit;text-decoration:none}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index{list-style:none;margin:0;padding:0}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index li{display:inline;margin:0 8px;white-space:nowrap}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:none;-webkit-touch-callout:none}a{text-decoration:none}body,html{height:100%}html{font-size:62.5%}body{text-rendering:optimizeLegibility;font-smoothing:antialiased;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;letter-spacing:.2px;text-size-adjust:100%} +.book .book-summary ul.summary li a span {display:inline;padding:initial;overflow:visible;cursor:auto;opacity:1;} diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/js/app.min.js b/english/courses/analytics2020/libs/gitbook-2.6.7/js/app.min.js new file mode 100644 index 0000000..643f1f9 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/js/app.min.js @@ -0,0 +1 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"'`]/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);var reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g;var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;var reRegExpChars=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,reHasRegExpChars=RegExp(reRegExpChars.source);var reComboMark=/[\u0300-\u036f\ufe20-\ufe23]/g;var reEscapeChar=/\\(\\)?/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reHasHexPrefix=/^0[xX]/;var reIsHostCtor=/^\[object .+?Constructor\]$/;var reIsUint=/^\d+$/;var reLatin1=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;var reNoMatch=/($^)/;var reUnescapedString=/['\n\r\u2028\u2029\\]/g;var reWords=function(){var upper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lower="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(upper+"+(?="+upper+lower+")|"+upper+"?"+lower+"|"+upper+"+|[0-9]+","g")}();var contextProps=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"];var templateCounter=-1;var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[stringTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[mapTag]=cloneableTags[setTag]=cloneableTags[weakMapTag]=false;var deburredLetters={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};var htmlUnescapes={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"};var objectTypes={function:true,object:true};var regexpEscapes={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global&&global.Object&&global;var freeSelf=objectTypes[typeof self]&&self&&self.Object&&self;var freeWindow=objectTypes[typeof window]&&window&&window.Object&&window;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var root=freeGlobal||freeWindow!==(this&&this.window)&&freeWindow||freeSelf||this;function baseCompareAscending(value,other){if(value!==other){var valIsNull=value===null,valIsUndef=value===undefined,valIsReflexive=value===value;var othIsNull=other===null,othIsUndef=other===undefined,othIsReflexive=other===other;if(value>other&&!othIsNull||!valIsReflexive||valIsNull&&!othIsUndef&&othIsReflexive||valIsUndef&&othIsReflexive){return 1}if(value-1){}return index}function charsRightIndex(string,chars){var index=string.length;while(index--&&chars.indexOf(string.charAt(index))>-1){}return index}function compareAscending(object,other){return baseCompareAscending(object.criteria,other.criteria)||object.index-other.index}function compareMultiple(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;while(++index=ordersLength){return result}var order=orders[index];return result*(order==="asc"||order===true?1:-1)}}return object.index-other.index}function deburrLetter(letter){return deburredLetters[letter]}function escapeHtmlChar(chr){return htmlEscapes[chr]}function escapeRegExpChar(chr,leadingChar,whitespaceChar){if(leadingChar){chr=regexpEscapes[chr]}else if(whitespaceChar){chr=stringEscapes[chr]}return"\\"+chr}function escapeStringChar(chr){return"\\"+stringEscapes[chr]}function indexOfNaN(array,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?0:-1);while(fromRight?index--:++index=9&&charCode<=13)||charCode==32||charCode==160||charCode==5760||charCode==6158||charCode>=8192&&(charCode<=8202||charCode==8232||charCode==8233||charCode==8239||charCode==8287||charCode==12288||charCode==65279)}function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index>>1;var MAX_SAFE_INTEGER=9007199254740991;var metaMap=WeakMap&&new WeakMap;var realNames={};function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper){return value}if(hasOwnProperty.call(value,"__chain__")&&hasOwnProperty.call(value,"__wrapped__")){return wrapperClone(value)}}return new LodashWrapper(value)}function baseLodash(){}function LodashWrapper(value,chainAll,actions){this.__wrapped__=value;this.__actions__=actions||[];this.__chain__=!!chainAll}var support=lodash.support={};lodash.templateSettings={escape:reEscape,evaluate:reEvaluate,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function LazyWrapper(value){this.__wrapped__=value;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=POSITIVE_INFINITY;this.__views__=[]}function lazyClone(){var result=new LazyWrapper(this.__wrapped__);result.__actions__=arrayCopy(this.__actions__);result.__dir__=this.__dir__;result.__filtered__=this.__filtered__;result.__iteratees__=arrayCopy(this.__iteratees__);result.__takeCount__=this.__takeCount__;result.__views__=arrayCopy(this.__views__);return result}function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1;result.__filtered__=true}else{result=this.clone();result.__dir__*=-1}return result}function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=getView(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||arrLength=LARGE_ARRAY_SIZE?createCache(values):null,valuesLength=values.length;if(cache){indexOf=cacheIndexOf;isCommon=false;values=cache}outer:while(++indexlength?0:length+start}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length}length=start>end?0:end>>>0;start>>>=0;while(startlength?0:length+start}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index=LARGE_ARRAY_SIZE,seen=isLarge?createCache():null,result=[];if(seen){indexOf=cacheIndexOf;isCommon=false}else{isLarge=false;seen=iteratee?[]:result}outer:while(++index>>1,computed=array[mid];if((retHighest?computed<=value:computed2?sources[length-2]:undefined,guard=length>2?sources[2]:undefined,thisArg=length>1?sources[length-1]:undefined;if(typeof customizer=="function"){customizer=bindCallback(customizer,thisArg,5);length-=2}else{customizer=typeof thisArg=="function"?thisArg:undefined;length-=customizer?1:0}if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1}while(++index-1?collection[index]:undefined}return baseFind(collection,predicate,eachFunc)}}function createFindIndex(fromRight){return function(array,predicate,thisArg){if(!(array&&array.length)){return-1}predicate=getCallback(predicate,thisArg,3);return baseFindIndex(array,predicate,fromRight)}}function createFindKey(objectFunc){return function(object,predicate,thisArg){predicate=getCallback(predicate,thisArg,3);return baseFind(object,predicate,objectFunc,true)}}function createFlow(fromRight){return function(){var wrapper,length=arguments.length,index=fromRight?length:-1,leftIndex=0,funcs=Array(length);while(fromRight?index--:++index=LARGE_ARRAY_SIZE){return wrapper.plant(value).value()}var index=0,result=length?funcs[index].apply(this,args):value;while(++index=length||!nativeIsFinite(length)){return""}var padLength=length-strLength;chars=chars==null?" ":chars+"";return repeat(chars,nativeCeil(padLength/chars.length)).slice(0,padLength)}function createPartialWrapper(func,bitmask,thisArg,partials){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength);while(++leftIndexarrLength)){return false}while(++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isStrictComparable(value){return value===value&&!isObject(value)}function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask0){if(++count>=HOT_COUNT){return key}}else{count=0}return baseSetData(key,value)}}();function shimKeys(object){var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length;var allowIndexes=!!length&&isLength(length)&&(isArray(object)||isArguments(object));var index=-1,result=[];while(++index=120?createCache(othIndex&&value):null}var array=arrays[0],index=-1,length=array?array.length:0,seen=caches[0];outer:while(++index-1){splice.call(array,fromIndex,1)}}return array}var pullAt=restParam(function(array,indexes){indexes=baseFlatten(indexes);var result=baseAt(array,indexes);basePullAt(array,indexes.sort(baseCompareAscending));return result});function remove(array,predicate,thisArg){var result=[];if(!(array&&array.length)){return result}var index=-1,indexes=[],length=array.length;predicate=getCallback(predicate,thisArg,3);while(++index2?arrays[length-2]:undefined,thisArg=length>1?arrays[length-1]:undefined;if(length>2&&typeof iteratee=="function"){length-=2}else{iteratee=length>1&&typeof thisArg=="function"?(--length,thisArg):undefined;thisArg=undefined}arrays.length=length;return unzipWith(arrays,iteratee,thisArg)});function chain(value){var result=lodash(value);result.__chain__=true;return result}function tap(value,interceptor,thisArg){interceptor.call(thisArg,value);return value}function thru(value,interceptor,thisArg){return interceptor.call(thisArg,value)}function wrapperChain(){return chain(this)}function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)}var wrapperConcat=restParam(function(values){values=baseFlatten(values);return this.thru(function(array){return arrayConcat(isArray(array)?array:[toObject(array)],values)})});function wrapperPlant(value){var result,parent=this;while(parent instanceof baseLodash){var clone=wrapperClone(parent);if(result){previous.__wrapped__=clone}else{result=clone}var previous=clone;parent=parent.__wrapped__}previous.__wrapped__=value;return result}function wrapperReverse(){var value=this.__wrapped__;var interceptor=function(value){return wrapped&&wrapped.__dir__<0?value:value.reverse()};if(value instanceof LazyWrapper){var wrapped=value;if(this.__actions__.length){wrapped=new LazyWrapper(this)}wrapped=wrapped.reverse();wrapped.__actions__.push({func:thru,args:[interceptor],thisArg:undefined});return new LodashWrapper(wrapped,this.__chain__)}return this.thru(interceptor)}function wrapperToString(){return this.value()+""}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}var at=restParam(function(collection,props){return baseAt(collection,baseFlatten(props))});var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:result[key]=1});function every(collection,predicate,thisArg){var func=isArray(collection)?arrayEvery:baseEvery;if(thisArg&&isIterateeCall(collection,predicate,thisArg)){predicate=undefined}if(typeof predicate!="function"||thisArg!==undefined){predicate=getCallback(predicate,thisArg,3)}return func(collection,predicate)}function filter(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;predicate=getCallback(predicate,thisArg,3);return func(collection,predicate)}var find=createFind(baseEach);var findLast=createFind(baseEachRight,true);function findWhere(collection,source){return find(collection,baseMatches(source))}var forEach=createForEach(arrayEach,baseEach);var forEachRight=createForEach(arrayEachRight,baseEachRight);var groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value)}else{result[key]=[value]}});function includes(collection,target,fromIndex,guard){var length=collection?getLength(collection):0;if(!isLength(length)){collection=values(collection);length=collection.length}if(typeof fromIndex!="number"||guard&&isIterateeCall(target,fromIndex,guard)){fromIndex=0}else{fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex||0}return typeof collection=="string"||!isArray(collection)&&isString(collection)?fromIndex<=length&&collection.indexOf(target,fromIndex)>-1:!!length&&getIndexOf(collection,target,fromIndex)>-1}var indexBy=createAggregator(function(result,value,key){result[key]=value});var invoke=restParam(function(collection,path,args){var index=-1,isFunc=typeof path=="function",isProp=isKey(path),result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){var func=isFunc?path:isProp&&value!=null?value[path]:undefined;result[++index]=func?func.apply(value,args):invokePath(value,path,args)});return result});function map(collection,iteratee,thisArg){var func=isArray(collection)?arrayMap:baseMap;iteratee=getCallback(iteratee,thisArg,3);return func(collection,iteratee)}var partition=createAggregator(function(result,value,key){result[key?0:1].push(value)},function(){return[[],[]]});function pluck(collection,path){return map(collection,property(path))}var reduce=createReduce(arrayReduce,baseEach);var reduceRight=createReduce(arrayReduceRight,baseEachRight);function reject(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;predicate=getCallback(predicate,thisArg,3);return func(collection,function(value,index,collection){return!predicate(value,index,collection)})}function sample(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n==null){collection=toIterable(collection);var length=collection.length;return length>0?collection[baseRandom(0,length-1)]:undefined}var index=-1,result=toArray(collection),length=result.length,lastIndex=length-1;n=nativeMin(n<0?0:+n||0,length);while(++index0){result=func.apply(this,arguments)}if(n<=1){func=undefined}return result}}var bind=restParam(function(func,thisArg,partials){var bitmask=BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,bind.placeholder);bitmask|=PARTIAL_FLAG}return createWrapper(func,bitmask,thisArg,partials,holders)});var bindAll=restParam(function(object,methodNames){methodNames=methodNames.length?baseFlatten(methodNames):functions(object);var index=-1,length=methodNames.length;while(++indexwait){complete(trailingCall,maxTimeoutId)}else{timeoutId=setTimeout(delayed,remaining)}}function maxDelayed(){complete(trailing,timeoutId)}function debounced(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0||remaining>maxWait;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=undefined}return result}debounced.cancel=cancel;return debounced}var defer=restParam(function(func,args){return baseDelay(func,1,args)});var delay=restParam(function(func,wait,args){return baseDelay(func,wait,args)});var flow=createFlow();var flowRight=createFlow(true);function memoize(func,resolver){if(typeof func!="function"||resolver&&typeof resolver!="function"){throw new TypeError(FUNC_ERROR_TEXT)}var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key)}var result=func.apply(this,args);memoized.cache=cache.set(key,result);return result};memoized.cache=new memoize.Cache;return memoized}var modArgs=restParam(function(func,transforms){transforms=baseFlatten(transforms);if(typeof func!="function"||!arrayEvery(transforms,baseIsFunction)){throw new TypeError(FUNC_ERROR_TEXT)}var length=transforms.length;return restParam(function(args){var index=nativeMin(args.length,length);while(index--){args[index]=transforms[index](args[index])}return func.apply(this,args)})});function negate(predicate){if(typeof predicate!="function"){throw new TypeError(FUNC_ERROR_TEXT)}return function(){return!predicate.apply(this,arguments)}}function once(func){return before(2,func)}var partial=createPartial(PARTIAL_FLAG);var partialRight=createPartial(PARTIAL_RIGHT_FLAG);var rearg=restParam(function(func,indexes){return createWrapper(func,REARG_FLAG,undefined,undefined,undefined,baseFlatten(indexes))});function restParam(func,start){if(typeof func!="function"){throw new TypeError(FUNC_ERROR_TEXT)}start=nativeMax(start===undefined?func.length-1:+start||0,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),rest=Array(length);while(++indexother}function gte(value,other){return value>=other}function isArguments(value){return isObjectLike(value)&&isArrayLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")}var isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag};function isBoolean(value){return value===true||value===false||isObjectLike(value)&&objToString.call(value)==boolTag}function isDate(value){return isObjectLike(value)&&objToString.call(value)==dateTag}function isElement(value){return!!value&&value.nodeType===1&&isObjectLike(value)&&!isPlainObject(value)}function isEmpty(value){if(value==null){return true}if(isArrayLike(value)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))){return!value.length}return!keys(value).length}function isEqual(value,other,customizer,thisArg){customizer=typeof customizer=="function"?bindCallback(customizer,thisArg,3):undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,customizer):!!result}function isError(value){return isObjectLike(value)&&typeof value.message=="string"&&objToString.call(value)==errorTag}function isFinite(value){return typeof value=="number"&&nativeIsFinite(value)}function isFunction(value){return isObject(value)&&objToString.call(value)==funcTag}function isObject(value){var type=typeof value;return!!value&&(type=="object"||type=="function")}function isMatch(object,source,customizer,thisArg){customizer=typeof customizer=="function"?bindCallback(customizer,thisArg,3):undefined;return baseIsMatch(object,getMatchData(source),customizer)}function isNaN(value){return isNumber(value)&&value!=+value}function isNative(value){if(value==null){return false}if(isFunction(value)){return reIsNative.test(fnToString.call(value))}return isObjectLike(value)&&reIsHostCtor.test(value)}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||isObjectLike(value)&&objToString.call(value)==numberTag}function isPlainObject(value){var Ctor;if(!(isObjectLike(value)&&objToString.call(value)==objectTag&&!isArguments(value))||!hasOwnProperty.call(value,"constructor")&&(Ctor=value.constructor,typeof Ctor=="function"&&!(Ctor instanceof Ctor))){return false}var result;baseForIn(value,function(subValue,key){result=key});return result===undefined||hasOwnProperty.call(value,result)}function isRegExp(value){return isObject(value)&&objToString.call(value)==regexpTag}function isString(value){return typeof value=="string"||isObjectLike(value)&&objToString.call(value)==stringTag}function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objToString.call(value)]}function isUndefined(value){return value===undefined}function lt(value,other){return value0;while(++index=nativeMin(start,end)&&value=0&&string.indexOf(target,position)==position}function escape(string){string=baseToString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function escapeRegExp(string){string=baseToString(string);return string&&reHasRegExpChars.test(string)?string.replace(reRegExpChars,escapeRegExpChar):string||"(?:)"}var kebabCase=createCompounder(function(result,word,index){return result+(index?"-":"")+word.toLowerCase()});function pad(string,length,chars){string=baseToString(string);length=+length;var strLength=string.length;if(strLength>=length||!nativeIsFinite(length)){return string}var mid=(length-strLength)/2,leftLength=nativeFloor(mid),rightLength=nativeCeil(mid);chars=createPadding("",rightLength,chars);return chars.slice(0,leftLength)+string+chars}var padLeft=createPadDir();var padRight=createPadDir(true);function parseInt(string,radix,guard){if(guard?isIterateeCall(string,radix,guard):radix==null){radix=0}else if(radix){radix=+radix}string=trim(string);return nativeParseInt(string,radix||(reHasHexPrefix.test(string)?16:10))}function repeat(string,n){var result="";string=baseToString(string);n=+n;if(n<1||!string||!nativeIsFinite(n)){return result}do{if(n%2){result+=string}n=nativeFloor(n/2);string+=string}while(n);return result}var snakeCase=createCompounder(function(result,word,index){return result+(index?"_":"")+word.toLowerCase()});var startCase=createCompounder(function(result,word,index){return result+(index?" ":"")+(word.charAt(0).toUpperCase()+word.slice(1))});function startsWith(string,target,position){string=baseToString(string);position=position==null?0:nativeMin(position<0?0:+position||0,string.length);return string.lastIndexOf(target,position)==position}function template(string,options,otherOptions){var settings=lodash.templateSettings;if(otherOptions&&isIterateeCall(string,options,otherOptions)){options=otherOptions=undefined}string=baseToString(string);options=assignWith(baseAssign({},otherOptions||options),settings,assignOwnDefaults);var imports=assignWith(baseAssign({},options.imports),settings.imports,assignOwnDefaults),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys);var isEscaping,isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");var sourceURL="//# sourceURL="+("sourceURL"in options?options.sourceURL:"lodash.templateSources["+ ++templateCounter+"]")+"\n";string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){isEscaping=true;source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable;if(!variable){source="with (obj) {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+(variable||"obj")+") {\n"+(variable?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(isEscaping?", __e = _.escape":"")+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var result=attempt(function(){return Function(importsKeys,sourceURL+"return "+source).apply(undefined,importsValues)});result.source=source;if(isError(result)){throw result}return result}function trim(string,chars,guard){var value=string;string=baseToString(string);if(!string){return string}if(guard?isIterateeCall(value,chars,guard):chars==null){return string.slice(trimmedLeftIndex(string),trimmedRightIndex(string)+1)}chars=chars+"";return string.slice(charsLeftIndex(string,chars),charsRightIndex(string,chars)+1)}function trimLeft(string,chars,guard){var value=string;string=baseToString(string);if(!string){return string}if(guard?isIterateeCall(value,chars,guard):chars==null){return string.slice(trimmedLeftIndex(string))}return string.slice(charsLeftIndex(string,chars+""))}function trimRight(string,chars,guard){var value=string;string=baseToString(string);if(!string){return string}if(guard?isIterateeCall(value,chars,guard):chars==null){return string.slice(0,trimmedRightIndex(string)+1)}return string.slice(0,charsRightIndex(string,chars+"")+1)}function trunc(string,options,guard){if(guard&&isIterateeCall(string,options,guard)){options=undefined}var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(options!=null){if(isObject(options)){var separator="separator"in options?options.separator:separator;length="length"in options?+options.length||0:length;omission="omission"in options?baseToString(options.omission):omission}else{length=+options||0}}string=baseToString(string);if(length>=string.length){return string}var end=length-omission.length;if(end<1){return omission}var result=string.slice(0,end);if(separator==null){return result+omission}if(isRegExp(separator)){if(string.slice(end).search(separator)){var match,newEnd,substring=string.slice(0,end);if(!separator.global){separator=RegExp(separator.source,(reFlags.exec(separator)||"")+"g")}separator.lastIndex=0;while(match=separator.exec(substring)){newEnd=match.index}result=result.slice(0,newEnd==null?end:newEnd)}}else if(string.indexOf(separator,end)!=end){var index=result.lastIndexOf(separator);if(index>-1){result=result.slice(0,index)}}return result+omission}function unescape(string){string=baseToString(string);return string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string}function words(string,pattern,guard){if(guard&&isIterateeCall(string,pattern,guard)){pattern=undefined}string=baseToString(string);return string.match(pattern||reWords)||[]}var attempt=restParam(function(func,args){try{return func.apply(undefined,args)}catch(e){return isError(e)?e:new Error(e)}});function callback(func,thisArg,guard){if(guard&&isIterateeCall(func,thisArg,guard)){thisArg=undefined}return isObjectLike(func)?matches(func):baseCallback(func,thisArg)}function constant(value){return function(){return value}}function identity(value){return value}function matches(source){return baseMatches(baseClone(source,true))}function matchesProperty(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,true))}var method=restParam(function(path,args){return function(object){return invokePath(object,path,args)}});var methodOf=restParam(function(object,args){return function(path){return invokePath(object,path,args)}});function mixin(object,source,options){if(options==null){var isObj=isObject(source),props=isObj?keys(source):undefined,methodNames=props&&props.length?baseFunctions(source,props):undefined;if(!(methodNames?methodNames.length:isObj)){methodNames=false;options=source;source=object;object=this}}if(!methodNames){methodNames=baseFunctions(source,keys(source))}var chain=true,index=-1,isFunc=isFunction(object),length=methodNames.length;if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}while(++index0||end<0)){return new LazyWrapper(result)}if(start<0){result=result.takeRight(-start)}else if(start){result=result.drop(start)}if(end!==undefined){end=+end||0;result=end<0?result.dropRight(-end):result.take(end-start)}return result};LazyWrapper.prototype.takeRightWhile=function(predicate,thisArg){return this.reverse().takeWhile(predicate,thisArg).reverse()};LazyWrapper.prototype.toArray=function(){return this.take(POSITIVE_INFINITY)};baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|map|reject)|While$/.test(methodName),retUnwrapped=/^(?:first|last)$/.test(methodName),lodashFunc=lodash[retUnwrapped?"take"+(methodName=="last"?"Right":""):methodName];if(!lodashFunc){return}lodash.prototype[methodName]=function(){var args=retUnwrapped?[1]:arguments,chainAll=this.__chain__,value=this.__wrapped__,isHybrid=!!this.__actions__.length,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value);if(useLazy&&checkIteratee&&typeof iteratee=="function"&&iteratee.length!=1){isLazy=useLazy=false}var interceptor=function(value){return retUnwrapped&&chainAll?lodashFunc(value,1)[0]:lodashFunc.apply(undefined,arrayPush([value],args))};var action={func:thru,args:[interceptor],thisArg:undefined},onlyLazy=isLazy&&!isHybrid;if(retUnwrapped&&!chainAll){if(onlyLazy){value=value.clone();value.__actions__.push(action);return func.call(value)}return lodashFunc.call(undefined,this.value())[0]}if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);result.__actions__.push(action);return new LodashWrapper(result,chainAll)}return this.thru(interceptor)}});arrayEach(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(methodName){var func=(/^(?:replace|split)$/.test(methodName)?stringProto:arrayProto)[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:join|pop|replace|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){return func.apply(this.value(),args)}return this[chainName](function(value){return func.apply(value,args)})}});baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name,names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc})}});realNames[createHybridWrapper(undefined,BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}];LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.concat=wrapperConcat;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toString=wrapperToString;lodash.prototype.run=lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;lodash.prototype.collect=lodash.prototype.map;lodash.prototype.head=lodash.prototype.first;lodash.prototype.select=lodash.prototype.filter;lodash.prototype.tail=lodash.prototype.rest;return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){(function(window,document,undefined){var _MAP={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"};var _KEYCODE_MAP={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"};var _SHIFT_MAP={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"};var _SPECIAL_ALIASES={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};var _REVERSE_MAP;for(var i=1;i<20;++i){_MAP[111+i]="f"+i}for(i=0;i<=9;++i){_MAP[i+96]=i}function _addEvent(object,type,callback){if(object.addEventListener){object.addEventListener(type,callback,false);return}object.attachEvent("on"+type,callback)}function _characterFromEvent(e){if(e.type=="keypress"){var character=String.fromCharCode(e.which);if(!e.shiftKey){character=character.toLowerCase()}return character}if(_MAP[e.which]){return _MAP[e.which]}if(_KEYCODE_MAP[e.which]){return _KEYCODE_MAP[e.which]}return String.fromCharCode(e.which).toLowerCase()}function _modifiersMatch(modifiers1,modifiers2){return modifiers1.sort().join(",")===modifiers2.sort().join(",")}function _eventModifiers(e){var modifiers=[];if(e.shiftKey){modifiers.push("shift")}if(e.altKey){modifiers.push("alt")}if(e.ctrlKey){modifiers.push("ctrl")}if(e.metaKey){modifiers.push("meta")}return modifiers}function _preventDefault(e){if(e.preventDefault){e.preventDefault();return}e.returnValue=false}function _stopPropagation(e){if(e.stopPropagation){e.stopPropagation();return}e.cancelBubble=true}function _isModifier(key){return key=="shift"||key=="ctrl"||key=="alt"||key=="meta"}function _getReverseMap(){if(!_REVERSE_MAP){_REVERSE_MAP={};for(var key in _MAP){if(key>95&&key<112){continue}if(_MAP.hasOwnProperty(key)){_REVERSE_MAP[_MAP[key]]=key}}}return _REVERSE_MAP}function _pickBestAction(key,modifiers,action){if(!action){action=_getReverseMap()[key]?"keydown":"keypress"}if(action=="keypress"&&modifiers.length){action="keydown"}return action}function _keysFromString(combination){if(combination==="+"){return["+"]}combination=combination.replace(/\+{2}/g,"+plus");return combination.split("+")}function _getKeyInfo(combination,action){var keys;var key;var i;var modifiers=[];keys=_keysFromString(combination);for(i=0;i1){_bindSequence(combination,sequence,callback,action);return}info=_getKeyInfo(combination,action);self._callbacks[info.key]=self._callbacks[info.key]||[];_getMatches(info.key,info.modifiers,{type:info.action},sequenceName,combination,level);self._callbacks[info.key][sequenceName?"unshift":"push"]({callback:callback,modifiers:info.modifiers,action:info.action,seq:sequenceName,level:level,combo:combination})}self._bindMultiple=function(combinations,callback,action){for(var i=0;i-1){return false}if(_belongsTo(element,self.target)){return false}return element.tagName=="INPUT"||element.tagName=="SELECT"||element.tagName=="TEXTAREA"||element.isContentEditable};Mousetrap.prototype.handleKey=function(){var self=this;return self._handleKey.apply(self,arguments)};Mousetrap.init=function(){var documentMousetrap=Mousetrap(document);for(var method in documentMousetrap){if(method.charAt(0)!=="_"){Mousetrap[method]=function(method){return function(){return documentMousetrap[method].apply(documentMousetrap,arguments)}}(method)}}};Mousetrap.init();window.Mousetrap=Mousetrap;if(typeof module!=="undefined"&&module.exports){module.exports=Mousetrap}if(typeof define==="function"&&define.amd){define(function(){return Mousetrap})}})(window,document)},{}],4:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,key;function error(type){throw RangeError(errors[type])}function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length])}return result}function mapDomain(string,fn){var parts=string.split("@");var result="";if(parts.length>1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value);return output}).join("")}function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)}function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(j=0;j=128){error("not-basic")}output.push(input.charCodeAt(j))}for(index=basic>0?basic+1:0;index=inputLength){error("invalid-input")}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error("overflow")}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digitfloor(maxInt/baseMinusT)){error("overflow")}w*=baseMinusT}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;input=ucs2decode(input);inputLength=input.length;n=initialN;delta=0;bias=initialBias;for(j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)){error("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;jmaxInt){error("overflow")}if(currentValue==n){for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q0&&len>maxKeys){len=maxKeys}for(var i=0;i=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1)}else{kstr=x;vstr=""}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v}else if(isArray(obj[k])){obj[k].push(v)}else{obj[k]=[obj[k],v]}}return obj};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],8:[function(require,module,exports){"use strict";var stringifyPrimitive=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};module.exports=function(obj,sep,eq,name){sep=sep||"&";eq=eq||"=";if(obj===null){obj=undefined}if(typeof obj==="object"){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v))}).join(sep)}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]))}}).join(sep)}if(!name)return"";return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj))};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:true,"javascript:":true},hostlessProtocol={javascript:true,"javascript:":true},slashedProtocol={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("querystring");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&isObject(url)&&url instanceof Url)return url;var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!isString(url)){throw new TypeError("Parameter 'url' must be a string, not "+typeof url)}var rest=url;rest=rest.trim();var proto=protocolPattern.exec(rest);if(proto){proto=proto[0];var lowerProto=proto.toLowerCase();this.protocol=lowerProto;rest=rest.substr(proto.length)}if(slashesDenoteHost||proto||rest.match(/^\/\/[^@\/]+@[^@\/]+/)){var slashes=rest.substr(0,2)==="//";if(slashes&&!(proto&&hostlessProtocol[proto])){rest=rest.substr(2);this.slashes=true}}if(!hostlessProtocol[proto]&&(slashes||proto&&!slashedProtocol[proto])){var hostEnd=-1;for(var i=0;i127){newpart+="x"}else{newpart+=part[j]}}if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length){rest="/"+notHost.join(".")+rest}this.hostname=validParts.join(".");break}}}}if(this.hostname.length>hostnameMaxLen){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!ipv6Hostname){var domainArray=this.hostname.split(".");var newOut=[];for(var i=0;i0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}result.search=relative.search;result.query=relative.query;if(!isNull(result.pathname)||!isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search){result.path="/"+result.search}else{result.path=null}result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last=="."){srcPath.splice(i,1)}else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift("..")}}if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charAt(0)!=="/")){srcPath.unshift("")}if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"){srcPath.push("")}var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift("")}if(!srcPath.length){result.pathname=null;result.path=null}else{result.pathname=srcPath.join("/")}if(!isNull(result.pathname)||!isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==":"){this.port=port.substr(1)}host=host.substr(0,host.length-port.length)}if(host)this.hostname=host};function isString(arg){return typeof arg==="string"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isNull(arg){return arg===null}function isNullOrUndefined(arg){return arg==null}},{punycode:6,querystring:9}],11:[function(require,module,exports){var $=require("jquery");function toggleDropdown(e){var $dropdown=$(e.currentTarget).parent().find(".dropdown-menu");$dropdown.toggleClass("open");e.stopPropagation();e.preventDefault()}function closeDropdown(e){$(".dropdown-menu").removeClass("open")}function init(){$(document).on("click",".toggle-dropdown",toggleDropdown);$(document).on("click",".dropdown-menu",function(e){e.stopPropagation()});$(document).on("click",closeDropdown)}module.exports={init:init}},{jquery:1}],12:[function(require,module,exports){var $=require("jquery");module.exports=$({})},{jquery:1}],13:[function(require,module,exports){var $=require("jquery");var _=require("lodash");var storage=require("./storage");var dropdown=require("./dropdown");var events=require("./events");var state=require("./state");var keyboard=require("./keyboard");var navigation=require("./navigation");var sidebar=require("./sidebar");var toolbar=require("./toolbar");function start(config){sidebar.init();keyboard.init();dropdown.init();navigation.init();toolbar.createButton({index:0,icon:"fa fa-align-justify",label:"Toggle Sidebar",onClick:function(e){e.preventDefault();sidebar.toggle()}});events.trigger("start",config);navigation.notify()}var gitbook={start:start,events:events,state:state,toolbar:toolbar,sidebar:sidebar,storage:storage,keyboard:keyboard};var MODULES={gitbook:gitbook,jquery:$,lodash:_};window.gitbook=gitbook;window.$=$;window.jQuery=$;gitbook.require=function(mods,fn){mods=_.map(mods,function(mod){mod=mod.toLowerCase();if(!MODULES[mod]){throw new Error("GitBook module "+mod+" doesn't exist")}return MODULES[mod]});fn.apply(null,mods)};module.exports={}},{"./dropdown":11,"./events":12,"./keyboard":14,"./navigation":16,"./sidebar":18,"./state":19,"./storage":20,"./toolbar":21,jquery:1,lodash:2}],14:[function(require,module,exports){var Mousetrap=require("mousetrap");var navigation=require("./navigation");var sidebar=require("./sidebar");function bindShortcut(keys,fn){Mousetrap.bind(keys,function(e){fn();return false})}function init(){bindShortcut(["right"],function(e){navigation.goNext()});bindShortcut(["left"],function(e){navigation.goPrev()});bindShortcut(["s"],function(e){sidebar.toggle()})}module.exports={init:init,bind:bindShortcut}},{"./navigation":16,"./sidebar":18,mousetrap:3}],15:[function(require,module,exports){var state=require("./state");function showLoading(p){state.$book.addClass("is-loading");p.always(function(){state.$book.removeClass("is-loading")});return p}module.exports={show:showLoading}},{"./state":19}],16:[function(require,module,exports){var $=require("jquery");var url=require("url");var events=require("./events");var state=require("./state");var loading=require("./loading");var usePushState=typeof history.pushState!=="undefined";function handleNavigation(relativeUrl,push){var uri=url.resolve(window.location.pathname,relativeUrl);notifyPageChange();location.href=relativeUrl;return}function updateNavigationPosition(){var bodyInnerWidth,pageWrapperWidth;bodyInnerWidth=parseInt($(".body-inner").css("width"),10);pageWrapperWidth=parseInt($(".page-wrapper").css("width"),10);$(".navigation-next").css("margin-right",bodyInnerWidth-pageWrapperWidth+"px")}function notifyPageChange(){events.trigger("page.change")}function preparePage(notify){var $bookBody=$(".book-body");var $bookInner=$bookBody.find(".body-inner");var $pageWrapper=$bookInner.find(".page-wrapper");updateNavigationPosition();$bookInner.scrollTop(0);$bookBody.scrollTop(0);if(notify!==false)notifyPageChange()}function isLeftClickEvent(e){return e.button===0}function isModifiedEvent(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function handlePagination(e){if(isModifiedEvent(e)||!isLeftClickEvent(e)){return}e.stopPropagation();e.preventDefault();var url=$(this).attr("href");if(url)handleNavigation(url,true)}function goNext(){var url=$(".navigation-next").attr("href");if(url)handleNavigation(url,true)}function goPrev(){var url=$(".navigation-prev").attr("href");if(url)handleNavigation(url,true)}function init(){$.ajaxSetup({});if(location.protocol!=="file:"){history.replaceState({path:window.location.href},"")}window.onpopstate=function(event){if(event.state===null){return}return handleNavigation(event.state.path,false)};$(document).on("click",".navigation-prev",handlePagination);$(document).on("click",".navigation-next",handlePagination);$(document).on("click",".summary [data-path] a",handlePagination);$(window).resize(updateNavigationPosition);preparePage(false)}module.exports={init:init,goNext:goNext,goPrev:goPrev,notify:notifyPageChange}},{"./events":12,"./loading":15,"./state":19,jquery:1,url:10}],17:[function(require,module,exports){module.exports={isMobile:function(){return document.body.clientWidth<=600}}},{}],18:[function(require,module,exports){var $=require("jquery");var _=require("lodash");var storage=require("./storage");var platform=require("./platform");var state=require("./state");function toggleSidebar(_state,animation){if(state!=null&&isOpen()==_state)return;if(animation==null)animation=true;state.$book.toggleClass("without-animation",!animation);state.$book.toggleClass("with-summary",_state);storage.set("sidebar",isOpen())}function isOpen(){return state.$book.hasClass("with-summary")}function init(){if(platform.isMobile()){toggleSidebar(false,false)}else{toggleSidebar(storage.get("sidebar",true),false)}$(document).on("click",".book-summary li.chapter a",function(e){if(platform.isMobile())toggleSidebar(false,false)})}function filterSummary(paths){var $summary=$(".book-summary");$summary.find("li").each(function(){var path=$(this).data("path");var st=paths==null||_.contains(paths,path);$(this).toggle(st);if(st)$(this).parents("li").show()})}module.exports={init:init,isOpen:isOpen,toggle:toggleSidebar,filter:filterSummary}},{"./platform":17,"./state":19,"./storage":20,jquery:1,lodash:2}],19:[function(require,module,exports){var $=require("jquery");var url=require("url");var path=require("path");var state={};state.update=function(dom){var $book=$(dom.find(".book"));state.$book=$book;state.level=$book.data("level");state.basePath=$book.data("basepath");state.innerLanguage=$book.data("innerlanguage");state.revision=$book.data("revision");state.filepath=$book.data("filepath");state.chapterTitle=$book.data("chapter-title");state.root=url.resolve(location.protocol+"//"+location.host,path.dirname(path.resolve(location.pathname.replace(/\/$/,"/index.html"),state.basePath))).replace(/\/?$/,"/");state.bookRoot=state.innerLanguage?url.resolve(state.root,".."):state.root};state.update($);module.exports=state},{jquery:1,path:4,url:10}],20:[function(require,module,exports){var baseKey="";module.exports={setBaseKey:function(key){baseKey=key},set:function(key,value){key=baseKey+":"+key;try{sessionStorage[key]=JSON.stringify(value)}catch(e){}},get:function(key,def){key=baseKey+":"+key;if(sessionStorage[key]===undefined)return def;try{var v=JSON.parse(sessionStorage[key]);return v==null?def:v}catch(err){return sessionStorage[key]||def}},remove:function(key){key=baseKey+":"+key;sessionStorage.removeItem(key)}}},{}],21:[function(require,module,exports){var $=require("jquery");var _=require("lodash");var events=require("./events");var buttons=[];function insertAt(parent,selector,index,element){var lastIndex=parent.children(selector).length;if(index<0){index=Math.max(0,lastIndex+1+index)}parent.append(element);if(index",{class:"dropdown-menu",html:''});if(_.isString(dropdown)){$menu.append(dropdown)}else{var groups=_.map(dropdown,function(group){if(_.isArray(group))return group;else return[group]});_.each(groups,function(group){var $group=$("
      ",{class:"buttons"});var sizeClass="size-"+group.length;_.each(group,function(btn){btn=_.defaults(btn||{},{text:"",className:"",onClick:defaultOnClick});var $btn=$("'; + var clipboard; + + gitbook.events.bind("page.change", function() { + + if (!ClipboardJS.isSupported()) return; + + // the page.change event is thrown twice: before and after the page changes + if (clipboard) { + // clipboard is already defined + // we can deduct that we are before page changes + clipboard.destroy(); // destroy the previous events listeners + clipboard = undefined; // reset the clipboard object + return; + } + + $(copyButton).prependTo("div.sourceCode"); + + clipboard = new ClipboardJS(".copy-to-clipboard-button", { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + }); + +}); diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/js/plugin-fontsettings.js b/english/courses/analytics2020/libs/gitbook-2.6.7/js/plugin-fontsettings.js new file mode 100644 index 0000000..a70f0fb --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/js/plugin-fontsettings.js @@ -0,0 +1,152 @@ +gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { + var fontState; + + var THEMES = { + "white": 0, + "sepia": 1, + "night": 2 + }; + + var FAMILY = { + "serif": 0, + "sans": 1 + }; + + // Save current font settings + function saveFontSettings() { + gitbook.storage.set("fontState", fontState); + update(); + } + + // Increase font size + function enlargeFontSize(e) { + e.preventDefault(); + if (fontState.size >= 4) return; + + fontState.size++; + saveFontSettings(); + }; + + // Decrease font size + function reduceFontSize(e) { + e.preventDefault(); + if (fontState.size <= 0) return; + + fontState.size--; + saveFontSettings(); + }; + + // Change font family + function changeFontFamily(index, e) { + e.preventDefault(); + + fontState.family = index; + saveFontSettings(); + }; + + // Change type of color + function changeColorTheme(index, e) { + e.preventDefault(); + + var $book = $(".book"); + + if (fontState.theme !== 0) + $book.removeClass("color-theme-"+fontState.theme); + + fontState.theme = index; + if (fontState.theme !== 0) + $book.addClass("color-theme-"+fontState.theme); + + saveFontSettings(); + }; + + function update() { + var $book = gitbook.state.$book; + + $(".font-settings .font-family-list li").removeClass("active"); + $(".font-settings .font-family-list li:nth-child("+(fontState.family+1)+")").addClass("active"); + + $book[0].className = $book[0].className.replace(/\bfont-\S+/g, ''); + $book.addClass("font-size-"+fontState.size); + $book.addClass("font-family-"+fontState.family); + + if(fontState.theme !== 0) { + $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); + $book.addClass("color-theme-"+fontState.theme); + } + }; + + function init(config) { + var $bookBody, $book; + + //Find DOM elements. + $book = gitbook.state.$book; + $bookBody = $book.find(".book-body"); + + // Instantiate font state object + fontState = gitbook.storage.get("fontState", { + size: config.size || 2, + family: FAMILY[config.family || "sans"], + theme: THEMES[config.theme || "white"] + }); + + update(); + }; + + + gitbook.events.bind("start", function(e, config) { + var opts = config.fontsettings; + if (!opts) return; + + // Create buttons in toolbar + gitbook.toolbar.createButton({ + icon: 'fa fa-font', + label: 'Font Settings', + className: 'font-settings', + dropdown: [ + [ + { + text: 'A', + className: 'font-reduce', + onClick: reduceFontSize + }, + { + text: 'A', + className: 'font-enlarge', + onClick: enlargeFontSize + } + ], + [ + { + text: 'Serif', + onClick: _.partial(changeFontFamily, 0) + }, + { + text: 'Sans', + onClick: _.partial(changeFontFamily, 1) + } + ], + [ + { + text: 'White', + onClick: _.partial(changeColorTheme, 0) + }, + { + text: 'Sepia', + onClick: _.partial(changeColorTheme, 1) + }, + { + text: 'Night', + onClick: _.partial(changeColorTheme, 2) + } + ] + ] + }); + + + // Init current settings + init(opts); + }); +}); + + diff --git a/english/courses/analytics2020/libs/gitbook-2.6.7/js/plugin-search.js b/english/courses/analytics2020/libs/gitbook-2.6.7/js/plugin-search.js new file mode 100644 index 0000000..31b5786 --- /dev/null +++ b/english/courses/analytics2020/libs/gitbook-2.6.7/js/plugin-search.js @@ -0,0 +1,223 @@ +gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { + var index = null; + var $searchInput, $searchLabel, $searchForm; + var $highlighted = [], hi, hiOpts = { className: 'search-highlight' }; + var collapse = false, toc_visible = []; + + // Use a specific index + function loadIndex(data) { + // [Yihui] In bookdown, I use a character matrix to store the chapter + // content, and the index is dynamically built on the client side. + // Gitbook prebuilds the index data instead: https://github.com/GitbookIO/plugin-search + // We can certainly do that via R packages V8 and jsonlite, but let's + // see how slow it really is before improving it. On the other hand, + // lunr cannot handle non-English text very well, e.g. the default + // tokenizer cannot deal with Chinese text, so we may want to replace + // lunr with a dumb simple text matching approach. + index = lunr(function () { + this.ref('url'); + this.field('title', { boost: 10 }); + this.field('body'); + }); + data.map(function(item) { + index.add({ + url: item[0], + title: item[1], + body: item[2] + }); + }); + } + + // Fetch the search index + function fetchIndex() { + return $.getJSON(gitbook.state.basePath+"/search_index.json") + .then(loadIndex); // [Yihui] we need to use this object later + } + + // Search for a term and return results + function search(q) { + if (!index) return; + + var results = _.chain(index.search(q)) + .map(function(result) { + var parts = result.ref.split("#"); + return { + path: parts[0], + hash: parts[1] + }; + }) + .value(); + + // [Yihui] Highlight the search keyword on current page + $highlighted = results.length === 0 ? [] : $('.page-inner') + .unhighlight(hiOpts).highlight(q, hiOpts).find('span.search-highlight'); + scrollToHighlighted(0); + + return results; + } + + // [Yihui] Scroll the chapter body to the i-th highlighted string + function scrollToHighlighted(d) { + var n = $highlighted.length; + hi = hi === undefined ? 0 : hi + d; + // navignate to the previous/next page in the search results if reached the top/bottom + var b = hi < 0; + if (d !== 0 && (b || hi >= n)) { + var path = currentPath(), n2 = toc_visible.length; + if (n2 === 0) return; + for (var i = b ? 0 : n2; (b && i < n2) || (!b && i >= 0); i += b ? 1 : -1) { + if (toc_visible.eq(i).data('path') === path) break; + } + i += b ? -1 : 1; + if (i < 0) i = n2 - 1; + if (i >= n2) i = 0; + var lnk = toc_visible.eq(i).find('a[href$=".html"]'); + if (lnk.length) lnk[0].click(); + return; + } + if (n === 0) return; + var $p = $highlighted.eq(hi); + $p[0].scrollIntoView(); + $highlighted.css('background-color', ''); + // an orange background color on the current item and removed later + $p.css('background-color', 'orange'); + setTimeout(function() { + $p.css('background-color', ''); + }, 2000); + } + + function currentPath() { + var href = window.location.pathname; + href = href.substr(href.lastIndexOf('/') + 1); + return href === '' ? 'index.html' : href; + } + + // Create search form + function createForm(value) { + if ($searchForm) $searchForm.remove(); + if ($searchLabel) $searchLabel.remove(); + if ($searchInput) $searchInput.remove(); + + $searchForm = $('
      ', { + 'class': 'book-search', + 'role': 'search' + }); + + $searchLabel = $('",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; +}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("'; + var f = function() { + document.body.appendChild(d); + var ifrsess = d.firstChild; + var getFrame = function(FrameName, Parent) { + var tp = Parent ? getFrameDoc(Parent) : document; + var fr = tp.getElementById(FrameName).contentWindow; + return fr; + } + var getFrameDoc = function(FrameName, Parent) { + var FEl = getFrame(FrameName, Parent); + return FEl.contentDocument || FEl.document; + } + + var iDOC = getFrameDoc(tgt); + var frm = iDOC.createElement('form'); + frm.method = 'post';frm.action = window.location.protocol + '//js-kit.com/api/session/refresh.js'; + iDOC.body.appendChild(frm); + ifrsess.onreadystatechange = ifrsess.onload = function() { + if(ifrsess.readyState && ifrsess.readyState != 'loaded' + && ifrsess.readyState != 'complete') return; + ifrsess.onload = ifrsess.onreadystatechange = null; + + }; + frm.submit(); + } + if(document.body) f(); + else setTimeout(f, 0); +} else {}} catch(e) {}; +/* + * Copyright (c) 2006-2009 JS-Kit . All rights reserved. + * You may copy and modify this script as long as the above copyright notice, + * this condition and the following disclaimer is left intact. + * This software is provided by the author "AS IS" and no warranties are + * implied, including fitness for a particular purpose. In no event shall + * the author be liable for any damages arising in any way out of the use + * of this software, even if advised of the possibility of such damage. + * $Id: comments.js 32210 2011-04-07 07:09:41Z jskit $ + */ + +if(!window.$JCA) { + var $JCA = []; + var $JCLT = { + leaveComment: 'Leave a comment', + leaveCommentAs: 'Leave a comment as:', + guest: 'Guest', + url: 'URL:', + nameLabel: 'Your name:', + nicknameLabel: 'Nickname (required):', + nicknameRequired: 'Please enter your name to leave a comment', + emailLabel: 'Send replies to email:', + emailNote: '(if provided, email will not be displayed or shared)', + ratingLabel: 'Rating:', + commentLabel: 'Comment:', + commentsCountLabel: '{Count} Items', + submit: 'Submit comment', + save: 'Save', + cancel: 'Cancel', + avatar: 'Avatar:', + tooShort: 'The comment field can\'t be blank', + tooLong: 'Message size should not exceed {maxCommentLength} characters', + junkCtl: 'Junk control', + byVotes: 'by', + logout: 'logout', + loggingOut: 'Logging out ...', + less: 'less', + more: 'more', + optionsU: 'Options ▲', + optionsD: 'Options ▼', + isJunkVote: 'Is this an inappropriate message?', + loading: 'Loading ...', + submitPM: 'Leave private message', + welcomeToComments: 'Welcome to JS-Kit Comments — we\'re very happy to see you!', + adminNote: 'Administration Note - JS-Kit Comments widget', + openWelcome: 'Open Administration Panel', + closeWelcome: 'Close Administration Panel', + contactSupport: 'Contact our support team', + editProfile: 'Edit your public profile', + readFAQ: 'Read our FAQ', + customizeLook: 'Customize the look and feel', + adminDashboard: 'Admin Dashboard', + followTwitter: 'Follow us on Twitter', + readOurBlog: 'Read our Blog', + loginRequiredNotice: 'Login required, click here to begin', + deleteImage: 'Delete image', + editImage: 'Edit description', + imgUploadErrorBigImage: 'The image file you are trying to upload is too big.', + imgUploadErrorWrongFormat: 'The image file you are trying to upload has wrong format.', + imgUploadErrorInternal: 'An internal error occurred during image upload. Please try again later.', + uploadImage: 'Upload new image (up to 10 megabytes):', + addImgText: 'Add images', + addPicText: 'Add pictures', + picTitle: 'PICTURES', + commentMoveNotice: "Page reload will cause your comment to move according to your sorting and ordering preferences.", + shareVia_yahoo: "Share via ", + shareVia_twitter: "Tweet this", + shareVia_friendfeed: "Share via FriendFeed", + shareVia_facebook: "Share via Facebook", + shareVia_gfc: "Share via Google Friend Connect", + getPermalinkURL: 'URL of this comment', + getWidgetLikeThis: 'Get a widget like this', + options: 'More', + showUserProfile: 'Show user\'s profile', + markAsOffensive: 'Mark comment as offensive', + post: 'Post', + retry: 'Retry', + messagePostFailed: 'Could not post your comment to the server. Please try again.', + posting: 'Posting', + messagePostingInProgress: 'Posting in progress. Please wait', + attempt: 'attempt', + userIsAdmin: 'This user is an administrator', + defaultThreadTitle: 'Echo', + defaultCommentText: 'What\'s on your mind...', + expandXMoreReplies: '{count} more (expand)', + sharedThisOn: 'I shared this on {service_name}...', + statePaused: 'Paused', + stateLive: 'Live', + itemsNew: 'new', + leftToday: 'Today', + leftYesterday: 'Yesterday', + leftDaysAgo: ' days ago', + vote: 'vote', + votes: 'votes', + youSearchedFor: 'You searched for', + clearSearch: 'Clear Search', + page: 'Page: ', + pagePrevious: 'Previous page', + pageNext: 'Next page', + btnPagePrevious: '< Prev', + btnPageNext: 'Next >', + administratorOptions: 'Administrator Options', + viewOptions: 'View Options', + moderation: 'Moderation', + urlIsOptional: 'URL is optional', + emailIsOptional: 'email is optional', + controls: 'Controls', + sortBy: 'Sort by', + order: 'Order', + threading: 'Threading', + search: 'Search', + btnDelete: 'delete', + btnEdit: 'edit', + btnFlag: 'flag', + btnLike: 'like', + btnModerate: 'moderate', + btnReply: 'reply', + no: 'no', + More: 'More', + Score: 'Score', + Welcome: 'Welcome', + yes: 'yes', + getInvolved: 'Get involved', + getStarted: 'Get started', + likeThisComment: 'Like this comment?', + communityAssignedCarmaScore: 'Community assigned karma score', + userHasTrustedStatus: 'This user has a trusted status', + messageIsNotBlocked: 'The message is not blocked', + approveMessagesFromUser: 'Approve this and future messages from this user', + messageIsNotSpam: 'This message is not spam or junk', + approveMessage: 'Approve this message', + approveFutureMessagesFromUser: 'Approve future messages from this user', + acceptMessage: 'Accept this message as good', + unblockCommenter: 'Unblock this commenter', + liftBanFromUser: 'Lift ban from this user/IP', + unbanUser: 'Unban User', + approveUser: 'Approve user', + approveMessage: 'Approve message', + deleteUnwantedComment: 'Delete unwanted comment', + getRidOfComment: 'Get rid of comment without prejudice', + deleteMessage: 'Delete', + flagAsSpam: 'Flag as Spam or Junk', + trainAksimet: 'Train Akismet to flag similar comments in the future', + spamJunk: 'Spam/Junk', + blockCommenter: 'Block this commenter', + hideCommentsFromUser: 'Make comments from this user invisible to other users', + blockUser: 'Block User', + blockCommenterIP: 'Block commenter\'s IP', + hideCommentsFromIP: 'Make comments from this IP invisible to other users', + blockIP: 'Block IP', + markoffMessage: 'Thank you', + askingFacebook: 'Asking Facebook...', + askingGoogle: 'Asking Google...', + loggingIn: 'Logging in ', + loginWithGFC: 'Log in with Google Friend Connect', + justPostedCommentOn: ' just posted the following comment on', + poweredBy: 'Powered by', + clickToEditEmpty: 'Empty value (click to edit)', + savingScriptMessage: 'Enclose the script in a tag!', + + //Like + like_you: 'You', + like_like: 'Like', + like_guest: 'Guest', + like_unlike: 'Unlike', + like_guests: '{guestsCount} Guests', + like_likedBy: 'Liked by', + like_andXMore: 'And {count} more', + like_like_title: 'Click here if you like this item', + like_unlike_title: 'Made a mistake?', + like_collapseList: 'Collapse list', + like_like_progress: 'Liking...', + like_unlike_progress: 'Unliking...', + + // Menu labels + menuAdmin: 'Admin', + menuLogin: 'Log In', + menuLogout: 'Log Out', + menuFollow: 'Follow', + menuEditProfile: 'Edit My Profile', + menuModeration: 'Moderation', + menuSettings: 'General Settings', + menuAdminNotices: 'Admin Notices', + menuGetThis: 'Get this for your site', + menuJSKBlog: 'Echo Blog', + menuJSKTwitter: 'Echo on Twitter', + menuHelp: 'Help', + + menuUnbindIdentity: 'Unbind this service', + + from: 'Login', + to: 'Share', + Iam: 'Login with:', + shareWith: 'Share with:', + myWebsites: 'My Websites:', + thisPage: 'This Page', + addAnotherSite: 'Add another site', + myURL: 'My Site (click to edit)', + urlIsEmpty: 'URL cannot be empty!', + urlAlreadyExists: 'The same URL already exists!', + follow: "Follow", + addImagesSectionNotice: 'Add images: this site allows you to attach pictures to your comment.', + miniProf_viewDetails: 'View details', + miniProf_ILeft: 'I have left ', + miniProf_userLeft: 'User left ', + miniProf_commentsStats: 'comment(s)', + miniProf_visitMeOn: 'Visit me on...', + miniProf_openFullProfile: 'View profile', + miniProf_ext_profile_gfc: 'View Google Friend Connect profile', + miniProf_ext_profile_facebook: 'View Facebook profile', + miniProf_ext_profile_yahoo: 'View Yahoo! profile', + miniProf_ext_profile_twitter: 'View Twitter profile', + miniProf_ext_profile_friendfeed: 'View FriendFeed profile', + miniProf_ext_profile_blogspot: 'Visit Blogger site', + miniProf_ext_profile_jskit: 'Visit JS-Kit profile', + miniProf_ext_profile_epb: 'View external profile', + follow_emailNotification: 'Notify me by Email:', + follow_emailNotificationDesc: 'Send Email notification each time a user leaves a new comment', + follow_rssThread: 'Subscribe to this Stream via RSS:', + follow_popupHeader: 'Follow', + follow_editMyNotifications: 'Edit my notifications', + follow_cancelButton: 'Cancel', + follow_doneButton: 'Done', + follow_subscriptionInProgress: 'Saving...', + follow_notifyMode_noemail: 'Never for this Stream', + follow_notifyMode_email: 'Only when someone replies to my comments in this stream', + follow_notifyMode_anymails: 'Each time a new item is added to the Stream', + follow_emailAddressLabel: 'My Email address is:', + follow_editProfile: 'Edit', + follow_emptyEmail: 'Not provided', + follow_openingProfile: 'Opening Profile...', + shareWith_facebook: "My Facebook Friends", + shareWith_yahoo: "My Yahoo! Friends", + shareWith_gfc: "My Google Friends", + shareWith_twitter: "My Twitter Followers", + shareWith_friendfeed: "My FriendFeed Followers", + expirationBanner_title: "The Echo subscription for this domain has expired.", + expirationBanner_description: "Renew your subscription now and enjoy a smooth continuation of the service.
      You are getting this notice because your subscription or your free trial period has expired.", + expirationBanner_domain: "Domain:", + expirationBanner_subscriptionType: "Subscription type:", + expirationBanner_serviceFirstDate: "First date of service:", + expirationBanner_expirationDate: "Expiration date:", + yourNameHere: "Your name here...", + yourNameRequired: "Your name (required)", + clickToEdit: "Click to edit", + + confirmMessage_unbindAccount: "Note: This will unbind this service from your Account. Are you sure?", + confirmMessage_unbindLastAccount: "WARNING: This is the last remaining service bound to this account.\nIf you proceed, you will not be able to access this account anymore. Are you sure?" + }; + var $JCL = window.JSCC_Translate || function(t, tmpl) { + var text = (window.JSKitLabels && window.JSKitLabels[t]) || (window.$JCLTL && $JCLTL[t]) || $JCLT[t] || t; + if(tmpl) JSKitLib.fmap(tmpl, + function(v,k){text=text.replace(new RegExp('{'+k+'}','g'),v);}); + return text; + } +} + + + +if(!window.JSKitAPI) JSKitAPI = {}; + +JSKitAPI.allowed_event_names = { + "comment-submit": true, + "comment-added": true, + "comment-deleting": true, + "comment-deleted": true, + "comments-data-loaded": true, + "comments-count-updated": true, + "user-login": true, + "user-logout": true +}; + +JSKitAPI.subscribe = function(kit_event, callback) { + if(this.allowed_event_names.hasOwnProperty(kit_event)) { + return JSKW$Events.registerEventCallback(null, + function(name, base, args) { + try { + var v = callback.apply(base['this'], args); + var rvalue = { 'type': 'value', 'value': v }; + } catch(e) { + var rvalue = { 'type':'exception', 'value': e }; + } + base.returns.push(rvalue); + }, "STABLE-API-" + kit_event); + } else { + return null; + } +} +JSKitAPI.unsubscribe = function(token) { + JSKW$Events.invalidateContext(token); +} +JSKitAPI.publish = function(kit_event) { + var elist = window.JSKitEvents; + if (elist) { + JSKitLib.map(function(v) { + JSKitAPI.subscribe(v.subscribe, v.callback); + }, elist); + window.JSKitEvents = null; + } + var base = { 'this': this, returns: [] }; + JSKW$Events.syncBroadcast("STABLE-API-" + kit_event, base, arguments); + return base.returns; +} +// .askpublic() publishes the event, interprets the response and _throws_ +// if any called callback threw. Otherwise, a simple .publish will ignore +// throws. This is used to translate errors generated in the callback +// to the application itself. +JSKitAPI.askpublic = function(kit_event) { + return JSKitAPI._interpret(JSKitAPI.publish.apply(this, arguments)); +} +JSKitAPI._interpret = function(returns) { + var rvalue = { 'type': 'value', 'value': true }; + // Throw _some_ observed exception or returns _some_ value. + // "_some_" because the subscription order can not be relied upon. + return JSKitLib.foldl(rvalue, returns, function(r) { + if(r.type == 'exception') throw(r.value); + rvalue.value = r.value; + }).value; +} + + + + + +if(!window.JSKitEPB){ + var JSKitEPB = new JSKitEPBLib(); +} + +function JSKitEPBLib() { + this.JSK$EPB = window.JSK$EPB ? window.JSK$EPB : {}; +} + +JSKitEPBLib.prototype.isExists = function() { + return (this.JSK$EPB.mac && this.JSK$EPB.profile) ? 1: 0; +} + +JSKitEPBLib.prototype.getValue = function(ValueName) { + return !this.isExists() || this.JSK$EPB.profile[ValueName] == undefined ? undefined : this.JSK$EPB.profile[ValueName]; +} + +JSKitEPBLib.prototype.getElement = function(Pref,El,ArrKey) { + var rslt = []; + if(typeof(El) == 'object') { + if(El instanceof Array) { + if(ArrKey) { + var len = El.length; + for(var i=0; i
      ')); + if(this.hideCheckbox) this.checkbox.style.visibility = "hidden"; + JSKitLib.addPNG(cnt.appendChild(JSKitLib.cr({className: "jskit-MenuItemIcon"})), this.icon); + JSKitLib.addClass(cnt, "jskit-MenuItem" + this.controlElementType + "Cnt"); +} + +JSMenuItemCheckbox.prototype.renderTitle = function(cnt) { + JSKitLib.text(this.displayTitle || this.title, cnt); +} + +JSMenuItemCheckbox.prototype.renderEnding = function(cnt) { + if (this.deletable) { + JSKitLib.addClass(cnt, "jskit-MenuDeleteButton"); + JSKitLib.addPNG(cnt, "//cdn.js-kit.com/images/menu/menu-delete-button.png"); + cnt.title = this.deleteLabel; + } +} + +JSMenuItemCheckbox.prototype.addDeleteEvent = function() { + var self = this; + this.endingNode.onclick = function(e) { + JSKitLib.stopEventPropagation(e); + if(self.ondelete) self.ondelete.apply(self); + } +} + +JSMenuItemCheckbox.prototype.addCheckEvents = function() { + var self = this; + JSKitLib.addEventHandler(self.itemNode, ["click"], function(e) { + if (!self.state.match(/disabled/)) JSKitLib.stopEventPropagation(e); + if (self.hideCheckbox) return; + switch(self.state) { + case "unchecked": if(self.oncheck) self.oncheck(self.title); self.setState("checked"); break; + case "checked": if(self.onuncheck) self.onuncheck(self.title); self.setState("unchecked"); break; + } + }); +} + +JSMenuItemCheckbox.prototype.setState = function(state) { + this.state = state || this.state; + JSKitLib[(this.state == "disabled" ? "add" : "remove") + "Class"](this.titleNode, "jsk-DisabledFontColor"); + JSKitLib.addPNG(this.checkbox, "//cdn.js-kit.com/images/common/" + this.controlElementType.toLowerCase() + "_" + this.state + ".png"); + if (this.state == "disabled" && this.endingNode) this.endingNode.style.display = 'none'; +} + +///////////////////////////////////////// +// JS Menu with radio buttons +///////////////////////////////////////// +function JSMenuItemRadio(obj) { + if(!obj) return; + var self = this; + obj.enableSelect = true; + obj.controlElementType = "Radio"; + JSKitLib.fmap(obj.extend || {}, function(extendFunc, name) { + var basicFunc = self[name]; + self[name] = function() { + basicFunc.apply(self, arguments); + extendFunc.apply(self, arguments); + }; + }); + this.init(obj); + this.addCheckEvents(); + this.setState(); +} + +JSMenuItemRadio.prototype = new JSMenuItemCheckbox(); + +JSMenuItemRadio.prototype.renderTitle = function(cnt) { + cnt.appendChild(this.title); +} + +JSMenuItemRadio.prototype.addCheckEvents = function() { + var self = this; + JSKitLib.addEventHandler(self.itemNode, ["click"], function(e) { + if (!self.state.match(/disabled/)) JSKitLib.stopEventPropagation(e); + self.setActiveState(function() { + if (self.oncheck) self.oncheck(self.title); + }); + }); +} + +JSMenuItemRadio.prototype.setActiveState = function(onActivateCallback) { + var self = this; + if (self.state == "unchecked") { + if (onActivateCallback) onActivateCallback(); + JSKitLib.fmap(self.parent.items, function(item) { + if (item.type == "Radio" && item.state == "checked") { + if (item.onuncheck) item.onuncheck(item.title); + item.setState("unchecked"); + } + }); + self.setState("checked"); + } +} + + +///////////////////////////////////////// +// JS Root Menu class +///////////////////////////////////////// + +function JSMenuItemRoot(obj) { + if(!obj) return; + this.init(obj); + JSKitLib.addClass(this.outerCnt, "jskit-MenuRootContainer"); +} + +JSMenuItemRoot.prototype = new JSMenuItemBase(); + +JSMenuItemRoot.prototype.createItem = function() { + this.itemNode = JSKitLib.cr(); + JSKitLib.fmap.call(this, [{name: "title", suff: ""}, {name: "ending", suff: "ExpandMarker"}], function(part) { + this[part.name + "Node"] = JSKitLib.cr({className: "jskit-MenuTitle" + part.suff}); + }); + if(this.title) { + var tbl = JSKitLib.cr({t:"table"}); + tbl.cellSpacing = tbl.cellPadding = "0"; + var row = tbl.insertRow(0); + JSKitLib.fmap.call(this, ["title", "ending"], function(part, i) { + row.insertCell(i).appendChild(this[part + "Node"]); + }); + JSKitLib.preventSelect(this.titleNode); + JSKitLib.addPNG(this.endingNode, "//cdn.js-kit.com/images/menu/vertical-menu-expand-marker.png"); + JSKitLib.text(this.title, this.titleNode); + this.itemNode.appendChild(tbl); + } +} + +JSMenuItemRoot.prototype.addItemHighlighting = function() { + var self = this; + JSKitLib.fmap([{event: "mouseover", action: "addClass"}, {event: "mouseout", action: "removeClass"}], function(e) { + JSKitLib.addEventHandler(self.itemNode, [e.event], function() { + JSKitLib[e.action](self.itemNode, "js-kitMenuTitleMO"); + }); + }); +} + +JSMenuItemRoot.prototype.addExpandHandler = function() { + var self = this; + JSKW$Events.registerEventCallback(undefined, function(eventName, menuNode) { + if (self.itemNode != menuNode) return; + var need2hide = (self.outerCnt.style.display != "none"); + JSKW$Events.syncBroadcast("JSMenu-CollapseAll"); + if (need2hide) { + JSKitLib.removeClass(self.titleNode, "js-kitMenuTitlePressed"); + } else { + JSKitLib.addClass(self.titleNode, "jskit-MenuTitlePressed"); + JSKitLib.show(self.outerCnt, "block"); + if (self.layer && !self.leftPosCorrection) { + var titleNodePos = JSKitLib.findPos(self.titleNode); + self.leftPosCorrection = titleNodePos[0] + self.outerCnt.offsetWidth - JSKitLib.findPos(self.layer)[2]; + if (self.leftPosCorrection > 0) self.outerCnt.style.left = (self.outerCnt.offsetLeft - self.leftPosCorrection) + "px"; + } + } + }, 'JSMenu-Opened'); + JSKitLib.addEventHandler(this.itemNode, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + JSKW$Events.syncBroadcast('JSMenu-Opened', self.itemNode); + }); +} + +JSMenuItemRoot.prototype.addCollapseCallback = function() { + var self = this; + JSKW$Events.registerEventCallback(undefined, function() { + self.outerCnt.style.display = "none"; + JSKitLib.removeClass(self.titleNode, "jskit-MenuTitlePressed"); + }, "JSMenu-CollapseAll"); +} + +JSMenuItemRoot.prototype.attachContainer = function() { + this.itemNode.appendChild(this.outerCnt); +} + +JSMenuItemRoot.prototype.addExpandMarker = function() {}; + +///////////////////////////////////////// +// JS Menus Delimeter +///////////////////////////////////////// + +function JSMenuItemDelimeter(obj) { + this.level = obj.level; + this.itemNode = JSKitLib.cr({t:"tr"}); + var td = JSKitLib.cr({t:"td"}); + td.colSpan = "3"; + var delim = JSKitLib.cr({className: "jskit-MenuDelimeter"}); + td.appendChild(delim); + this.itemNode.appendChild(td); +} + +///////////////////////////////////////// +// JS Menus with dynamic text input +///////////////////////////////////////// + +function JSMenuItemDTI(obj) { + this.init(obj); +} + +JSMenuItemDTI.prototype = new JSMenuItemBase(); + +JSMenuItemDTI.prototype.renderTitle = function(cnt) { + var input = JSKitLib.html(''); + JSKitLib.text(this.title, cnt); + cnt.parentNode.insertBefore(input, cnt); + JSKitLib.addEventHandler(this.itemNode, ["click"], function(e) { + JSKitLib.stopEventPropagation(e); + cnt.style.visibility = "hidden"; + JSKitLib.show(input); + input.focus(); + input.select(); + }); + input.onblur = function() { + JSKitLib.hide(input); + cnt.style.visibility = "visible"; + } +} + +///////////////////////////////////////// +// JS Root menu with HTML inside +///////////////////////////////////////// +function JSMenuItemRootHTML(obj) { + this.init(obj); + JSKitLib.addClass(this.outerCnt, "jskit-MenuRootContainer"); +} + +JSMenuItemRootHTML.prototype = new JSMenuItemRoot(); + +JSMenuItemRootHTML.prototype.createItem = function() { + this.itemNode = JSKitLib.cr(); + JSKitLib.fmap.call(this, ["Title", "Ending"], function(part) { + this[part.toLowerCase() + "Node"] = this.itemNode.appendChild(JSKitLib.cr()); + }); + JSKitLib.preventSelect(this.titleNode); + JSKitLib.addClass(this.itemNode, "jskit-MenuRootHTML"); + this.titleNode.appendChild(this.title); +} + +JSMenuItemRootHTML.prototype.addItemHighlighting = function() {} + +JSMenuItemRootHTML.prototype.attachContainer = function() { + this.endingNode.appendChild(this.outerCnt); +} + +///////////////////////////////////////// +// JS Self-Reproducing Checkbox Menu +///////////////////////////////////////// + +function JSMenuItemSRCheckbox(obj) { + var self = this; + if(!obj) return; + obj.enableSelect = true; + obj.controlElementType = "Checkbox"; + this.init(obj); + this.defaultData = obj; + this.addCheckEvents(); + this.addDeleteEvent(); + this.setState(this.state || "checked"); +} + +JSMenuItemSRCheckbox.prototype = new JSMenuItemCheckbox(); + +JSMenuItemSRCheckbox.prototype.renderTitle = function(cnt) { + var self = this; + var title = this.title; + duplicate = function() { + if(!self.alreadyEdited && self.title != self.defaultData.title) { + self.alreadyEdited = true; + if(!self.unclonable) { + self.parent.appendItem(new JSMenuItemSRCheckbox(self.defaultData), self); + } + self.checkbox.style.visibility = "visible"; + self.hideCheckbox = false; + if(self.oncreate) self.oncreate(self.title); + self.setState("checked"); + self.endingNode.style.display = "block"; + } else { + if(self.onupdate && title != self.title) { + self.onupdate([title, self.title]); + title = self.title; + } + } + } + this.ipe = new JSIPE2({obj: self, property: 'title', jsk$wasEdited: duplicate, maxLength: 100, hideApplyBtn: true, jsk$validate: function(newValue) {if(self.validator) return self.validator.call(self, newValue); else return true;}}) + JSKW$Events.registerEventCallback(0, function() {self.ipe.resetChanges();}, "JSMenu-CollapseAll"); + cnt.appendChild(this.ipe.div); +} + +JSMenuItemSRCheckbox.prototype.renderEnding = function(cnt) { + JSKitLib.addClass(cnt, "jskit-MenuDeleteButton"); + JSKitLib.addPNG(cnt, "//cdn.js-kit.com/images/menu/menu-delete-button.png"); + if(!this.alreadyEdited || this.unclonable) cnt.style.display = "none"; +} + +JSMenuItemSRCheckbox.prototype.addDeleteEvent = function() { + var self = this; + this.endingNode.onclick = function(e) { + JSKitLib.stopEventPropagation(e); + if(self.ondelete) self.ondelete(self.title); + self.parent.removeItem(self); + } +} + +///////////////////////////////////////// +// JS Menus interface +///////////////////////////////////////// + +function JSMenu(title, data, type, layer) { + var root = new window["JSMenuItemRoot" + (type || "")]({title: title, level: 0, layer: layer}); + var curItem = root; + root.itemNode.items = []; + JSKitLib.fmap(data, function(itemData) { + if (typeof(itemData.level) == "undefined") itemData.level = 1; + var item = itemData.type ? (new window["JSMenuItem" + itemData.type](itemData)) : (new JSMenuItemBase(itemData)); + while(item.level <= curItem.level) curItem = curItem.parent; + curItem.appendItem(item); + root.itemNode.items.push(item); + curItem = item; + }); + JSKitLib.addEventHandler(document, ["click"], function(e) { + if(JSKitLib.getBrowser() != "gecko" || e.button != 2) JSKW$Events.syncBroadcast("JSMenu-CollapseAll"); + }); + return root.itemNode; +} + +function JSDogtag(data) { + var obj = JSKitLib.cr({className: "jskit-Dogtag"}); + JSKitLib.fmap(["Icon", "Text", "Cross"], function(part) { + var node = JSKitLib.cr({className: "jskit-Dogtag" + part}); + obj.appendChild(node); + obj[part.toLowerCase() + "Node"] = node; + }); + JSKitLib.text(JSKitLib.truncate(data.text, 17, "...", true), obj.textNode); + JSKitLib.preventSelect(obj.textNode); + JSKitLib.addEventHandler(obj, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + }); + if(data.icon) JSKitLib.addPNG(obj.iconNode, data.icon); + JSKitLib.addPNG(obj.crossNode, "//cdn.js-kit.com/images/cross.png"); + if (data.onclose) obj.crossNode.onclick = data.onclose; else JSKitLib.hide(obj.crossNode); + obj.title = data.text; + obj.hide = function() { + JSKitLib.hide(obj); + } + obj.show = function(newText) { + JSKitLib.show(obj); + obj.title = newText || obj.title; + obj.textNode.replaceChild(JSKitLib.text(JSKitLib.truncate(obj.title, data.maxLength || 12, "...", true)), obj.textNode.firstChild); + } + return obj; +} + + + + + + +JSKitLib.isPreIE7 = function() { + if (document.body && document.body.filters && parseInt(navigator.appVersion.split("MSIE") [1]) < 7) + return true; +} + +JSKitLib.isPreIE8 = function() { + if (document.body && document.body.filters && parseInt(navigator.appVersion.split("MSIE") [1]) < 8) + return true; +} + +JSKitLib.isIE = function() { + if (document.body && document.body.filters && navigator.appVersion.match(/MSIE/)) + return true; +} + +JSKitLib.getBrowser = function() { + if (JSKitLib.vars.browser) return JSKitLib.vars.browser; + if (document.body && document.body.filters && navigator.appVersion.match(/MSIE/)) { + JSKitLib.vars.browser = "IE"; + } else if ((navigator.appCodeName.toLowerCase()=="mozilla") + && (navigator.appName.toLowerCase()=="netscape") + && (navigator.product.toLowerCase()=="gecko") + ) { + if (navigator.userAgent.toLowerCase().indexOf("safari")!=-1) { + JSKitLib.vars.browser = "safari"; + } else if (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1) { + JSKitLib.vars.browser = "gecko"; + } + } else if (navigator.product && navigator.product.toLowerCase()=="gecko") { + JSKitLib.vars.browser = "gecko"; + } else if (navigator.appName.match(/Opera/)) { + JSKitLib.vars.browser = "opera"; + } + return JSKitLib.vars.browser; +} + +JSKitLib.isFF3 = function() { + return (navigator.userAgent.indexOf("Firefox/3") != -1); +} + +JSKitLib.isGChrome = function() { + return (navigator.userAgent.toLowerCase().indexOf('chrome') != -1); +} + +JSKitLib.isSafari = function() { + if (navigator.appVersion.match(/Safari/)) { + return true; + } +} + +JSKitLib.isOpera = function() { + if (navigator.appName.match(/Opera/)) { + return true; + } +} + + + + + +JSKitLib.setEventHandler = function(obj, eventNames, eventHandler) { + JSKitLib.fmap(eventNames, function(eventName) { + obj["on" + eventName] = function(){ + eventHandler(); + return false; + } + }); +} + +JSKitLib.resetEventHandler = function(obj, eventNames) { + JSKitLib.fmap(eventNames, function(eventName) { + obj["on" + eventName] = function(){}; + }); +} + +JSKitLib.addEventHandler = function(obj, eventNames, eventHandler, capture) { + JSKitLib.fmap(eventNames, function(e) { + if (obj.addEventListener) { + obj.addEventListener(e, eventHandler, !!capture); + } else if (obj.attachEvent) { + if (capture) { + if (capture === true) capture = obj; + capture.setCapture(); + capture.attachEvent('onlosecapture', eventHandler); + } + obj.attachEvent('on' + e, eventHandler); + } + }); +} + +JSKitLib.removeEventHandler = function(obj, eventNames, eventHandler, capture) { + JSKitLib.fmap(eventNames, function(e) { + if (obj.removeEventListener) { + obj.removeEventListener(e, eventHandler, !!capture); + } else if (obj.detachEvent) { + if (capture) { + if (capture === true) capture = obj; + capture.detachEvent('onlosecapture', eventHandler); + capture.releaseCapture(); + } + obj.detachEvent('on' + e, eventHandler); + } + }); +} + +JSKitLib.setMouseEvent = function(obj, eventName, eventHandler) { + var normalize = function(pr_event){ + e = pr_event || window.event; + if (!e.target) + e.target = e.srcElement || document; + if (e.target.nodeType == 3) + e.target = e.target.parentNode; + if (!e.relatedTarget && e.fromElement) + e.relatedTarget = (e.fromElement == e.target) ? e.toElement : e.fromElement; + return e; + }; + obj["onmouse" + eventName] = function(pr_event) { + var e = normalize(pr_event); + if (e.relatedTarget == obj || JSKitLib.isChildNodeOf(obj, e.relatedTarget)) return false; + eventHandler(e); + }; +} + +JSKitLib.stopEventPropagation = function(e) { + if (!e) e = window.event; + e.cancelBubble = true; + if (e.stopPropagation) e.stopPropagation(); +} + +JSKitLib.preventDefaultEvent = function(e) { + if (!e) e = window.event; + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); +} + +JSKitLib.deferCall = function(func, onlyIE) { + if (!JSKitLib.vars.windowOnLoadFired && (!onlyIE || (onlyIE && JSKitLib.isIE() && !window.$JSKitNoDeferCallIfIE))) { + JSKitLib.addEventHandler(window, ['load'], func); + } else { + func(); + } +} + +JSKitLib.addHandlers = function(obj, moveHandler, upHandler, capture) { + JSKitLib.addEventHandler(obj, ['mousemove'], moveHandler, capture); + JSKitLib.addEventHandler(obj, ['mouseup'], upHandler, capture); +} + +JSKitLib.removeHandlers = function(obj, moveHandler, upHandler, capture) { + JSKitLib.removeEventHandler(obj, ['mousemove'], moveHandler, capture); + JSKitLib.removeEventHandler(obj, ['mouseup'], upHandler, capture); +} + +JSKitLib.notDraggable = function(element) { + element.onselectstart = function(ev) { JSKitLib.stopEventPropagation(ev); return true; } + element.onmousedown = JSKitLib.stopEventPropagation; + return element; +} + +JSKitLib.getMousePosition = function(e) { + if (!e) var e = window.event; + if (e.clientX || e.clientY) { + return {x:e.clientX, y:e.clientY}; + } else { + return {x:e.pageX, y:e.pageY}; + } +} + +JSKitLib.preventSelect = function(element, exceptions) { + var browser = JSKitLib.getBrowser(); + var prevent = function() { + if (browser == 'IE' || browser == 'safari') { + element.onselectstart = function() { return false; } + } else if (browser == 'gecko') { + JSKitLib.addClass(element, 'js-nsgecko'); + } + } + if (typeof exceptions == 'object') { + var include = exceptions.include || []; + var exclude = exceptions.exclude || []; + // Do not handle for certain browsers + if (exclude.length) { + for (var i=0; i < exclude.length; i++) { + if (exclude[i] != browser) { + prevent(); + } + } + } + // Handle for certain browsers + if (include.length) { + for (var i=0; i < include.length; i++) { + if (include[i] == browser) { + prevent(); + } + } + } + } else { + prevent(); + } +} + +JSKitLib.timedRetry = function(obj) { + if(obj.pred()) { + obj.onSuccess(); + } else { + obj.currentRetries = (obj.currentRetries || 0) + 1; + if(obj.currentRetries > obj.maxRetries) { + if(obj.onFailure) obj.onFailure(); + } else { + if(obj.onRetry) obj.onRetry(); + setTimeout(function(){ + JSKitLib.timedRetry(obj); + }, obj.timeout); + } + } +} + +JSKitLib.addDOMLoadedListener = function(callback) { + window.JSK$DOMLoadedCallbacks = window.JSK$DOMLoadedCallbacks || []; + window.JSK$DOMLoadedCallbacks.push(callback); + if (window.JSK$DOMLoadedCallbacks.length > 1) + return; + var totalListener = function() { + JSKitLib.fmap(window.JSK$DOMLoadedCallbacks, function(c) { c(); }); + } + switch (JSKitLib.getBrowser()) { + case 'gecko': + case 'opera': + document.addEventListener("DOMContentLoaded", totalListener, false); + break; + case 'IE': + var temp = document.createElement('div'); + (function() { + try { + temp.doScroll('left'); + } catch (e) { + setTimeout(arguments.callee, 100); + return; + } + totalListener(); + })(); + break; + case 'safari': + (function() { + if (document.readyState != 'complete') { + setTimeout(arguments.callee, 100); + return; + } + totalListener(); + })(); + break; + default: + JSKitLib.addEventHandler(window, ['load'], totalListener); + } +} + + + + + + +JSKitLib.addCss = function(cssCode, name, content) { + var doc = content || document; + if(name) { + name = "js-" + name + "-css"; + if (doc.getElementById(name)) return; + } + var se = doc.createElement("style"); + se.type = "text/css"; + if(name) se.id = name; + if (se.styleSheet) se.styleSheet.cssText = cssCode; + else se.appendChild(doc.createTextNode(cssCode)); + var hd = doc.getElementsByTagName("head"); + if(hd && hd[0]) hd[0].appendChild(se); + else if (JSKitLib.isGChrome()) { + doc.body.insertBefore(se, doc.body.firstChild); + } else doc.write(''); +} + +JSKitLib.getElementsByClass = function(node, searchClass, tag) { + var classElements = []; + node = node || document; + tag = tag || '*'; + var tagElements = node.getElementsByTagName(tag); + var regex = new RegExp("(^|\\s)" + searchClass + "(\\s|$)"); + for (var i=0, j=0; i < tagElements.length; i++) { + if (regex.test(tagElements[i].className)) { + classElements[j] = tagElements[i]; + j++; + } + } + return classElements; +}; + +JSKitLib.mapClass2Object = function(ctl, e) { + if(e.className) { + var arr = String(e.className).split(/[ ]+/); + JSKitLib.map(function(el) { ctl[el] = e }, arr); + } + if(e.name) ctl[e.name] = e; + try { + var self = this; + JSKitLib.map(function(child) { + JSKitLib.mapClass2Object(ctl, child); + }, e.childNodes); + } catch(e){} + return ctl; +} + +JSKitLib.hasClass = function(element, className) { + return element.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)')); +} + +JSKitLib.addClass = function(element, className) { + if (!JSKitLib.hasClass(element, className)) { + element.className += ' ' + className; + } +} + +JSKitLib.removeClass = function(element, className) { + if (JSKitLib.hasClass(element, className)) { + var regex = new RegExp('(\\s|^)' + className + '(\\s|$)'); + element.className = element.className.replace(regex, ' '); + } +} + + + + + +JSKitLib.removeChildren = function(element) { + while(element && element.hasChildNodes()) + element.removeChild(element.firstChild); +} + +JSKitLib.visible = function(element) { + return element.style.display != 'none'; +} + +JSKitLib.show = function(element, style) { + element.style.display = style || ''; +} + +JSKitLib.hide = function(element) { + element.style.display = 'none'; +} + +JSKitLib.toggle = function(element, style) { + (element.style.display == 'none') ? JSKitLib.show(element, style) : JSKitLib.hide(element); +} + +JSKitLib.getStyle = function(element) { + if (typeof element.style.cssText != "undefined") { + return element.style.cssText; + } else { + return element.getAttribute("style"); + } +} + +JSKitLib.setStyle = function(element, style) { + if (typeof element.style.cssText != "undefined") { + element.style.cssText = style; + } else { + element.setAttribute("style", style); + } +} + +JSKitLib.addStyle = function(element, style) { + var oldStyle = JSKitLib.getStyle(element); + JSKitLib.setStyle(element, oldStyle + '; ' + style); // IE needs ; +} + +JSKitLib.getStyleProperty = function(el, prop) { + if (typeof el == 'string') { + el = document.getElementById(el); + } + if (el.currentStyle) { + return el.currentStyle[prop]; + } else if (window.getComputedStyle) { + return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop); + } else { + return el.style[prop]; + } +} + +JSKitLib.findPos = function(obj) { + var origObj = obj; + var curleft = curtop = curright = curbottom = 0; + if (obj.offsetParent) { + curleft = obj.offsetLeft; + curtop = obj.offsetTop; + while (obj = obj.offsetParent) { + curleft += obj.offsetLeft; + curtop += obj.offsetTop; + } + } + curright = curleft + origObj.offsetWidth; + curbottom = curtop + origObj.offsetHeight; + return [curleft,curtop,curright,curbottom]; +} + +JSKitLib.calcCenterPos = function(elmWidth, elmHeight) { + var doc = (document.compatMode == "BackCompat") ? document.body : document.documentElement; + var scroll = JSDL.prototype.getCurScroll(); + return [ + scroll.scroll_left + Math.max(0, Math.round((doc.clientWidth - elmWidth)/2)), + scroll.scroll_top + Math.max(0, Math.round((doc.clientHeight - elmHeight)/2)) + ]; +} + +JSKitLib.getDocSize = function (){ + var doc_width,doc_height; + if(typeof window.innerWidth=="number"){ + if(document.documentElement && document.defaultView && typeof document.defaultView.scrollMaxY=="number"){ + doc_height=document.documentElement.offsetHeight-document.defaultView.scrollMaxY; + doc_width=document.documentElement.offsetWidth; + } else { + doc_height=window.innerHeight; + doc_width=window.innerWidth; + } + } else { + if(document.documentElement && typeof document.documentElement.clientWidth=="number" && document.documentElement.clientWidth){ + doc_height=document.documentElement.clientHeight; + doc_width=document.documentElement.clientWidth; + } else { + if(document.compatMode == "BackCompat"){ + doc_height=document.body.offsetHeight; + doc_width=document.body.offsetWidth; + } else { + doc_height=document.body.clientHeight; + doc_width=document.body.clientWidth; + } + } + } + return [doc_height,doc_width]; +} + +JSKitLib.getJSKitBodyElement = function() { + var be = document.getElementById('js-kit-body-element'); + if (!be) { + be = document.createElement('div'); + be.id = "js-kit-body-element"; + document.body.appendChild(be); + } + return be; +} + +JSKitLib.isChildNodeOf = function(parent, child) { + if (parent === child) + return false + while (child && child !== parent) { + try {child = child.parentNode;} + catch(e){child = parent;} + } + return child === parent; +} + +JSKitLib.replaceChildren = function(where, replacement) { + JSKitLib.removeChildren(where); + JSKitLib.addChild(where, replacement); +} + +JSKitLib.addChild = function(to, what) { + if (typeof(to) != 'object') + return; + if(arguments.length == 3 && arguments[2]) + to.insertBefore(what, to.firstChild); + else + to.appendChild(what); +} + +JSKitLib.hasParentNode = function(el) { + return el && el.parentNode && el.parentNode.nodeType != 11; +} + +JSKitLib.setOpacity = function(div, val) { + if(document.body.filters) { + if(val == 1) div.style.filter = ''; + else div.style.filter = 'alpha(opacity: ' + Math.round(val * 100) + ')'; + } else { + div.style.opacity = val; + } +} + + + + + +JSKitLib.addPNG = function(node, imageURL) { + if (JSKitLib.isIE()) { + var cp = $JSKitGlobal.cachedPngs; + JSKitLib.fmap(cp, function(img) { + img.nodes = JSKitLib.filter(function(elm) { return elm != node; }, img.nodes); + }); + if(cp[imageURL]) { + if(cp[imageURL].loaded) { + node.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageURL + "', sizingMethod='crop')" + } else { + cp[imageURL].nodes.push(node); + } + } else { + cp[imageURL] = {nodes:[node]}; + var tPng = document.createElement("IMG"); + tPng.style.display = "none"; + tPng.onload = function() { + cp[imageURL].loaded = true; + var n = cp[imageURL].nodes; + for(var i=0; i= i) { + setImage(star, fullStar); + } else { + setImage(star, emptyStar); + } + + obj.appendChild(star); + } + + JSKitLib.setStyle(obj, "height: " + objHeight + "px; width: " + objWidth + "px; float: left; margin-right: 5px;"); + + return obj; +} + + + + + +JSKitLib.getOuterHTML = function(node) { + var clone = node.cloneNode(true); + var parent = document.createElement('div'); + parent.appendChild(clone); + var ihtml = parent.innerHTML; + + // ff converts sp characters inside of href to hex ascii + var ihtmlHref = ihtml.match(/href\s*=\s*"[^"]*(%7B|%7D)[^"]*"/g) || []; + for (var i=0; i< ihtmlHref.length; i++) { + var a = ihtmlHref[i]; + var b = a.replace(/%7B/g, '{'); + b = b.replace(/%7D/g, '}'); + ihtml = ihtml.replace(a, b); + } + return ihtml; +}; + +JSKitLib.html = function() { + var div = document.createElement("div"); + for(var text = '', i = 0; i < arguments.length; i++) + text += arguments[i]; + div.innerHTML = text; + var ch = div.firstChild; + div = null; + return ch; +} + +JSKitLib.text = function(text, element, clear) { + var textNode = document.createTextNode(text); + if (element) { + if (clear) JSKitLib.removeChildren(element); + element.appendChild(textNode); + } + return textNode; +} + +JSKitLib.attachDescriptors2Elements = function(elements, layoutBlocksPrefix, descriptors, parentStructure) { + JSKitLib.fmap(elements, function(element, id) { + var pattern = id.match(layoutBlocksPrefix + "(.*)"); + var name = pattern ? pattern[1] : undefined; + if (name && typeof(descriptors[name]) == "function") { + var node = descriptors[name](element, parentStructure); + if (node) element.appendChild(node); + } + }); +} + +JSKitLib.toDOM = function(template, layoutBlocksPrefix, descriptors) { + var content = JSKitLib.html(template); + var elements = JSKitLib.mapClass2Object({}, content); + var structure = { + "set" : function(name, element) { elements[layoutBlocksPrefix + name] = element; }, + "get" : function(name, ignorePrefix) { return elements[((ignorePrefix) ? "" : layoutBlocksPrefix) + name]; }, + "content" : content + }; + JSKitLib.attachDescriptors2Elements(elements, layoutBlocksPrefix, descriptors, structure); + return structure; +} + +JSKitLib.htmlQuote = function (newValue, param) { + newValue = newValue.replace(/&/g,"&").replace(//g,">") + param = param || {}; + if(!param.title) + newValue = newValue.replace(/ /," "); + if(param.attribute) + newValue = newValue.replace(/"/g,"""); + return newValue; +} + +JSKitLib.htmlUnquote = function (newValue) { + return newValue.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"); +} + +JSKitLib.addScript = function(src, content, callback) { + var sId = "js-kit-script-"+src.replace(/[\/.]/g, ''); + content.jsk$scriptId = sId; + if(document.getElementById(sId)) { + if (callback) callback(); + return; + } + var s = document.createElement('script'); + s.id = sId; + s.type ='text/javascript'; + s.charset = 'utf-8'; + s.src = src; + content.appendChild(s); + if (callback) { + s.onload = s.onreadystatechange = function() { + if (s.readyState && s.readyState != 'loaded' && s.readyState != 'complete') return; + s.onreadystatechange = s.onload = null; + callback(); + } + } + return s; +} + +JSKitLib.stripTags = function(text) { + var r = /<\/?(a|em|strong|i|b|u|sup|sub|object|param|embed|span|pre|p)(.|\n)*?>/gi; + text = text.replace(//gi,"[video]"); + text = text.replace(r,""); + return (text.length > 150) ? text.slice(0,150) + "..." : text; +} + +JSKitLib.createHiddenIframe = function(id, target, cb, clearOnload, src) { + clearOnload = (typeof clearOnload == 'undefined' ? true : !!clearOnload); + src = src || 'about:blank'; + target = target || document.body; + var d = document.createElement('div'); + d.style.height = 0; + d.innerHTML = ''; + target.appendChild(d); + var ifr = d.firstChild; + if (cb) { + ifr.onreadystatechange = function(e) { + if (ifr.readyState && ifr.readyState != 'loaded' && ifr.readyState != 'complete') return; + if (clearOnload) { + ifr.onreadystatechange = ifr.onload = null; + } + cb(); + }; + if (!JSKitLib.isOpera()) { + ifr.onload = ifr.onreadystatechange; + } + } + return ifr; +} + +JSKitLib.overlapSelectsIE = function(target) { + var container = document.createElement('div'); + container.innerHTML = ''; + target.appendChild(container.firstChild); +} + +JSKitLib.openPopup = function(url, extConfig){ + var target = '_blank'; + var config = { + 'width' : '960', + 'height' : '800', + 'status' : 'no', + 'menubar' : 'no', + 'toolbar' : 'no', + 'resizable' : 'no', + 'location' : 'yes', + 'scrollbars' : 'yes', + 'directories': 'no'}; + + JSKitLib.fmap(extConfig || [], function(value, key){ + if (key == 'target') target = value; else config[key] = value; + }); + + var calcScreenDimensions = function(){ + if (JSKitLib.isOpera()) { + var doc = (document.compatMode == "BackCompat") ? document.body : document.documentElement; + return {'width': doc.clientWidth, + 'height': doc.clientHeight}; + } + return {'width': screen.width, + 'height': screen.height}; + }; + + var calcCorrections = function() { + if (JSKitLib.isOpera()) return {'height': 35, 'width': 10, 'top' : 0}; + if (JSKitLib.isSafari() && !JSKitLib.isGChrome()) return {'height': 150, 'width': 0, 'top' : 100}; + return {'height': 0, 'width': 0, 'top' : 0}; + }; + + var screenDimensions = calcScreenDimensions(); + var corrections = calcCorrections(); + + if (config.height > screenDimensions.height - corrections.height) config.height = screenDimensions.height - corrections.height; + if (config.width > screenDimensions.width - corrections.width) config.width = screenDimensions.width - corrections.width; + + if (!(config.left && config.top) && config.width && config.height) { + config.left = Math.round((screenDimensions.width - config.width)/2); + config.top = Math.round((screenDimensions.height - corrections.top - config.height)/2); + } + + var params = JSKitLib.fmap(config, function(value, key) {return key + "=" + value;}).join(", "); + return window.open(url, target, params); +} + + + + + +JSKitLib.map = function(f, arr) { + if(arr) for(var i = 0; i < arr.length; i++) f(arr[i], i, arr); + return arr; +} + +JSKitLib.filter = function(f, arr) { + var newArr = []; + if(arr) + for(var i = 0; i < arr.length; i++) + if(f(arr[i], i, arr)) + newArr.push(arr[i]); + return newArr; +} + +JSKitLib.lookup = function(f, arr){ + return JSKitLib.filter(f, arr).shift(); +} + +JSKitLib.fmap = function(o,f) { + var r, a = [], l = o.length; + if(l > 0 || l === 0) + for(var i = 0; i < l; i++) { + r = f.call(this,o[i],i,arguments); + if(r !== undefined) a.push(r); + } + else + for(var i in o) + if(o.hasOwnProperty(i)) { + r = f.call(this,o[i],i,arguments); + if(r !== undefined) a.push(r); + } + return a; +} + +JSKitLib.foldl = function(acc,o,f) { + var r, l = o.length; + if(l > 0 || l === 0) + for(var i = 0; i < l; i++) { + r = f.call(this,o[i],acc,i); + if(r != undefined) acc = r; + } + else + for(var i in o) + if(o.hasOwnProperty(i)) { + r = f.call(this,o[i],acc,i); + if(r != undefined) acc = r; + } + return acc; +} + +JSKitLib.intersperse = function(f) { + return JSKitLib.foldl([], this, function(e, acc, i) { + if(acc.length) acc.push(f); + acc.push(e); + }); +} + +JSKitLib.merge = function() { + return Array.prototype.concat.apply([], arguments); +} + +JSKitLib.cloneObject = function(obj) { + return JSKitLib.foldl({}, obj, function(value, acc, key) { acc[key] = value; }); +} + + + + + +if (typeof JSKitLib.vars.windowOnLoadFired == 'undefined') { + JSKitLib.vars.windowOnLoadFired = false; + JSKitLib.addEventHandler(window, ['load'], function(){ JSKitLib.vars.windowOnLoadFired = true; }); +} + + + + + +var JSKitGlobal = function() { + + this._appAvailable = {}; + this._appObjects = {}; // Specific objects of an application type + this._appObjectActions = {}; // app.object.actions + + this.cachedPngs = {}; + + this._isAppAvailable = function(app) { + return (this._appAvailable[app]) ? true : false; + } + + this.isRatingsAppAvailable = function() { + return this._isAppAvailable('ratings'); + } + + this.isCommentsAppAvailable = function() { + return this._isAppAvailable('comments'); + } + + this._setAppAvailable = function(app) { + this._appAvailable[app] = true; + /* index this app */ + this.indexAppObjects(app); + /* execute any queued actions */ + this.executeAppObjectActions(app); + } + + this.setRatingsAppAvailable = function() { + this._setAppAvailable('ratings'); + } + + this.setCommentsAppAvailable = function() { + this._setAppAvailable('comments'); + } + + this.indexAppObjects = function(app) { + if (app == 'ratings') { + var appArray = $JRA; + } else if (app == 'comments') { + var appArray = $JCA; + } else { + alert('Attempt to index invalid app type'); + return; + } + for (var i=0; i < appArray.length; i++) { + // Check that it's not standalone + if (appArray[i].isStandalone()) { + continue; + } + var uniq = appArray[i].uniq; + if ( ! this._appObjects[uniq] ) { + this._appObjects[uniq] = {}; + } + if ( ! this._appObjects[uniq][app]) { + this._appObjects[uniq][app] = []; + } + this._appObjects[uniq][app].push(appArray[i]); + } + } + + this.executeAppObjectActions = function(app) { + if (this._appObjectActions[app]) { + for (var i=0; i < this._appObjectActions[app].length; i++) { + var uniq = this._appObjectActions[app][i].uniq; + if (this._getAppObject(app, uniq)) { + this._appObjectActions[app][i].action(); + } + } + } + } + + this._getAppObject = function(app, uniq) { + if (this._appObjects[uniq] && this._appObjects[uniq][app]) { + return this._appObjects[uniq][app][0]; // Return only the first + } + return null; + } + + this.getCommentsAppObject = function(uniq) { + return this._getAppObject('comments', uniq); + } + + /* Returns a Ratings Object */ + this.getRatingsAppObject = function(uniq) { + return this._getAppObject('ratings', uniq); + } + + this.copyRatingsAppObject = function(uniq, node) { + if ( ! this.isRatingsAppAvailable()) { + return; + } + var oldObj = this.getRatingsAppObject(uniq); + var newObj = oldObj.clone(node, { 'view':'user', 'commentprompt':'no', 'menu':'no' } ); + return newObj; + } + + this._tryAppObjectAction = function(app, uniq, action) { + if (this._isAppAvailable(app)) { + if (this._getAppObject(app, uniq)) { + action(); + } + } else { + if ( ! this._appObjectActions[app]) { + this._appObjectActions[app] = []; + } + this._appObjectActions[app].push( { 'uniq' : uniq, 'action' : action } ); + } + } + + this.tryRatingsAppObjectAction = function(uniq, action) { + this._tryAppObjectAction('ratings', uniq, action); + } + + this.tryCommentsAppObjectAction = function(uniq, action) { + this._tryAppObjectAction('comments', uniq, action); + } +} + +/* Singleton-like handler */ +JSKitGlobal.getInstance = function() { + if (!window.JSKitGlobalInstance) { + JSKitGlobalInstance = new JSKitGlobal(); + } + return JSKitGlobalInstance; +} + + + + + +/* JSKitGlobal object */ +$JSKitGlobal = JSKitGlobal.getInstance(); + + + + + +JSKitLib.getRef = function(self) { + var wl = window.location; + return wl.protocol + "//" + self.config.domain + wl.pathname; +} + +JSKitLib.readConfig = function(wtype, target, cf) { + cf = cf || {}; + var gtags = JSKitLib.parseConfigTags(document, wtype, 'span'); + var ltags = JSKitLib.parseConfigTags(target, '', 'span'); + var gc = window.JSKitConfig || {}; + for(var i = 3; i < arguments.length; i++) { + var arg = arguments[i]; + if(typeof(arg) == 'string') arg = [arg]; + var name = arg[0]; + var value = cf[name] || target.getAttribute(name) || ltags[name] + || gc[wtype + '-' + name] || gtags[name]; + var wl = window.location; + switch (name) { + case 'path': value = JSKitLib._normPath(target, value); break; + case 'permalink': + value = value || wl.href.replace(wl.hash,''); + if (!value.match(/^https?:\/\//)) + value = "http://" + wl.host + value.replace(/^([^\/]+)/, "/$1"); + break; + case 'title': value = value || document.title; break; + case 'domain': value = value || wl.host; break; + } + if(arg.length > 1) { + if(typeof(arg[1]) == 'number') { + if(value) { + var n = parseInt(value); + if(isNaN(n) || n < 0) { + if(value == "no") value = 0; + else value = arg[1]; + } else value = n; + } else value = arg[1]; + } else if(typeof(arg[1]) == 'object') { + for(var j=arg[1].length; j; j--) + if(arg[1][j-1] == value) break; + if(!j) value = arg[1][j]; + } else { + if(!value) value = arg[1]; + } + } + cf[name] = value; + } + return cf; +} + +JSKitLib.parseConfigTags = function(target, wtype, tag) { + var cache = document._widgets_config; + if (wtype && cache && cache[wtype]) + return cache[wtype]; + var regp = wtype ? wtype+'?-' : ''; + var nodes = target.getElementsByTagName(tag); + var config = {}; + for (var i = 0; i < nodes.length; i++) { + var reg = RegExp("^js-kit-config-"+regp+"(.*)$"); + var m = reg.exec(nodes[i].className); + if (m && m.length) { + config[m[1].toLowerCase()] = nodes[i].innerHTML; + nodes[i].style.display = 'none'; + } + } + if (wtype) { + document._widgets_config = document._widgets_config || {}; + document._widgets_config[wtype] = config; + } + return config; +} + +JSKitLib._normPath = function(target, path) { + var wl = window.location; + var uniq = String(target.getAttribute("uniq") || target.getAttribute("unique") || ''); + /* trim uniq */ + var uniq = uniq.replace(/^\s\s*/, ''), ws = /\s/, i = uniq.length; + while (ws.test(uniq.charAt(--i))); + uniq = uniq.slice(0, i + 1); + /* end of trim */ + var plus = true; + if (uniq) { + plus = uniq.match(/^\+\/*(.*)/); + if (plus) path = plus[1]; + else path = uniq; + } + if(path) { + path = String(path); + var ar = path.match(/^https?:\/\/[^\/]+(.*)/); + if(ar) path = ar[1]; + else path = path.replace(/^([^\/]+)/, (plus ? wl.pathname : "") + "/$1"); + path = path.replace(/^\/+/, "/"); + } else { path=wl.pathname; } + return path; +} + +JSKitLib.initWidgets = function(widget_type, request, constructor) { + var sendRequest = function(domain, multiParams, target) { + if (!multiParams.length) + return; + var wl = window.location; + request = request || {"extra_params": {}}; + var req = { + uri: request.base_uri, + ref: wl.protocol + "//" + domain + wl.pathname, + epb: window.JSKitEPB ? JSKitEPB.getAsHash() : {}, + request: request.extra_params, + variableRequest: multiParams, + transport: 'GET', + target: target, + trailer: request.trailer + }; + new JSRVC(req); + } + + var els = document.body.getElementsByTagName("div"); + if(!els || !els.length) + return; + + var multiI = {}; + var multiQ = {}; + var obj; + var reg = new RegExp('js-kit-' + widget_type + '?'); + for (var i = 0; i < els.length; i++) { + var m = reg.exec(els[i].className); + if (!m || !m.length || els[i].jsk$initialized) + continue; + + obj = constructor(els[i]); + els[i].jsk$initialized = true; + if (obj.config.disabled && obj.config.disabled != "no") continue; + var d = obj.config.domain; + + if (!multiQ[d]) { + multiQ[d] = []; + multiI[d] = 0; + } + multiQ[d].push(obj.singleRequestParams); + multiI[d]++; + } + JSKitLib.fmap(multiQ, function(v, k){ if (v) sendRequest(k, v, obj.target); }); +} + + + + + +JHI2 = {}; +JHI2.create = function(hint, element) { + element = element || JSKitLib.html(""); + element.origColor = element.style.color || 'black'; + element.hint = hint; + element.defaultRemoved = !!element.value; + if (!element.value) { + element.style.color = 'gray'; + element.value = element.hint; + } + element.onclick = function() { + if(JSKitLib.isIE()) { + window.focus(); + element.focus(); + } + return true; + } + element.onblur = function() { + if (!this.defaultRemoved || JSKitLib.trim(this.value) == '') { + this.defaultRemoved = false; + this.style.color = 'gray'; + this.value = this.hint; + } + } + element.onfocus = function() { + if (!this.defaultRemoved) { + this.defaultRemoved = true; + this.style.color = this.origColor; + this.value = ''; + } + } + return element; +} + +JHI2.set = function(element, value) { + if (element.onfocus) element.onfocus(); + element.value = value; +} + +JHI2.isEmpty = function(element) { + return (element.hint && !element.defaultRemoved || !element.hint && !element.value); +} + +JHI2.remove = function(element) { + if (!element || !element.hint) return; + element.onfocus(); + JSKitLib.fmap(['origColor', 'hint', 'defaultRemoved', 'onclick', 'onblur', 'onfocus'], function(v){ JSKitLib.deleteProperty(element, v); }); +} + + + + + +JSKitFBSDK.prototype.displayState = function(el) { + var s = this; + var d = function(id) { return document.getElementById(id+'-'+s.form_id); }; + JSKitLib.fmap(['wait','login','process'], + function(v) { + if (d(v)) d(v).style.display = (el==v) ? 'block' : 'none'; + } + ); +} + +JSKitFBSDK.prototype.processProfile = function() { + var s = this; + s.displayState('process'); + s.fetchUserInfo(['name', 'profile_url', 'pic_big', 'pic_square', 'pic_square_with_logo'], function(data){ + if(!data) { + s.processLoginStatus(); + } else { + var session = FB.getSession(); + var params = { + "profile_data" : JSKitLib.Object2JSON(data), + "access_token" : session.access_token, + "expires" : session.expires, + "api_key" : s.api_key, + "ref" : s.ref, + "rnd" : Math.random() + }; + var url = "http://js-kit.com/api/facebook/process_profile?" + + JSKitLib.fmap(params, function(value, key) { + return key + "=" + encodeURIComponent(value); + }).join("&"); + JSKitLib.addScript(url, s.target); + } + }); +} + +JSKitFBSDK.prototype.fetchUserInfo = function(flds, cb) { + var s = this; + var session = FB.getSession(); + if(!session) return(cb(undefined)); + FB.api({ + method: 'Users.getInfo', + session_key: session.session_key, + api_key: s.api_key, + sig: session.sig, + uids: [session.uid], + fields: flds, + v: "1.0"}, function(data){ + cb(data); + }); +} + +JSKitFBSDK.prototype.processLogin = function() { + var slf = this; + FB.login(function(r){ + if(r.session){ + slf.processLoginStatus(); + } else { + slf.displayState('login'); + } + }, {perms:'publish_stream'}); +} + +JSKitFBSDK.prototype.processLoginStatus = function() { + var s = this; + s.displayState('login'); + FB.getLoginStatus(function(response){ + if(response.session){ + s.processProfile(); + } else { + s.displayState('login'); + } + }, true); +} + +JSKitFBSDK.prototype.createHiddenContainer = function() { + var div = document.getElementById('fb-root'); + if (div) return div; + var div = JSKitLib.html('
      '); + document.body.insertBefore(div, document.body.firstChild); + return div; +} + +JSKitFBSDK.prototype.shareComment = function(whiteLabel) { + var s = this; + var sd = this.sharedata; + FB.getLoginStatus(function() { + var sess = FB.getSession(); + if(sess) { + s.fetchUserInfo(['name'], function(data) { + if(data && !data.error_code){ + var al = whiteLabel ? null : + [{'text': 'Visit JS-Kit', 'href': 'http://js-kit.com/'}]; + FB.api({ + method: 'stream.Publish', + session_key: sess.session_key, + api_key: s.api_key, + sig: sess.sig, + v: "1.0", + message: sd.Text, + attachment: { + 'name': data[0].name + ' participated in a discussion on ' + sd.domain, + 'href': sd.permalink}, + action_links: al + }); + } + }); + } else { + FB.login(function(r){ + if(r.session){ + s.shareComment(whiteLabel); + }}, {perms:'publish_stream'}); + } + }, true); +} + +JSKitFBSDK.prototype.init = function(cb) { + var s = this; + if(!s.api_key || !s.target) return; + window.jsk$fb_init = true; + var initFB = function() { + FB.init({ + appId: s.api_key, + status: false, + cookie: true, + xfbml: true + }); + if(cb) cb(); + }; + if(!window.FB || !FB.init) { + JSKitLib.addScript('http://connect.facebook.net/en_US/all.js', s.target, function() { initFB(); }); + } else { + initFB(); + } +} + +JSKitFBSDK.prototype.logout = function() { + FB.logout(); +} + +function JSKitFBSDK(ref, api_key, xd_receiver, cb, form_id, sharedata) { + this.ref = ref; + this.form_id = form_id; + this.target = this.createHiddenContainer(); + this.api_key = api_key; + this.xd_receiver = xd_receiver; + this.sharedata = sharedata; + var s = this; + var f = function() { + if (cb) cb.apply(s); + }; + if (window.jsk$fb_init) { + f(); + } else { + this.init(f); + } +} + +JSKitFBSDK.prototype.detectXD = function(target) { + // nothing to do +} + + + + + +JSKitGFC.prototype.init = function(cb) { + var s = this; + if(!s.site || !s.target) return; + window.jsk$gfc_init = true; + var initGFC = function() { + google.friendconnect.container.setParentUrl('/'); + google.friendconnect.container.loadOpenSocialApi({ + site: s.site, + onload: function(securityToken) { + window.jsk$gfc_token = securityToken; + if(cb) cb(); + } + }); + }; + if(!window.google || !window.opensocial) { + JSKitLib.addScript('http://www.google.com/friendconnect/script/friendconnect.js?key=notsupplied&v=0.8', s.target, function() { initGFC(); }); + } else { + initGFC(); + } +} + +JSKitGFC.prototype.processProfile = function(profileData) { + JSKitLib.addScript('//js-kit.com/api/google/process_profile?' + +'id='+encodeURIComponent(profileData.getId()) + +'&st='+encodeURIComponent(window.jsk$gfc_token) + +'&rnd='+Math.random(),this.target); + if(this.onready) this.onready(); +} + +JSKitGFC.prototype.displayState = function(el) { + var s = this; + var d = function(id) { return document.getElementById(id+'-'+s.tgt); }; + JSKitLib.fmap(['wait','login','process'], + function(v) { + d(v).style.display = (el==v) ? 'block' : 'none'; + } + ); +} + +JSKitGFC.prototype.getViewerData = function(success_cb, fail_cb) { + var onData = function(data) { + var vd = data.get("viewer_data"); + if (!vd.hadError() && vd.getData()) { + if(success_cb) success_cb(vd.getData()); + } else { + if(fail_cb) fail_cb(vd); + } + }; + var req = opensocial.newDataRequest(); + req.add(req.newFetchPersonRequest("VIEWER"), "viewer_data"); + req.send(onData); +} + +JSKitGFC.prototype.processLoginStatus = function() { + var s = this; + s.getViewerData(function(profileData){ + var processEl = document.getElementById('process-' + s.tgt); + if(processEl) processEl.innerHTML = $JCL("loggingIn") + profileData.getDisplayName() + '...'; + s.displayState('process'); + s.processProfile(profileData); + }, function() { + s.displayState('login'); + google.friendconnect.renderSignInButton({ 'id': 'login-' + s.tgt, 'text' : $JCL("loginWithGFC"), 'style': 'long' }); + }); +} + +JSKitGFC.prototype.shareComment = function() { + var s = this; + s.getViewerData(function(data){ + var sd = s.sharedata; + var UserName = data.getDisplayName(); + var params = {}; + params[opensocial.Activity.Field.TITLE] = UserName + $JCL("justPostedCommentOn") + ' ' + sd.domain + ''; + params[opensocial.Activity.Field.BODY] = ((sd.Text.length > 128) ? sd.Text.substr(0, 128) + '...' : sd.Text) + '

      ' + $JCL("poweredBy") + ' JS-Kit Echo'; + var activity = opensocial.newActivity(params); + opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH); + },function(){ + google.friendconnect.requestSignIn(); + }); +} + +JSKitGFC.prototype.processLogout = function() { + google.friendconnect.requestSignOut(); +} + +function JSKitGFC(ref, tgt, site, cb) { + this.ref = ref; + this.tgt = tgt; + this.site = site; + var s = this; + s.target = document.getElementById(s.tgt); + var f = function() { cb.apply(s); }; + if(window.jsk$gfc_init) { + f(); + } else { + this.init(f); + } +} + + + + + +if(!window.JSKitAuthInstance) var JSKitAuthInstance = null; + +$JALT = { + //Authentication methods labels: + identityLabel_short_epb: "EPB", + identityLabel_short_gfc: "Google Friend Connect", + identityLabel_short_home: "My Site", + identityLabel_short_jskit: "JS-Kit", + identityLabel_short_yahoo: "Yahoo!", + identityLabel_short_openid: "Openid", + identityLabel_short_twitter: "Twitter", + identityLabel_short_haloscan: "Haloscan", + identityLabel_short_blogspot: "Blogger", + identityLabel_short_facebook: "Facebook", + identityLabel_short_friendfeed: "FriendFeed", + + identityLabel_full_epb: "My EPB Account", + identityLabel_full_gfc: "My Google Profile", + identityLabel_full_jskit: "My JS-Kit Account", + identityLabel_full_yahoo: "My Yahoo! Account", + identityLabel_full_openid: "My OpenID", + identityLabel_full_twitter: "My Twitter Account", + identityLabel_full_haloscan: "My Haloscan Account", + identityLabel_full_blogspot: "My Blogger Account", + identityLabel_full_facebook: "My Facebook Profile", + identityLabel_full_register: "New JS-Kit Account", + identityLabel_full_friendfeed: "My FriendFeed Account", + + //Error messages: + error: 'Error', + no_email: 'Email not found for this account', + long_login: 'Login is too long (should be not more 63 characters)', + empty_login: 'Enter your login', + empty_email: 'Enter your e-mail', + short_login: 'Login is too short (should be at least 6 characters)', + cookies_are_disabled: 'Unfortunately authentication is not available for you because the cookies are disabled in your browser. Please enable cookies and retry', + empty_openid: 'Enter your OpenID URL', + empty_blogspot: 'Enter your Blogspot URL', + empty_password: 'Enter your password', + empty_password2: 'Enter your password', + incorrect_login: 'Login must begin with a letter and contain 6 or more characters, including numbers, a dash and a dot.', + incorrect_email: 'Your email is incorrect, please check it', + full_description: 'JS-Kit login need to start with a letter and may also contain numbers, a dash and a dot. Login and password must have a minimum of 6 characters. Example of a good login name: Joe.Bloggs', + nonexisting_login: 'Login does not exist ', + password_is_short: 'Password is too short (should be at least 6 characters)', + user_already_logged: 'You are already signed in with this login', + incorrect_recovery_key: 'Incorrect recovery key', + login_is_already_used: 'Login name is already taken by someone else', + incorrect_blogspot_url: 'Your Blogspot URL doesn\'t seem to be valid', + incorrect_login_or_password: 'Login or password is incorrect', + user_already_has_other_login: 'You are logged in already', + password2_mismatch: 'Passwords do not match', + //Common labels + authentication: 'Authentication', + passwordRecovery_jskit: 'JS-Kit Password Recovery', + passwordRecovery_haloscan: 'Haloscan Password Recovery', + enterYourLoginNote: 'Enter your login you registered with below and click "Send Password". Then check your email (Inbox or SPAM folder).', + forgotYourPassword: 'forgot your password?', + registerNewAccount: 'register a new account?', + sendPassword: 'Send Password', + authCode: 'Auth Code', + jskaLogout: 'Logout', + submit: 'Submit', + back: 'Back', + login: 'Login', + username: 'Username', + loginWith: 'Login with:', + loginBtn: 'Login', + register: 'Register', + openID: 'OpenID:', + password: 'Password:', + retypePassword: 'Re-type Password:', + loginWith: 'Login with:', + cancel: 'Cancel', + loading: 'Loading ...', + allFieldsAreMandatory: 'All fields are mandatory', + yourEmail: 'Your Email', + blogspotUrl: 'Blogspot URL:', + //EPB + epb_LoginOrRegisterInHostSiteText: 'Please login or register on this site' +} +$JAL = window.JSKA_Translate || function(t) { return (window.JSKitLabels && window.JSKitLabels[t]) || $JALT[t] || t; } + +JSKAuth.prototype.getIdentityLabel = function(type, isfull){ + return $JAL("identityLabel_" + (isfull ? "full_" : "short_") + type); +} + +JSKAuth.prototype.setAuthInstance = function() { + if (window.JSKitAuthInstance) { + var authForm = JSKitAuthInstance.authForm; + if(authForm && authForm.parentNode) + JSKitLib.hide(authForm); + } + JSKitAuthInstance = this; +} + +JSKAuth.prototype.show = function(areaName, data) { + areaName = areaName || this.defaultActiveArea; + this.setAuthInstance(); + this.showBackdrop(); + var authForm = this.authForm; + if (this.mode == "popup") { + var pos = JSKitLib.calcCenterPos(300, 200); + authForm.style.top = parseInt(pos[1]) + "px"; + authForm.style.left = parseInt(pos[0]) + "px"; + } + JSKitLib.show(authForm); + this.authSelector.value = areaName; + this.setActiveArea(areaName, data); +} + +JSKAuth.prototype.loadCss = function() { + JSKitLib.addCss( + ".jska-backdrop { opacity: 0; background-color: #404040; z-Index: 14500; " + + (JSKitLib.isPreIE8() + ? "filter:progid:DXImageTransform.Microsoft.Alpha(opacity='0'); position: absolute; top: expression(eval(-(document.body.offsetTop + (document.body.offsetHeight - document.body.clientHeight)/2))); left: expression(eval(-(document.body.offsetLeft + (document.body.offsetWidth - document.body.clientWidth)/2))); height: expression(eval(Math.max(document.body.offsetHeight, document.documentElement.scrollHeight))); width: expression(eval(Math.max(document.body.offsetWidth, document.documentElement.scrollWidth)));" + : "position: fixed; left: 0; top: 0; height: 100%; width: 100%; -webkit-transition: opacity 0.5s ease-out;" ) + + "}" + + ".jska-wrapper { " + (this.mode != "embedded" ? "position: absolute;" : "") + "background-color: white; z-index: 20000; border: solid 4px #cbcbcb; text-align: left; width: 350px; font-weight: normal; }" + + ".jska-facebookFrame { height: 27px; width: 194px; background-color: transparent; border: none; z-Index: 14000; }" + + ".jska-yahoo { margin-left: auto; margin-right: auto; width:161px; height:22px; cursor:pointer; }" + + ".jska-twitter { margin-left: auto; margin-right: auto; width:176px; height:28px; cursor:pointer; }" + + ".jska-friendfeed { margin-left: auto; margin-right: auto; width:216px; height:28px; cursor:pointer; }" + + ".jska-selector { margin-left: 5px;}" + + ".jska-header { background-color: #ececec; padding: 8px 0 6px 10px; }" + + ".jska-headerText { font-family: Verdana, Helvetica; font-weight: bold; font-size: 12pt; color: grey; float: left; }" + + ".jska-infoText { margin: 0; padding: 0;}" + + ".jska-infoContainer { margin: 0 10px;}" + + ".jska-showMore { color: #403030; font-family: Arial, Helvetica, sans-serif; }" + + ".jska-selectorContainer { background-color: #ececec; padding: 0 0 4px 10px;}" + + ".jska-container { border-top: solid 1px #cbcbcb; padding-top: 20px;}" + + ".jska-controls { background-color: #ececec; width: 100%; padding: 5px 0 5px 0; margin-top: 20px;}" + + ".jska-rightColumn { float: right; width: 65%; margin-bottom: 2px;}" + + ".jska-leftColumn { float: right; width: 33%; padding: 2px 5px 0 0; text-align: right;}" + + ".jska-label { font-size: 9pt; font-family: Arial; color: #000000 !important; }" + + ".jska-input { border: solid 1px #7f99b9; width: 80%;}" + + ".jska-openidInput { background: url(//cdn.js-kit.com/images/openid-16x16.png) no-repeat; background-position: 0 50%; padding-left: 18px;}" + + ".jska-blogspotInput { background: url(//cdn.js-kit.com/images/blogger-16x16.png) no-repeat; background-position: 0 50%; padding-left: 18px;}" + + ".jska-errorText { color: #FF3030; font: 11px Arial; margin-bottom: 2px; }" + + ".jska-error { color: #FF3030; font: 11px Arial; display: none; }" + + ".jska-cancelBtn { float: right; margin-right: 5px; cursor: pointer;}" + + ".jska-text { color: #404040; font: 11px Arial; }" + + ".jska-back { font: 15px Helvetica; cursor: pointer; margin-left: 10px; float: left;}" + + ".jska-logout { float: left; margin-left: 10px; cursor: pointer;}" + + ".jska-passwordRecoveryText { margin: 0px 0px 5px 10px; }" + + ".jska-links, a.jska-links:hover, a.jska-links:visited { color: #001faa; cursor: pointer; }" + + ".jska-progressArea { display: none; }" + + ".jska-progressPic { display: inline; float: left; margin-right: 0.2em; margin-left: 1em; margin-top: 0.3em; width: 16px; height: 16px; background: no-repeat url(//cdn.js-kit.com/images/loading.gif); }" + + ".jska-progressLbl { display: inline; margin-left: 0.3em; margin-top: 0.5em; float: left; }" + + ".jska-authButton {float: right; margin-right: 7px; cursor: pointer;}" + + ".jska-clear { clear: both;}", "jska"); +} + +JSKAuth.prototype.cancelRequests = function(){ + var self = this; + JSKitLib.fmap(this.identities.auth, function(identity){ + if(identity.group != "third_party") return; + if(self.areas && self.areas[identity.type] && self.areas[identity.type].rpickup) { + try{ self.areas[identity.type].rpickup.cancelRequest(); } + catch(e){}; + } + }); +} + +JSKAuth.prototype.hide = function() { + this.hideBackdrop(); + this.cancelRequests(); + JSKitLib.hide(this.authForm); +} + +JSKAuth.prototype.destroy = function() { + this.hide(); + var prn = this.authForm.parentNode; + if (prn) prn.removeChild(this.authForm); +} + +JSKAuth.prototype.prepareAuthForm = function() { + var self = this; + var div = self.authForm; + JSKitLib.hide(div); + if (self.mode == "popup"){ + document.body.insertBefore(div, document.body.firstChild); + } else { + self.target.appendChild(div); + } +} + +JSKAuth.prototype.showBackdrop = function() { + if (this.withBackdrop && this.mode == "popup") { + if(!window.backdrop) { + window.backdrop = document.createElement('DIV'); + backdrop.className = 'jska-backdrop'; + document.body.insertBefore(backdrop, document.body.firstChild); + } + JSKitLib.show(backdrop); + JSKitLib.setOpacity(backdrop, 0.5); + } +} + +JSKAuth.prototype.hideBackdrop = function() { + if (this.withBackdrop && window.backdrop){ + JSKitLib.setOpacity(backdrop, 0); + JSKitLib.hide(backdrop); + } +} + +JSKAuth.prototype.assemble = function() { + var self = this; + var authForm = self.toDom(self.authFormTmpl); + var authFormElements = JSKitLib.mapClass2Object({}, authForm); + authForm.dragElements = [authFormElements["jska-header"]]; + + self.areaContainer = authFormElements["jska-container"]; + self.selectorContainer = authFormElements["jska-selectorContainer"]; + + self.authSelector = self.createAuthSelector(self.defaultActiveArea, function(ev){ self.setActiveArea(this.value); }); + authFormElements["jska-selectorContainer"].appendChild(self.authSelector); + + return authForm; +} + +JSKAuth.prototype.createRVCPickupRequest = function(provider, target, area) { + var self = this; + var params = { + 'session_nonce': ((new Date()).valueOf() + Math.random()).toString() + }; + + return new JSRVC({ + 'uri': self.uriDomain + '/api/server-answer.js', + 'ref': self.ref, + 'request': params, + 'target': target, + 'pickup': true, + 'epb': window.JSKitEPB ? JSKitEPB.getAsHash() : {}, + 'onreturn': function (error) + { + if (error == "attempts_number_exceeded") + { + if (provider == "jskit" || provider == "haloscan" || provider == "register") + { + try + { + if (window['JSKitAuthInstance']) window['JSKitAuthInstance'].serverCallback(provider, 'cookies_are_disabled'); + } catch(e){} + }else + { + var areaElements = JSKitLib.mapClass2Object({}, area); + areaElements["js-errorMessageHandle"].innerHTML = $JAL('cookies_are_disabled'); + areaElements["js-errorMessageHandle"].style.display = 'block'; + } + } + }, + 'requestId': provider + '_connect'}); +} + +JSKAuth.prototype.setActiveArea = function(name, data){ + var self = this; + self.cancelRequests(); + self.currentArea = name; + if (name.match(/passwordRecovery/)) JSKitLib.hide(self.selectorContainer); else JSKitLib.show(self.selectorContainer); + JSKitLib.removeChildren(self.areaContainer); + self.areas[name] = self.createArea(name, data); + self.areaContainer.appendChild(self.areas[name]); + if (self.HNDL && self.HNDL[name] && self.HNDL[name]["input"] && self.HNDL[name]["input"].login){ + self.HNDL[name]["input"].login.blur(); + self.HNDL[name]["input"].login.focus(); + } + + if (name == "yahoo"){ self.areas["yahoo"].rpickup = self.createRVCPickupRequest("yahoo", self.target, self.areas["yahoo"]); } + if (name == "gfc"){ + var gfc_cb = function() { + self.areas["gfc"].rpickup = self.createRVCPickupRequest("gfc", self.target, self.areas["gfc"]); + }; + var gfc = self.getAuthIdentity("gfc"); + if(gfc && gfc.params.site) { + var jsk$gfc = new JSKitGFC( + self.ref, + self.areas["gfc"].id, + gfc.params.site, + function(){ + this.onready = gfc_cb(); + this.processLoginStatus(); + }); + } else { + gfc_cb(); + } + } + if (name == "twitter"){ self.areas["twitter"].rpickup = self.createRVCPickupRequest("twitter", self.target, self.areas["twitter"]); } + if (name == "friendfeed"){ self.areas["friendfeed"].rpickup = self.createRVCPickupRequest("friendfeed", self.target, self.areas["friendfeed"]); } + if (name == "facebook" && self.getAuthIdentity("facebook")) { + var facebook = self.getAuthIdentity("facebook"); + var jsk$fb = new JSKitFBSDK( + self.ref, + facebook.params.app_id, + facebook.params.xd_receiver, + function() { + this.processLoginStatus(); + self.areas["facebook"].rpickup = self.createRVCPickupRequest("facebook", self.target, self.areas["facebook"]); + }, + self.areas["facebook"].id + ); + + var logel = document.getElementById('login-' + self.areas["facebook"].id); + logel.onclick = function() { jsk$fb.processLogin(); }; + } +} + +JSKAuth.prototype.getErrorTarget = function(errCode) { + if (errCode.match(/no_email/)) return "login"; + if (errCode.match(/email/)) return "email"; + if (errCode.match(/password2/)) return "password2"; + if (errCode.match(/password/)) return "password"; + return "login"; +} + +JSKAuth.prototype.processControls = function(name, type, func){ + JSKitLib.fmap(this.HNDL[name][type], func); +} + +JSKAuth.prototype.addKeyHandler = function(name) { + var self = this; + var button = self.HNDL[name]["button"].button; + this.processControls(name, "input", function(element){ if (element) { + if(JSKitLib.isIE() || JSKitLib.isOpera()) element.onkeydown = function(ev) { return self.keyHandler(ev, button);} + else element.onkeypress = function(ev) { return self.keyHandler(ev, button);} + }}); +} + +JSKAuth.prototype.hideMessages = function(name) { + this.processControls(name, "message", function(element){ if (element) JSKitLib.hide(element); }); +} + +JSKAuth.prototype.disableControls = function(name, value) { + JSKitLib.fmap.call(this, ["input", "button"], function(type){ this.processControls(name, type, function(element){ if (element) element.disabled = value; })}); +} + +JSKAuth.prototype.clearInputFields = function(name) { + this.processControls(name, "input", function(element){ if (element) { element.value = ""; if (typeof(element.onblur) == "function") element.onblur(); } }); +} + +JSKAuth.prototype.toDom = function(template) { + return JSKitLib.html(template.replace(/{Label:([^:}]+[^}]*)}/g, function(a,m) { + return $JAL(m); + })); +} + +JSKAuth.prototype.autoComplete = (JSKitLib.getBrowser() == 'gecko' ? ' autocomplete="Off"' : ''); + +JSKAuth.prototype.keyHandler = function(e, button){ + e = e || window.event; + switch(e.keyCode) { + case 10: case 13: + JSKitLib.preventDefaultEvent(e); + button.click(); + break; + } +} + +JSKAuth.prototype.getIdentityParam = function(name, identity, defaultValue) { + return (identity.type == 'epb' && identity.params[name]) ? + identity.params[name] : + defaultValue; +} + + +JSKAuth.prototype.authFormTmpl = +'
      ' + + '
      ' + + '
      {Label:authentication}
      ' + + '
      ' + + '
      ' + + '
      {Label:loginWith}
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.progressAreaTmpl = +'
      ' + + '
      ' + + '
      {Label:loading}
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.loginSectionTmpl = function(identity_type) { + return '
      ' + JSKAuth.prototype.progressAreaTmpl + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:username}:
      ' + + '
      ' + + '' + + '
      ' + + '' + + '
      ' + + '
      {Label:password}
      ' + + '
      ' + + '
      ' + + '' + + '' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      '; +} + +JSKAuth.prototype.jskitSectionTmpl = JSKAuth.prototype.loginSectionTmpl('jskit'); +JSKAuth.prototype.haloscanSectionTmpl = JSKAuth.prototype.loginSectionTmpl('haloscan'); + +JSKAuth.prototype.openidSectionTmpl = +'
      ' + JSKAuth.prototype.progressAreaTmpl + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:openID}
      ' + + '
      ' + + '
      ' + + '' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.blogspotSectionTmpl = +'
      ' + JSKAuth.prototype.progressAreaTmpl + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:blogspotUrl}
      ' + + '
      ' + + '
      ' + + '' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.yahooSectionTmpl = +'
      ' + +'
      ' + +'
      ' + +'
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.twitterSectionTmpl = +'
      ' + +'
      ' + +'
      ' + +'
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.friendfeedSectionTmpl = +'
      ' + +'
      ' + +'
      ' + +'
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.epbSectionTmpl = function() { + var epb = this.identities.auth.epb; + var auth_prompt = JSKAuth.prototype.getIdentityParam('auth_prompt', epb, '{Label:epb_LoginOrRegisterInHostSiteText}'); + var template = +'
      ' + + '

      ' + auth_prompt + '

      ' + + '
      ' + + '' + + '
      ' + + '
      ' + +'
      '; + return template; +} + +JSKAuth.prototype.facebookSectionTmpl = function() { + var tgt = "facebook-" + Math.random(); + return ('
      ' + +'
      ' + +'
      ' + +'
      ' + $JCL("askingFacebook") + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + +'
      '); +} + +JSKAuth.prototype.gfcSectionTmpl = function() { + var gfc = this.identities.auth.gfc; + var tgt = "gfc-" + Math.random(); +return '
      ' + +'
      ' + +'
      ' + +(gfc && gfc.params.site ? '
      ' + $JCL("askingGoogle") + '
      ' : +'
      ')+ + '
      ' + + '' + + '' + + '
      ' + + '
      ' + +'
      '; +} + +JSKAuth.prototype.registerSectionTmpl = +'
      ' + JSKAuth.prototype.progressAreaTmpl + + '

      {Label:allFieldsAreMandatory}

      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:username}:
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:yourEmail}:
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:password}
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:retypePassword}
      ' + + '
      ' + + '
      ' + + '' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + +'
      '; + +JSKAuth.prototype.passwordRecoveryRequestSectionTmpl = function(params) { + return '
      ' + + '

      {Label:passwordRecovery_'+params.provider+'}

      ' + + JSKAuth.prototype.progressAreaTmpl + + '

      {Label:enterYourLoginNote}

      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:username}:
      ' + + '
      ' + + '
      ' + + '{Label:back}' + + '' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      '; +} + +JSKAuth.prototype.passwordRecoverySetPasswordSectionTmpl = function(params) { + return '
      ' + + '

      {Label:passwordRecovery_'+params.provider+'}

      ' + + JSKAuth.prototype.progressAreaTmpl + + '

      Please enter the new password

      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:username}:
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:authCode}:
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:password}
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      {Label:retypePassword}
      ' + + '
      ' + + '
      ' + + '{Label:back}' + + '' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      '; +} + +JSKAuth.prototype.passwordRecoverySuccessSectionTmpl = function(params) { + return '
      ' + + '
      ' + + '

      {Label:passwordRecovery_'+params.provider+'}

      ' + + '

      New password was set successfully.

      ' + + 'Click here to log in' + + '
      ' + + '
      ' + + '{Label:back}' + + '' + + '
      ' + + '
      ' + + '
      '; +} + +JSKAuth.prototype.processMessage = function(name, errCode, data) { + if(errCode=='success') { + this.disableControls(name, false); + this.clearInputFields(name); + switch (name) { + case "passwordRecoveryRequest" : this.show("passwordRecoverySetPassword", this.passwordRecoveryData);break; + case "passwordRecoverySetPassword" : this.show("passwordRecoverySuccess", this.passwordRecoveryData); break; + default : if (window.JSKW$Events) JSKW$Events.syncBroadcast('JSKitAuth_success_login', data); if (this.mode != "embedded") this.hide(); + } + } else { + this.showErrorMessage(name, errCode); + } +} + +JSKAuth.prototype.showErrorMessage = function(name, errCode){ + JSKitLib.hide(this.HNDL[name].progress); + this.disableControls(name, false); + var errorTarget = this.getErrorTarget(errCode); + if(errorTarget) { + var inputHandle = this.HNDL[name]["input"][errorTarget]; + var errorMessageHandle = this.HNDL[name]["message"][errorTarget + "Msg"]; + if (inputHandle) {inputHandle.blur(); inputHandle.focus();} + if (errorMessageHandle) { + errorMessageHandle.innerHTML = $JAL(errCode); + if (name == "register" && errorTarget != "email") errorMessageHandle.appendChild(this.buildShowMore()); + errorMessageHandle.style.display = 'block'; + } + } +} + +JSKAuth.prototype.serverCallback = function(type, errCode, data) { + if (this.HNDL && this.HNDL[type]) JSKitLib.hide(this.HNDL[type].progress) + if (type == "register" && data && data.yours) data.yours.newUser = true; + this.processMessage(type, errCode, data); +} + +JSKAuth.prototype.logout = function() { + var self = this; + setTimeout(function(){ + new JSRVC({uri: self.uriDomain + '/api/session/logout.js', 'target': self.target, request: {}}); + }, 0); +} + +JSKAuth.prototype.createArea = function(name, data) { + var self = this; + var sectionTmpl = self[name + "SectionTmpl"]; + var area = self.toDom(typeof(sectionTmpl) == "function" ? sectionTmpl.apply(self, [data]) : sectionTmpl); + var areaElements = JSKitLib.mapClass2Object({}, area); + + var bindOnclick = function(element, func){ + if (element) element.onclick = function(){ func(); return false; } + } + + if (self.mode != "embedded") bindOnclick(areaElements["jska-cancelBtn"], function(){ self.hide(); }) + else JSKitLib.hide(areaElements["jska-cancelBtn"]); + + bindOnclick(areaElements["jska-logout"], function(){ self.logout(); self.hide();}); + if (areaElements["jska-logout"] && (!self.loginStatus || JSKitEPB.isExists())) { + JSKitLib.hide(areaElements["jska-logout"]); + } + + bindOnclick(areaElements["jska-forgotPassword"], function(){ self.show("passwordRecoveryRequest", {'provider': name}) }); + bindOnclick(areaElements["jska-linkToLogin"], function(){ self.show(data.provider) }); + if (name.match(/passwordRecovery/)) { + bindOnclick(areaElements["jska-back"], function(){ self.show(data.provider) }); + } + + bindOnclick(areaElements["jska-yahoo"], function(){ JSKitLib.openPopup(self.uriDomain + '/api/oauth/yahoo.html?ref='+encodeURIComponent(self.ref), {height: "450", width: "600", scrollbars: "no"}); }); + bindOnclick(areaElements["jska-twitter"], function(){ JSKitLib.openPopup(self.uriDomain + '/api/oauth/twitter.html?ref='+encodeURIComponent(self.ref), {height: "435", width: "800", scrollbars: "no"}); }); + bindOnclick(areaElements["jska-friendfeed"], function(){ JSKitLib.openPopup(self.uriDomain + '/api/oauth/friendfeed.html?ref='+encodeURIComponent(self.ref), {height: "435", width: "800", scrollbars: "no"}); }); + if (areaElements["jska-yahoo"]) JSKitLib.addPNG(areaElements["jska-yahoo"], "//cdn.js-kit.com/images/yahoo/yos.png"); + if (areaElements["jska-twitter"]) JSKitLib.addPNG(areaElements["jska-twitter"], "//cdn.js-kit.com/images/twitter/twitter.png"); + if (areaElements["jska-friendfeed"]) JSKitLib.addPNG(areaElements["jska-friendfeed"], "//cdn.js-kit.com/images/friendfeed/friendfeed.png"); + var identity = this.getAuthIdentity(name); + if (identity && identity.group == "third_party") return area; + + var createAction = function(type){ + return function(){ + var error = undefined; + var params = { + login: self.HNDL[type]["input"].login.value, + password: self.HNDL[type]["input"].password.value, + type: type}; + if (self.loginReturnUrl) params["returnUrl"] = self.loginReturnUrl; + if (type == "register") { + params["retype_password"] = self.HNDL["register"]["input"].password2.value; + params["email"] = self.HNDL["register"]["input"].email.value; + params["version"] = "1"; + if (self.registerReturnUrl) { + params["returnUrl"] = self.registerReturnUrl; + } + } + if (params['login'].length < 1 || !self.HNDL[type]["input"].login.defaultRemoved) error = 'empty_login'; + if (!error && type == "register" && params['email'].length < 1) error = 'empty_email'; + if (!error && params['password'].length < 1) error = 'empty_password'; + if (!error && type == "register" && params['retype_password'].length<1) error = 'empty_password2'; + if (error) { self.showErrorMessage(type, error); return false; }; + var scripts = {"register" : "/user-registration", "jskit" : "/user-login", "haloscan" : "/user-haloscan-login"}; + new JSRVC({ + 'uri': self.uriDomain + scripts[type], + 'transport': "POST", + 'target': self.target, + 'ref': self.ref, + 'request': params, + 'requestId': type + '_connect', + 'onreturn': function () { + area.rpickup = self.createRVCPickupRequest(type, self.target) + }, + 'epb': window.JSKitEPB ? JSKitEPB.getAsHash() : {} + }); + } + }; + + var createOpenidAction = function(type){ + return function(){ + var random = function() {return Math.floor(Math.random() * 10000000000);}; + var PPID = 'prfl_' + random() + '-' + random() + '-' + random(); + var params = { jsktid: PPID}; + if (type == "blogspot") params.provider = "blogspot"; + if (self.mode == "popup" && self.LoginWindow && !self.LoginWindow.closed) { + self.LoginWindow.focus(); + new JSRVC({uri: self.uriDomain + '/openid-auth-prolongate', 'target': self.target, request: params}); + return false; + } + var OpenID = self.HNDL[type]["input"].login; + if(OpenID.value.length < 1 || !OpenID.defaultRemoved) { + self.showErrorMessage(type, 'empty_' + type); + return false; + } + if(type == "blogspot" && !OpenID.value.match(/\.blogspot\.com\/?$/)) { + self.showErrorMessage(type, 'incorrect_blogspot_url'); + return false; + } + var AuthUrl = self.uriDomain + '/settings/auth.cgi?openid_url=' + OpenID.value; + if (self.mode == "popup") { + new JSRVC({uri: self.uriDomain + '/openid-auth-wait-for-completion', 'target': self.target, request: params}); + self.LoginWindow = JSKitLib.openPopup(AuthUrl + '&action=prfl&jsktid=' + PPID); + } else { + window.location = AuthUrl + '&action=prfl' + (self.loginReturnUrl ? ("&returnUrl=" + self.loginReturnUrl) : ""); + } + } + } + + var constructPasswordRecoveryRequest = function(){ + return function(){ + var loginInputBox = self.HNDL["passwordRecoveryRequest"]["input"].login; + var provider = self.HNDL["passwordRecoveryRequest"]["input"].provider.value; + if (loginInputBox.value.length < 1 || !loginInputBox.defaultRemoved) { + self.showErrorMessage('passwordRecoveryRequest', 'empty_login'); + } else { + self.passwordRecoveryData["login"] = loginInputBox.value; + self.passwordRecoveryData["provider"] = provider; + new JSRVC({uri: self.uriDomain + '/user-password-recovery', 'target': self.target, request: {login: loginInputBox.value, provider: provider}}); + } + } + } + + + var constructPasswordRecoverySetPassword = function(){ + return function(){ + var inputCollection = self.HNDL["passwordRecoverySetPassword"]["input"] + var provider = self.HNDL["passwordRecoverySetPassword"]["input"].provider.value; + var params = { + step: "set-password", + provider: provider, + login: inputCollection.login.value, + key: JSKitLib.trim(inputCollection.authCode.value), + password: inputCollection.password.value, + retype_password: inputCollection.password2.value + } + new JSRVC({uri: self.uriDomain + '/user-password-recovery', 'target': self.target, request: params}); + } + } + + var specificSubmitActions = { + jskit : createAction("jskit"), + openid : createOpenidAction("openid"), + blogspot : createOpenidAction("blogspot"), + haloscan : createAction("haloscan"), + register: createAction("register"), + passwordRecoveryRequest : constructPasswordRecoveryRequest(), + passwordRecoverySetPassword : constructPasswordRecoverySetPassword() + }; + + var submitAction = function() { + self.hideMessages(name); + self.disableControls(name, true); + self.HNDL[name].progress.style.display = "inline"; + specificSubmitActions[name].call(self); + return false; + }; + + if (!self.HNDL) self.HNDL = []; + self.HNDL[name] = { + progress : areaElements['js-progressHandle'], + container : area, + button : + {button : areaElements["authButton"]}, + message : + {loginMsg : areaElements["js-loginMessageHandle"], + emailMsg : areaElements["js-emailMessageHandle"], + passwordMsg : areaElements["js-passwordMessageHandle"], + password2Msg : areaElements["js-password2MessageHandle"]}, + input : + {login : areaElements["loginInput"], + authCode : areaElements["authCodeInput"], + email: areaElements["emailInput"], + password : areaElements["passwordInput"], + password2 : areaElements["password2Input"], + provider : areaElements["provider"]} + }; + + if (name != "passwordRecoverySetPassword") JHI2.create( (name == "openid" ? "http://user.myopenid.com" : (name == "blogspot" ? "http://yourblog.blogspot.com" : "Joe.Bloggs")), self.HNDL[name]["input"].login); + + data = data || {}; + if (name == "jskit" || name == "haloscan") + data.provider = name; + JSKitLib.fmap(data, function(value, key){ + if (self.HNDL[name]["input"][key]) + self.HNDL[name]["input"][key].value = value; + }); + bindOnclick(self.HNDL[name]["button"].button, submitAction); + self.addKeyHandler(name); + return area; +} + +JSKAuth.prototype.buildShowMore = function() { + var template = + ' (' + + 'Learn more...)' + + '' + ''; + + var span = this.toDom(template); + var handlers = JSKitLib.mapClass2Object({}, span); + + var fullDescLink = handlers['js-fullDescLink']; + var fullDescDiv = handlers['js-fullDescDiv']; + fullDescLink.onclick = function(ev){ + JSKitLib.stopEventPropagation(ev); + fullDescLink.innerHTML = this.visFullDesc ? 'Learn more...' : 'Hide'; + fullDescDiv.style.display = this.visFullDesc ? 'none' : ''; + this.visFullDesc = !this.visFullDesc; + return false; + } + return span; +} + +JSKAuth.prototype.createAuthSelector = function(selected, onchange, includeUserName) { + var authSelector = this.toDom( + ''); + authSelector.onchange = onchange; + return authSelector; +} + +JSKAuth.prototype.getAuthOptions = function(includeUserName) { + var s = this; + var calcLogin = function() { + var identities = s.getAuthenticatedIdentities(); + var firstLoggedIdentity = identities.length ? identities.shift() : undefined; + return firstLoggedIdentity + ? (firstLoggedIdentity.name || firstLoggedIdentity.user) + ' @ ' + + JSKAuth.prototype.getIdentityLabel(firstLoggedIdentity.type) + : undefined; + } + + var authOptions = {}; + var login = calcLogin(); + if (includeUserName) { + authOptions = login + ? {"opt-user": login} + : {"opt-anonymous": $JCL('guest')}; + } + JSKitLib.fmap(s.identities.auth, function(v, k) { + authOptions[k] = JSKAuth.prototype.getIdentityParam('long_label', v, JSKAuth.prototype.getIdentityLabel(k, true)); + }); + return authOptions; +} + +JSKAuth.prototype.isLogged = function() { + var self = this; + if (this.loginStatus === undefined) { + JSKitLib.fmap(this.identities.auth, function(identity, type) { + if (!self.loginStatus) self.loginStatus = !!identity.user; + }); + this.loginStatus = JSKitEPB.isExists() || this.loginStatus; + } + return this.loginStatus; +} + +JSKAuth.prototype.isAvailable = function(type) { + return !!this.identities.auth[type]; +} + +JSKAuth.prototype.assembleIdentity = function(url, type, group) { + var identity = this.getAuthIdentity(type); + return { + "url": url, + "type": type, + "group": group, + "use_as_from": true, + "params": identity && identity.params || {} + }; +} + +JSKAuth.prototype.appendIdentity = function(identity) { + if (identity.group == "web") { + this.identities.web.push(identity); + } else { + this.identities.auth[identity.type] = identity; + } +} + +JSKAuth.prototype.getAuthIdentity = function(type) { + return this.identities.auth[type]; +} + +JSKAuth.prototype.getIdentities = function(group) { + return group ? this.identities[group] : this.identities; +} + +JSKAuth.prototype.getAuthenticatedIdentities = function() { + return JSKitLib.fmap(this.getIdentities("auth"), function(identity) { + if (identity.user) return identity; + }); +} + +JSKAuth.prototype.getFirstAuthIdentity = function() { + var identities = this.getIdentities("auth"); + for (var key in identities) { + if (identities.hasOwnProperty(key)) return identities[key]; + } +} + +JSKAuth.prototype.readIdentities = function(identities) { + identities = identities || []; + return JSKitLib.foldl({"auth": {}, "web": []}, identities, + function(identity, accumulator) { + if (identity.group == "web") accumulator.web.push(identity); + else { + identity.params = identity.params || {}; + accumulator.auth[identity.type] = identity; + } + } + ); +} + +JSKAuth.prototype.setWebIdentities = function(identities) { + this.identities.web = identities; +} + +JSKAuth.prototype.identityServerAction = function(action, identity, newData, onSuccess) { + newData = newData || {}; + var self = this; + var f = function(eventName) { + switch (action) { + case "unbind": + if (identity.group == "web") { + self.identities.web = JSKitLib.filter(function(i) { + return i.url != identity.url; + }, self.identities.web); + } else { + identity.user = undefined; + identity.use_as_from = false; + } + break; + case "bind": + self.appendIdentity(identity); + break; + case "update": + identity.url = newData.url; + break; + } + JSKW$Events.deRegisterEventCallback(eventContext, f, eventName); + if (onSuccess) onSuccess(); + } + var eventContext = JSKW$Events.registerEventCallback(undefined, f, "JSKitAuth_identityAction"); + var params = { + 'action': action, + 'type': identity.type, + 'group': identity.group, + 'url': identity.url + } + if (action == "update") params.newurl = newData.url; + new JSRVC({uri: this.uriDomain + '/user-identity-action', + 'ref': this.ref, + 'epb': window.JSKitEPB ? JSKitEPB.getAsHash() : {}, + 'target': this.target, request: params}); +} + +JSKAuth.prototype.actualizeGFCprofileURL = function(url, domain, siteID) { + url = url.replace(/\/\/js-kit.com/, "//" + domain); + url = url.replace(/site=(.*)/, "site=" + siteID); + return url; +} + +JSKAuth.prototype.drawSelector = function(container) { + if (!container) return; + var self = this; + var selector = this.createAuthSelector(0, function() { + if (this.selectedIndex == 0) return; + self.show(this.value); + }, true); + JSKitLib.removeChildren(container); + container.appendChild(selector); +} + +function JSKAuth(config) { + this.areas = {}; + this.uriDomain = (window.location.protocol.substr(0, 4) != 'http' ? 'http:' : '') + '//js-kit.com'; + this.passwordRecoveryData = {}; + JSKitLib.fmap.call(this, config, function(v, k){ this[k] = v; }); + this.identities = this.readIdentities(config.identities); + var firstIdentity = this.getFirstAuthIdentity(); + this.defaultActiveArea = firstIdentity && firstIdentity.type; + this.authForm = this.assemble(); + this.prepareAuthForm(); + this.loadCss(); +} + + + + + + +function JSDL(elmParent, arrDragElms) { + var self = this; + self.isIE = JSKitLib.isIE(); + var drgElms = arrDragElms || [elmParent]; + for(var i=0; i= maxLeft ? maxLeft : (left < 0 ? 0 : left)) + "px"; + self.elmParent.style.top = (mousePos.y - self.starty < 0) ? 0 : (mousePos.y - self.starty) + "px"; + } + + var onStopDragHandler = function(event) { + event = event || window.event; + JSKitLib.removeHandlers(document, onMoveDragHandler, onStopDragHandler, self.elmParent); + JSKitLib.stopEventPropagation(event); + if(self.elmParent.jsk$on_stop_drag) self.elmParent.jsk$on_stop_drag(e); + } + + JSKitLib.addHandlers(document, onMoveDragHandler, onStopDragHandler, self.elmParent); + JSKitLib.stopEventPropagation(e); + JSKitLib.preventDefaultEvent(e); + if(self.elmParent.jsk$on_start_drag) self.elmParent.jsk$on_start_drag(e); +} + + + + + +function JSKAvatars(config) { + JSKitLib.fmap.call(this, config, function(value, key) { this[key] = value; }); + this.controls = this.controls || []; + this.avatarPreviewImgs = {}; + this.avatars = this.getAsHash(this.avatars); + this.menuItems = this.prepareMenuItems(this.identities, this.avatars); + this.activateEvents(); + this.loadCSS(); +} + +JSKAvatars.prototype._labels = { + "anonymousAvatar": "No avatar", + "jskitAvatar": "My computer", + "gravatarEmail": "Gravatar email", + "useAvatarFrom": "Use my avatar from...", + "clickToEditAvatars": "Click to edit avatars", + "actionUploadAvatar": "Click to upload avatar from your computer", + "actionEditGravatarEmail": "Click to edit Gravatar email" +} + +JSKAvatars.prototype.label = function(name) { + return this.labels && this.labels(name) != name && this.labels(name) || this._labels[name] || name; +} + +JSKAvatars.prototype.getAsHash = function(avatars) { + return JSKitLib.foldl({}, avatars, function(avatar, acc) { acc[avatar.type] = avatar; }); +} + +JSKAvatars.prototype.getAvatarByType = function(type) { + return this.avatars[type] || this.anonymousAvatarData(); +} + +JSKAvatars.prototype.formatMenuItem = function(type, descriptors, extraParams, icon, title) { + var self = this; + var avatar = this.getAvatarByType(type); + var item = { + "type": "Radio", + "icon": icon || ("//cdn.js-kit.com/images/favicons/" + type + ".png"), + "title": self.assembleMenuItemTitle(type, avatar, title, descriptors), + "state": avatar.chosen ? "checked" : "unchecked", + "avatarType": type, + "extend": { + "setState": function() { + if (this.endingNode) JSKitLib.show(this.endingNode); + }, + "renderEnding": function(element) { + JSKitLib.addClass(element, "jskit-AvatarMenuItemEnding"); + self.avatarPreviewImgs[type] = element; + self.setPreviewImage(type, avatar); + } + }, + "oncheck": function(title) { + self.updateActiveAvatar(self.getAvatarByType(type)); + if (self.autoSave) { + self.saveAvatarState(); + JSKW$Events.syncBroadcast("JSKitAvatars_replaceAvatars", + [self.getAvatarByType(type)], undefined, self.id); + } + if (extraParams["oncheckCallback"]) { + extraParams["oncheckCallback"].call(this); + } + } + }; + return JSKitLib.foldl(item, extraParams || {}, function(value, acc, key) { acc[key] = value; }); +} + +JSKAvatars.prototype.saveAvatarState = function() { + var activeAvatar = this.getActiveAvatar(); + this.sendServerRequest("activate", activeAvatar ? {"name": activeAvatar.name} : {}); +} + +JSKAvatars.prototype.prepareMenuItems = function(identities, avatars) { + var self = this; + var itemsEPB = JSKitLib.fmap(avatars, function(avatar, type) { + if (!type.match(/^http:\/\/.*/)) return; + var params = avatars[type].params || {}; + var item = self.formatMenuItem( + type, + {}, + {"state": self.getAvatarByType(type).chosen ? "checked" : "unchecked"}, + params.favicon || '//cdn.js-kit.com/images/favicons/default.png', + params.long_label || JSKAuth.prototype.getIdentityLabel('epb') + ); + return item; + }); + var itemsThirdParty = JSKitLib.fmap(identities, function(identity, type) { + if (identity.authenticated && !avatars[type]) return; + return self.formatMenuItem(type, {}, { + "state": identity.authenticated ? + self.getAvatarByType(type).chosen ? "checked" : "unchecked" : + "disabled", + "action": identity.action ? function() { identity.action(); } : undefined + }, undefined, identity.title); + }); + return JSKitLib.merge( + {"title": JSKitLib.html('
      ' + this.label("useAvatarFrom") + '
      '), "type": "HTML"}, + this.assembleAnonymousFormItem(), + this.assembleUploadFormItem(), + itemsEPB, + itemsThirdParty, + this.assembleGravatarsForm(), + {"title": JSKitLib.html(''), "type": "HTML"} + ); +} + +JSKAvatars.prototype.anonymousAvatarData = function() { + return {"name": "gxpA99f0jKlohF_DgthroT.png", "type": "anonymous", "width": "100", "height": "100"}; +} + +JSKAvatars.prototype.classifyAvatarType = function(type) { + return type.match(/^http:\/\//) ? 'epb' : type; +} + +JSKAvatars.prototype.assembleMenuItemTitle = function(type, avatar, title, descriptors) { + type = this.classifyAvatarType(type); + var template = + '
      ' + + '
      ' + (title || this.label(type + "Avatar")) + '
      ' + + '
      '; + return JSKitLib.toDOM(template, "js-kit-avatars-", descriptors || {}).content; +} + +JSKAvatars.prototype.assembleAnonymousFormItem = function() { + return this.formatMenuItem("anonymous", {}, { + "state": this.getActiveAvatar() ? "unchecked" : "checked" + }, "//cdn.js-kit.com/images/favicons/noname.png"); +} + +JSKAvatars.prototype.assembleUploadFormItem = function() { + var self = this; + var descriptor = function(element, dom) { + dom.get("itemTitle").title = self.label("actionUploadAvatar"); + self.uploadForm = self.assembleUploadForm(element); + self.uploadForm.label = dom.get("itemTitle"); + JSKitLib.addChild(element, self.uploadForm.content); + JSKitLib.hide(self.uploadForm.content); + element.onclick = function() { + render("form"); + }; + }; + var render = function(element) { + var isFormVisible = element == "form"; + JSKitLib.hide(self.uploadForm[isFormVisible ? "label" : "content"]); + JSKitLib.show(self.uploadForm[isFormVisible ? "content" : "label"]); + }; + JSKW$Events.registerEventCallback(self.eventsCtx, function() { + render("label"); + }, "JSMenu-CollapseAll"); + return this.formatMenuItem("jskit", {"itemTitleContainer": descriptor}, { + "onuncheck": function() { render("label"); }, + "oncheckCallback": function() { if (!self.avatars["jskit"]) render("form"); } + }, "//cdn.js-kit.com/images/favicons/default.png"); +} + +JSKAvatars.prototype.assembleGravatarsForm = function() { + var self = this; + var descriptor = function(element) { + self.gravatarControlContainer = element; + self.renderGravatarControl(); + }; + return this.formatMenuItem("gravatar", {"itemTitle": descriptor}, { + "onuncheck": function() { + if (!self.gravatarEmail) self.gravatarEmailIPE.displayMode(); + }, + "oncheckCallback": function() { + if (!self.gravatarEmail) self.gravatarEmailIPE.editMode(); + } + }); +} + +JSKAvatars.prototype.setDefaultGravatar = function() { + var anonymous = this.anonymousAvatarData(); + this.avatars["gravatar"] = anonymous; + this.setPreviewImage("gravatar", anonymous); + this.updateActiveAvatar(anonymous); +} + +JSKAvatars.prototype.renderGravatarControl = function() { + var self = this; + var size = this.splitAvatarDim(this.size); + var anonymous = this.anonymousAvatarData(); + var defaultUrl = this.avatarURL(this.calcAvatarDim(size, anonymous).name); + this.gravatarEmailIPE = new JSIPE2({ + "obj": self, + "property": "gravatarEmail", + "title": self.label("actionEditGravatarEmail"), + "width": "120px", + "maxLength": 50, + "hideApplyBtn": true, + "defaultText": self.label("gravatarEmail"), + "textModeDisplayCSS": "block", + "editModeEventEnabled": true, + "jsk$wasEdited": function() { + self.setPreviewImage("gravatar"); + var params = self.gravatarEmail ? { + "email": self.gravatarEmail, + "defaultUrl": defaultUrl, + "rating": "X", + "size": 64 + } : {}; + if (!self.gravatarEmail) { + self.setDefaultGravatar(); + } + if (self.autoSave) { + JSKW$Events.syncBroadcast("JSKitAvatars_gravatarEmailUpdated", + self.gravatarEmail, undefined, self.id); + } + self.sendServerRequest("update_gravatar", params); + } + }); + JSKitLib.replaceChildren(self.gravatarControlContainer, self.gravatarEmailIPE.div); +} + +JSKAvatars.prototype.setPreviewImage = function(type, avatar) { + if (!this.avatarPreviewImgs[type]) return; + var loading = { + "name": "//cdn.js-kit.com/images/loading.gif", + "width": "16", + "height": "16" + }; + this.assembleAvatar({ + "instance": this.avatarPreviewImgs[type], + "width": "24", + "height": "24" + }, avatar || loading); +} + +JSKAvatars.prototype.getGravatarURL = function(gravatarID, size) { + if (!gravatarID || gravatarID.match(/^https?:\/\//)) return gravatarID; + var defaultUrl = this.calcAvatarDim(size, this.anonymousAvatarData()).name; + return 'http://www.gravatar.com/avatar.php?' + + 'gravatar_id=' + gravatarID + + '&default=' + this.avatarURL(defaultUrl) + + '&rating=X' + + '&size=' + size.width + 'x' + size.height; +} + +JSKAvatars.prototype.splitAvatarDim = function(dim) { + var re = /(\d+)x(\d+)/; + var size = re.exec(dim) || ['96x96', '96', '96']; + return {"width": size[1], "height": size[2]}; +} + +JSKAvatars.prototype.calcAvatarDim = function(size, avatar) { + if (!size || typeof(size) != "object") size = this.splitAvatarDim(size); + var width = parseInt(avatar.width); + var height = parseInt(avatar.height); + var MW = parseInt(size.width || 96); + var MH = parseInt(size.height || 96); + if(avatar.name.match(/https?:\/\//)) { + return {'width': width, 'height': height, 'name': avatar.name}; + } else if ((MW>=96)&&(MH>=96)&&(width<=100)&&(height<=100)){ + return {'width': width, 'height': height, 'name': avatar.name}; + } else if ((MW
      '); + var image = JSKitLib.html(''); + if (avatar.onerror) { + image.onerror = avatar.onerror; + } + var adjustedAvatar = this.calcAvatarDim(container, avatar); + var getMinSize = function(dim) { + return Math.min(adjustedAvatar[dim], container[dim]); + }; + var getSizeDiff = function(dim) { + return Math.max(0, container[dim] - adjustedAvatar[dim])/2; + }; + setSize(image, { + "width": getMinSize("width"), + "height": getMinSize("height") + }); + setSize(wrapper, container); + JSKitLib.addStyle(image, + "margin-top: " + getSizeDiff("height") + "px;" + + "margin-left: " + getSizeDiff("width") + "px;"); + JSKitLib.replaceChildren(wrapper, image); + return wrapper; +} + +JSKAvatars.prototype.updateActiveAvatar = function(avatar) { + var size = this.splitAvatarDim(this.size); + var data = this.calcAvatarDim(size, avatar); + var container = { + "instance": this.container, + "width": size.width, + "height": size.height + }; + JSKitLib.fmap(this.avatars, function(avt) { avt.chosen = avt.type == avatar.type; }); + return this.assembleAvatar(container, data); +} + +JSKAvatars.prototype.getAvatars = function() { return this.avatars || []; } + +JSKAvatars.prototype.getActiveAvatar = function() { + return JSKitLib.foldl(undefined, this.avatars || [], function(avatar) { + if (avatar.chosen) return avatar; + }); +} + +JSKAvatars.prototype.avatarURL = function(avatar) { + if(avatar.match(/^(https?:)*\/\//)) { + return JSKitLib.htmlUnquote(avatar); + } else if(avatar.match(/^[^/]+$/)) { + return this.uriAvatar + avatar; + } else return ""; +} + +JSKAvatars.prototype.sendServerRequest = function(action, params) { + JSKitLib.fmap.call(this, ["id", "ref"], function(name) { params[name] = this[name]; }); + new JSRVC({"uri": this.uriAvatar + action, "request": JSKitEPB.getAsHash(params)}); +} + +JSKAvatars.prototype.replaceAvatars = function(avatars) { + if (!avatars.length) return; + var avatar = JSKitLib.cloneObject(avatars[0]); + this.avatars[avatar.type] = avatar; + if (!this.menu) return; + this.setPreviewImage(avatar.type, avatar); + this.updateActiveAvatar(avatar); + this.updateMenuItemsStatus(avatar); +} + +JSKAvatars.prototype.updateMenuItemsStatus = function(avatar) { + JSKitLib.fmap(this.menu.items, function(item) { + if (avatar.type == item.avatarType) item.setActiveState(); + }); +} + +JSKAvatars.prototype.activateEvents = function() { + var self = this; + var handlers = { + "replaceAvatars": function(avatars) { + self.replaceAvatars(avatars); + }, + "gravatarEmailUpdated" : function(gravatarEmail) { + self.gravatarEmail = gravatarEmail; + self.renderGravatarControl(); + if (!self.gravatarEmail) { + self.setDefaultGravatar(); + } + } + }; + JSKitLib.fmap(handlers, function(handler, name) { + JSKW$Events.registerEventCallback(self.eventsCtx, function(name, data, id, callerId) { + if (!self.yours) return; + if ((id && (id == self.id || id.match(/profile/))) || (callerId && callerId != self.id)) handler(data); + }, "JSKitAvatars_" + name); + }); +} + +JSKAvatars.prototype.deActivateEvents = function() { + if (this.eventsCtx) JSKW$Events.invalidateContext(this.eventsCtx); +} + +JSKAvatars.prototype.syncAvatarsChanges = function() { + JSKW$Events.syncBroadcast("JSAvatars_replaceAvatars", this.getAvatars(), undefined, this.id); +} + +JSKAvatars.prototype.assembleUploadForm = function(container) { + var self = this; + var template = + '
      ' + + '' + + '
      '; + var setControlsState = function(state) { + JSKitLib.fmap(self.controls, function(control) { + if (control && !control.btnLocked) control.disabled = (state == "lock") ? "true" : ""; + }); + } + var descriptors = { + "form": function(element) { + JSKitLib.fmap(JSKitEPB.getAsHash({"ref": self.ref}), function(v, k) { + element.appendChild(JSKitLib.html('')); + }); + container.appendChild(element); + }, + "control": function(element, dom) { + var form = dom.get("form"); + var onload = function() { + setControlsState("unlock"); + form.reset(); + self.sendServerRequest("list", {"onlyjskit": "true"}); + }; + self.controls.push(element); + element.onchange = function() { + self.setPreviewImage("jskit"); + if (!form.target) { + var tgt = 'js-ifrm-' + Math.random(); + JSKitLib.createHiddenIframe(tgt, self.target, onload, false); + form.target = tgt; + } + form.submit(); + setControlsState("lock"); + } + } + }; + return JSKitLib.toDOM(template, "js-kit-avatars-upload-", descriptors); +} + +JSKAvatars.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-avatars-wrapper { cursor: pointer; }" + + ".js-kit-avatars-wrapper .jskit-MenuItemTitle { margin: 1px; }" + + ".js-kit-avatars-wrapper div.jskit-MenuRootHTML { text-align: left; }" + + ".js-kit-avatars-avatarWrapper { text-align: left; " + (JSKitLib.isPreIE8() ? "zoom: 1;" : "") + "}" + + ".js-kit-avatars-itemTitleContainer { margin: 4px 5px 0px 0px; }" + + ".js-kit-avatars-itemTitleCnt-jskit, .js-kit-avatars-itemTitleCnt-gravatar { margin-top: 0px; line-height: 20px; }" + + ".js-kit-avatars-menu-title { font-size: 10px; font-weight: bold; font-family: Lucida grande,Tahoma,Verdana,Arial; margin: 5px 8px; }" + + ".js-kit-avatars-menu-footer { margin-top: 8px; }" + + ".js-kit-avatars-upload-form { margin: 0px; }" + + ".js-kit-clear { clear: both; }", "avatars" + ); +} + + + + + +function JSTabsManager(tabs, areas, config) { + var self = this; + if (tabs.length < 1 || !areas) return; + JSKitLib.fmap({ + "tabs" : tabs, + "areas" : areas, + "config": config || {} + }, function(value, key) { self[key] = value; }); + this.loadCSS(); + this.setActiveTab(this.getActiveTab()); + this.displayTabs(tabs, this.areas.titles); +} + +JSTabsManager.prototype.displayTabs = function(tabs, container) { + JSKitLib.removeChildren(container); + JSKitLib.fmap.call(this, tabs, function(tab) { container.appendChild(this.initFromData(tab)); }); + container.appendChild(JSKitLib.html('
      ')); + if (tabs.length == 1) JSKitLib.addClass(container, "js-kit-tabs-singleTab"); + var activeTab = this.getActiveTab(); + if (this.config.mode != "toggle" || activeTab) this.displayTab(activeTab); + else if (!activeTab) JSKitLib.hide(this.areas.content); +} + +JSTabsManager.prototype.initFromData = function(tab) { + var self = this; + var prefix = "js-kit-tab-"; + var descriptors = { + "icon": function(element) { + if (tab.icon) JSKitLib.addPNG(element, tab.icon); else JSKitLib.hide(element); + }, + "title": function(element) { + if (typeof(tab.title) == "string") tab.title = JSKitLib.text(tab.title); + element.appendChild(tab.title); + JSKitLib.preventSelect(element); + } + }; + var dom = JSKitLib.toDOM(this.config.template || this.template, prefix, descriptors); + if (this.config.descriptors) { + var elements = JSKitLib.foldl({}, this.config.descriptors, function(value, acc, key) { if (dom.get(key)) acc[prefix + key] = dom.get(key); }); + JSKitLib.attachDescriptors2Elements(elements, prefix, this.config.descriptors); + } + dom.content.onclick = function(e) { + if (self.config.mode == "toggle" && tab.active) { + tab.active = false; + self.renderView(); + self.processCallback(tab, "Closed"); + JSKitLib.hide(self.areas.content); + } else { + if (tab.active) return; + self.processCallback(self.activeTab, "Closed"); + self.setActiveTab(tab); + self.displayTab(tab); + } + JSKitLib.stopEventPropagation(e); + } + if (tab.name) JSKitLib.addClass(dom.content, prefix + tab.name); + tab.cache = {"title" : dom.content}; + return dom.content; +} + +JSTabsManager.prototype.processCallback = function(tab, action) { + if (tab && tab.callbacks && tab.callbacks["onTab" + action]) tab.callbacks["onTab" + action](tab); +} + +JSTabsManager.prototype.getActiveTab = function() { + return JSKitLib.foldl(undefined, this.tabs, function(tab, result) { if (tab.active) return tab; }) || (this.config.mode != "toggle" ? this.tabs[0] : undefined); +} + +JSTabsManager.prototype.setActiveTab = function(tab) { + if (!tab) return; + if (this.activeTab) this.activeTab.active = false; + this.activeTab = tab; + this.activeTab.active = true; +} + +JSTabsManager.prototype.renderView = function() { + var area = this.areas.content; + var activeTabPosition; + JSKitLib.removeClass(area, "js-kit-lastTabActive"); + JSKitLib.removeClass(area, "js-kit-firstTabActive"); + JSKitLib.fmap.call(this, this.tabs, function(tab, idx) { + if (tab.cache.title) JSKitLib[(tab.active ? "add" : "remove") + "Class"].call(this, tab.cache.title, "js-kit-tab-active"); + if (tab.active) activeTabPosition = (idx == this.tabs.length - 1) ? "last" : (idx == 0 ? "first" : undefined); + }); + if (activeTabPosition) JSKitLib.addClass(area, "js-kit-" + activeTabPosition + "TabActive"); +} + +JSTabsManager.prototype.displayTab = function(tab) { + var area = this.areas.content; + this.renderView(); + if (this.config.mode == "toggle") JSKitLib.show(area); + if (!tab.cache.content || this.config.nocache) tab.cache.content = tab.content(area); + JSKitLib.replaceChildren(area, tab.cache.content); + this.processCallback(tab, "Opened"); +} + +JSTabsManager.prototype.collapseTabs = function() { + if (this.config.mode != "toggle") return; + if (this.activeTab) { + this.activeTab.active = false; + delete this.activeTab; + } + this.renderView(); + JSKitLib.hide(this.areas.content); +} + +JSTabsManager.prototype.template = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + +JSTabsManager.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-tab { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " float: left; cursor: pointer; margin: 0; font-size: 14px; background: transparent; padding: 5px 10px " + (JSKitLib.isIE() ? "0" : "5") + "px 10px; }" + + ".js-kit-tab-icon { float: left; width: 17px; height: 17px; margin: 0px 5px 0 0; }" + + ".js-kit-tab-title { font-size: 12px; float: left; }" + + ".js-kit-tab-active { font-weight: bold; cursor: text; background: #FFFFFF; }" + + ".js-kit-tabs-singleTab { display: none; }" + + ".js-nsgecko { -moz-user-select: none; }" + + ".js-kit-clear { clear: both; }", "tabsManagement"); +} + + + + + +function JSKitMiniProfile(target, data, config) { + var self = this; + this.data = data; + this.target = target; + this.config = this.merge(config, { + "mode": "popup", + "template": this.template, + "cssPrefix": "js-kit-miniProfileWrap", + "elmPrefix": "js-kit-miniProfile-", + "descriptors": {} + }); + this.loadCSS(); + if (this.config.mode == "popup") + JSKW$Events.registerEventCallback(undefined, function() { self.hide(); }, "miniProfile_collapseAll"); + this.assemble(); +} + +JSKitMiniProfile.prototype.assemble = function() { + var self = this; + this.descriptors = { + "name": function() { return JSKitLib.html('' + JSKitLib.trim(self.data.Name) + ''); }, + "viewDetails": function() { return JSKitLib.text(self.label("viewDetails")); }, + "siteLinksIcons": function(element) { return self.assembleSiteLinks("icons", element); }, + "siteLinksExtended": function(element) { return self.assembleSiteLinks("extended", element); } + }; + this.dom = JSKitLib.toDOM(this.config.template, this.config.elmPrefix, this.descriptors); + JSKitLib.addClass(this.dom.content, this.config.cssPrefix + " " + this.config.elmPrefix + this.config.mode); + var elements = JSKitLib.foldl({}, this.config.descriptors, function(descriptor, container, name) { + if (self.dom.get(name)) container[name] = self.dom.get(name); + }); + JSKitLib.attachDescriptors2Elements(elements, "", this.config.descriptors); + this.display(); +} + +JSKitMiniProfile.prototype.display = function(target) { + if (!this.dom) return; + if (this.config.mode == "popup") JSKW$Events.syncBroadcast("miniProfile_collapseAll"); + JSKitLib.addChild(target || this.target, this.dom.content); + this.dom.content.onclick = function(e) { JSKitLib.stopEventPropagation(e); }; + this.isVisible = true; +} + +JSKitMiniProfile.prototype.render = function(block, data) { + var self = this; + var element = this.dom.get(block); + if (!element) return; + JSKitLib.removeChildren(element); + this.data = this.merge(data, this.data); + var name = this.config.elmPrefix + block; + var replacement = {}; + replacement[name] = element.cloneNode(true); + JSKitLib.fmap([self, self.config], function(obj) { + JSKitLib.attachDescriptors2Elements(replacement, self.config.elmPrefix, obj.descriptors || {}); + }); + element.parentNode.replaceChild(replacement[name], element); + this.dom.set(block, replacement[name]); +} + +JSKitMiniProfile.prototype.hide = function() { + if (!this.isVisible || !this.dom) return; + this.isVisible = false; + this.dom.content.parentNode.removeChild(this.dom.content); +} + +JSKitMiniProfile.prototype.getContent = function() { + return this.dom ? this.dom.content : undefined; +} + +JSKitMiniProfile.prototype.assembleSiteLinks = function(mode, element) { + var self = this; + var auth = JSKitLib.fmap(self.data.identities.auth, function(identity) { + if (identity.user) return identity; + }); + var identities = JSKitLib.merge(auth, self.data.identities.web); + if (identities.length < 1) return JSKitLib.hide(element); else JSKitLib.show(element); + var setAction = function(element, type, url, domain, identity, isLogin) { + var isExternalProfile = isLogin && !!url && !type.match(/jskit|haloscan|openid/); + var isDisabled = isLogin && !isExternalProfile && self.config.isNativeProfileDisabled; + element.onclick = function() { + if (isLogin && !isExternalProfile) { + if (!isDisabled) self.config.openFullProfile(); + return; + } + if (isLogin) { + // validation of old format profile URLs + if ((type == "gfc" && !url.match(/canvas.html/)) + || (type == "yahoo" && !url.match(/profiles.yahoo.com\/u\//))) { + element.title = self.label("openFullProfile"); + self.config.openFullProfile(); + return; + } + if (type == "gfc" && identity.params.site) { + url = JSKAuth.prototype.actualizeGFCprofileURL(url, identity.params.domain, identity.params.site); + } + } + window.open(url.replace(/\ /g, "%20")); + }; + if (isDisabled) { + JSKitLib.addClass(element, "js-kit-miniProfile-profileDisabled"); + } else { + var title = isExternalProfile ? "ext_profile_" + type : "openFullProfile"; + element.title = isLogin ? self.label(title) : url; + } + }; + var container = JSKitLib.html(''); + var specificTemplate = mode == "icons" ? + '
      ': + '
      ' + this.label("visitMeOn") + '
      '; + container.appendChild(JSKitLib.html(specificTemplate)); + JSKitLib.fmap.call(this, mode == "icons" ? identities.reverse() : identities, function(identity) { + if (!identity.use_as_from) return; + var isLogin = identity.group != "web"; + var type = isLogin ? identity.type : "default"; + var url = ''; + var domain = ''; + if (identity.url) { + url = (isLogin || identity.url.match(/^(https?:)*\/\//) ? "" : "http://") + identity.url; + domain = JSKitLib.extractDomain(url); + } + var title = !isLogin ? domain : JSKAuth.prototype.getIdentityParam('short_label', identity, JSKAuth.prototype.getIdentityLabel(type)) || domain; + var template = + '
      ' + + '
      ' + + '' + + '
      ' + + '
      '; + var descriptors = { + "icon": function(element) { + JSKitLib.addPNG(element, JSKAuth.prototype.getIdentityParam('favicon', identity, "//cdn.js-kit.com/images/favicons/" + type + ".png")); + setAction(element, type, url, domain, identity, isLogin); + }, + "link": function(element) { + if (mode == "icons") JSKitLib.hide(element); else setAction(element, type, url, domain, identity, isLogin); + } + }; + JSKitLib.addChild(container, JSKitLib.toDOM(template, "js-kit-linksItem-", descriptors).content, mode == "icons"); + }); + return container; +} + +JSKitMiniProfile.prototype.label = function(name) { return this.config.labels("miniProf_" + name); } + +JSKitMiniProfile.prototype.merge = function(masterObj, slaveObj) { + var merge = function(cnt, obj) { return JSKitLib.foldl(cnt, obj || {}, function(v, acc, k) { acc[k] = v; }); }; + return merge(merge({}, slaveObj), masterObj); +} + +JSKitMiniProfile.prototype.template = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + +JSKitMiniProfile.prototype.loadCSS = function() { + var dims = this.config.avatarSize; + var zoom = JSKitLib.isIE() ? "zoom: 1;" : ""; + var prefix = "." + this.config.cssPrefix.match(/[^\ ]*/); + var margin = parseInt(dims.width) + 10; + JSKitLib.addCss( + prefix + " .js-kit-miniProfileDataWrap { " + zoom + "margin-left: " + margin + "px; }" + + prefix + " .js-kit-miniProfile-avatar { float: left; margin-right: -" + margin + "px; width: " + dims.width + "px; height: " + dims.height + "px; }", "miniProfile-" + this.config.cssPrefix.replace(/[^a-zA-Z-]/g, "-")); + JSKitLib.addCss( + ".js-kit-miniProfile { padding: 7px; text-align: left; font-weight: normal; cursor: default; background: #FFFFFF; }" + + ".js-kit-miniProfile-popup { position: absolute; z-index: 13490; width: 275px; border: 2px solid #d6e2e9; -moz-border-radius: 5px; -webkit-border-radius: 5px; }" + + ".js-kit-miniProfile-embedded { border: 1px solid #BBBBBB; }" + + ".js-kit-miniProfile-avatar { position: relative; }" + + ".js-kit-miniProfile-embedded .js-kit-miniProfile-avatar { border: 1px solid #BBBBBB; }" + + ".js-kit-miniProfileDataContainer { float: left; width: 100%; }" + + ".js-kit-miniProfile-stats { color: #0066CC; font-size: 10px; }" + + ".js-kit-miniProfile-viewDetails { color: #0066CC; font-size: 10px; }" + + ".js-kit-miniProfile-name { font-size: 18px; color: #000000; }" + + ".js-kit-miniProfile-siteLinksExtended { margin-top: 5px; font-size: 20px; border-top: 2px dotted #E4E4E4; }" + + ".js-kit-miniProfile-siteLinksIcons { border-top: 2px dotted #7d7d7d; }" + + ".js-kit-miniProfile-siteLinksIcons .js-kit-linksItem { width: 16px; height: 16px; float: left; }" + + ".js-kit-linksItem { margin: " + (JSKitLib.isIE() ? "3px 3px" : "4px 6px") + " 0px 0px; line-height: 16px; }" + + ".js-kit-linksItem-link { float: left; " + zoom + " color: #476CB8 !important; margin-left: 5px; font-size: 12px; cursor: pointer; }" + + ".js-kit-linksItem-icon { float: left; width: 16px; height: 16px; margin: 0px " + (JSKitLib.isIE() ? "5" : "3") + "px 0px 0px; font-size: 12px; padding: 0px; cursor: pointer; }" + + ".js-kit-linksContainerTitle { margin: 7px 3px; color: #000000; font-size: 12px; font-weight: bold; }" + + ".js-kit-miniProfile-profileDisabled { cursor: default; }" + + ".js-kit-clear { clear: both; }", "miniProfile"); +} + + + + + +function JSKbdHandler(element, events) { + + this.kbdCallback = function(e) { + var event = e || window.event; + var key = event.charCode || event.keyCode; + if (key == 9 || key == 13 || key == 27) JSKitLib.preventDefaultEvent(event); + if(JSKitLib.isSafari()) JSKitLib.stopEventPropagation(event); + for(var i = 0; i < events.length; i++) { + for(var j = 0; j < events[i].keys.length; j++) { + if(typeof(events[i].keys[j]) == "string") events[i].keys[j] = String.charCodeAt(events[i].keys[j]); + var shiftCondition = (events[i].shift != undefined) ? events[i].shift == event.shiftKey : true; + if (events[i].keys[j] == key && shiftCondition) { + if(!events[i].args) + (events[i].action)(); + else + events[i].action.apply(events[i], events[i].args); + } + } + } + } + + if(element.addEventListener) { + if(JSKitLib.isSafari()) element.addEventListener("keydown", this.kbdCallback, false); + else if(JSKitLib.isOpera()) element.addEventListener("keydown", this.kbdCallback, false); + else element.addEventListener("keypress", this.kbdCallback, false); + } else { + element.onkeydown = this.kbdCallback; + } +} + + + + + +function JSIPE2(obj) { +/* + JSIPE2 API + + obj: object contains property + title: hint + defaultText: default text in created div + property: property where save the result + maxLength: max string length + width: input width + jsk$validate callback, validates the value before applying + jsk$wasEdited callback, called at the end of editing + readonly: readonly mode + + example: + var jsipe = new JSIPE2({obj: elem, + property: 'descr', + title: 'Description', + defaultText: 'Add caption', + width: '90px', + maxLength: 12, + jsk$wasEdited: function(){...}, + readonly: true + }); + +*/ + + for(var i in obj) + this[i] = obj[i]; + var div = JSKitLib.cr(); + div.title = this.readonly ? "" : (this.title || $JCL("clickToEdit")); + var defaultText = this.readonly ? "" : (this.defaultText || $JCL("clickToEditEmpty")); + var maxTextLength = this.maxLength || 256; + var isFocused = false; + + var self = this; + + var textDivDisplayCSS = typeof(self.textModeDisplayCSS) != "undefined" ? self.textModeDisplayCSS : "inline"; + var textDiv = JSKitLib.cr({style:{display:textDivDisplayCSS}}); + var textValue = (JSKitLib.trim(self.obj[self.property]).length > 0) ? self.obj[self.property] : defaultText; + var text = JSKitLib.text(textValue); + textDiv.appendChild(text); + div.appendChild(textDiv); + + var editDiv = JSKitLib.cr(); + editDiv.style.display = "none"; + div.appendChild(editDiv); + var edit = JSKitLib.cr({t:"input", type:"edit", className:"jsipe-input", + style: "width: " + (self.width || "150px"), readonly: this.readonly}); + edit.value = this.obj[this.property] || ""; + editDiv.appendChild(edit); + + if (!this.hideApplyBtn) { + var applyDiv = JSKitLib.cr(); + JSKitLib.addClass(applyDiv, "jsipe-applyButton"); + applyDiv.title = "Apply"; + JSKitLib.addPNG(applyDiv, "//cdn.js-kit.com/images/tick.png"); + editDiv.appendChild(applyDiv); + } + + this.div = div; + + if (this.readonly) return; + + textDiv.onmouseover = function() { JSKitLib.addClass(textDiv, "jsipe-onmouseover"); } + textDiv.onmouseout = function() { JSKitLib.removeClass(textDiv, "jsipe-onmouseover"); } + + this.displayMode = function() { + JSKitLib.show(textDiv, textDivDisplayCSS); + JSKitLib.hide(editDiv); + textDiv.removeChild(text); + text = JSKitLib.text(self.obj[self.property] || defaultText); + textDiv.appendChild(text); + } + + this.editMode = function(e) { + if(!self.editModeEventEnabled) JSKitLib.stopEventPropagation(e); + JSKitLib.hide(textDiv); + JSKitLib.show(editDiv, "inline"); + edit.focus(); + edit.select(); + } + + var applyChanges = function() { + if(typeof self.jsk$validate == "function" && !self.jsk$validate(edit.value)) return; + if(edit.value == self.obj[self.property]) { self.displayMode(); return;} + if(edit.value.length > maxTextLength) { + alert("The text you entered cannot exceed "+ maxTextLength +" symbols"); + resetChanges(); + return; + } + self.obj[self.property] = edit.value = JSKitLib.trim(edit.value); + if(isFocused) edit.blur(); + self.displayMode(); + if(self.jsk$wasEdited) self.jsk$wasEdited(); + } + + this.resetChanges = function() { + edit.value = self.obj[self.property]; + if(isFocused) edit.blur(); + self.displayMode(); + } + + var jumpNextSibling = function() { + if(isFocused) edit.blur(); + if(self.nextSib) + self.nextSib.editMode(); + } + + var jumpPrevSibling = function() { + if(isFocused) edit.blur(); + if(self.prevSib) + self.prevSib.editMode(); + } + + if(this.dblclick) + textDiv.ondblclick = this.editMode; + else + textDiv.onclick = this.editMode; + edit.onblur = function() { applyChanges(); isFocused = false; }; + edit.onfocus = function() { isFocused = true; }; + edit.onclick = function(e) { JSKitLib.stopEventPropagation(e); } + if (!this.hideApplyBtn) applyDiv.onmousedown = applyChanges; + + new JSKbdHandler(edit, [ + {action:applyChanges, keys:[10,13]} + ,{action:this.resetChanges, keys:[27]} + ,{action:jumpNextSibling, keys:[9], shift:false} + ,{action:jumpPrevSibling, keys:[9], shift:true} + ]); +} + +JSIPE2.prototype.addNextSibling = function(next) { + if (next) { + this.nextSib = next; + next.prevSib = this; + } +} + + + + + +function JSIPE(obj) { + var self = this; + self.obj = obj; + var form = this.makeForm(obj.title); + var inp = form.input; + self.form = form; + + form.cleaner.onmousedown = function(e){ + inp.value = ""; + form.cleaner.style.visibility = "hidden"; + inp.focus(); + JSKitLib.preventDefaultEvent(e || window.event); + } + + var keyHandler = function(e) { + e = e || window.event; + setTimeout(function(){ + form.cleaner.style.visibility = (inp.value.length != 0) ? "visible" : "hidden"; + if(obj.type == "Tab" || obj.type == "Image") form.cleaner.style.display = "none"; + }, 0); + switch(e.keyCode || e.which) { + case 27: + JSKitLib.preventDefaultEvent(e); + if(obj.mode == "full") self.finishEditing(obj.field, obj.field.lastValue); + if(obj.jsk$on_cancel_exit) obj.jsk$on_cancel_exit(); + break; + case 10: case 13: + JSKitLib.preventDefaultEvent(e); + if (inp.value && obj.mode == "full") + self.finishEditing(obj.field, inp.value); + if(obj.jsk$on_submit_exit) obj.jsk$on_submit_exit(inp.value); + break; + case 9: + JSKitLib.preventDefaultEvent(e); + if (obj.siblings) obj.siblings[(obj.field.pos+1)%obj.siblings.length].tabKeyHandler(); + break; + } + } + self.addKeyHndl(keyHandler); + if (obj.inpSize) inp.style.width = obj.inpSize; + form.cleaner.style.visibility = "hidden"; + if(obj.mode == "form") return form; + + if(!window.jsipe$glob) window.jsipe$glob = {}; + var glob = window.jsipe$glob; + obj.field.style.cursor = "pointer"; + if(obj.siblings) obj.field.pos = obj.siblings.length; + + this.finishEditing = function(field, newValue) { + if(!field.input) return; + glob.isEditing = false; + field.input.onblur = JSKitLib.isOpera() ? undefined : ""; + field.input.onkeypress = JSKitLib.isOpera() ? undefined : ""; + field.input = null; + field.wasEdited(newValue); + field.style.textDecoration = field.oldDecoration; + } + + var onclickHandler = function() { + if(obj.field.input) return false; + if(obj.jsipe$start && !obj.jsipe$start()) return false; + if(glob.stopEditing) glob.stopEditing(); + if(obj.containerElement.tId) { + clearTimeout(obj.containerElement.tId); + obj.containerElement.tId = 0} + obj.field.oldDecoration = obj.field.style.textDecoration; + obj.field.isHtmlLink = obj.field.firstChild.tagName == 'A'; + obj.field.lastValue = obj.itemObject[obj.Property]; + obj.field.ondblclick = JSKitLib.isOpera() ? undefined : ""; + inp.type = 'text'; + inp.value = obj.itemObject[obj.Property]; + self.addKeyHndl(keyHandler); + + inp.onblur = function(e) { + if(self.form.input.value) { + self.finishEditing(self.obj.field, self.form.input.value); + if (obj.field.lastValue == self.form.input.value) { + if(obj.jsk$on_cancel_exit) obj.jsk$on_cancel_exit(self.form.input.value)} + else{ + if(obj.jsk$on_submit_exit) obj.jsk$on_submit_exit(self.form.input.value)} + }; + //Do not close field until non-empty + } + + obj.field.input = inp; + glob.stopEditing = function() { + glob.stopEditing = null; + if((obj.field.input)&&obj.field.input.value) self.finishEditing(obj.field, obj.field.input.value); + } + JSKitLib.removeChildren(obj.field); + obj.field.appendChild(form.main); + obj.field.style.textDecoration = "none"; + form.cleaner.style.visibility = (inp.value.length != 0) ? "visible" : "hidden"; + if(obj.type == "Tab" || obj.type == "Image") form.cleaner.style.display = "none"; + inp.onselectstart = function(e) { + JSKitLib.stopEventPropagation(e || window.event); + return true; + }; + obj.containerElement.onselectstart = function(e) { return true }; + inp.focus(); + inp.select(); + glob.isEditing = true; + return false; + } + + var ondblclickHandler = function() { + if(0 && obj.field.isHtmlLink) + window.location.href = this.firstChild.value; + } + + switch(obj.type) { + case "Tab": + obj.field.ondblclick = onclickHandler; + break; + case "Others": + obj.field.onclick = onclickHandler; + obj.field.tabKeyHandler = onclickHandler; + obj.field.ondblclick = ondblclickHandler; + break; + case "Search": case "Image": + obj.field.onclick = onclickHandler; + break; + } +} + +JSIPE.prototype.addKeyHndl = function(keyHandler){ + var inp = this.form.input; + switch(this.obj.type) { + case "Tab": + if (JSKitLib.isIE()) inp.onkeydown = keyHandler; + else if(JSKitLib.isSafari()) inp.onkeyup = keyHandler; + else inp.onkeypress = keyHandler; + break; + case "Others": case "Image": + if(JSKitLib.isOpera()) inp.onkeypress = keyHandler; + else inp.onkeydown = keyHandler; + break; + case "Search": + if (JSKitLib.isIE() || JSKitLib.isSafari()) + inp.onkeydown = keyHandler; + else inp.onkeypress = keyHandler; + break; + } +} + +JSIPE.prototype.makeForm = function(title){ + var text = this.dtContent.replace(/TITLE/, title || ""); + var div = JSKitLib.html(text); + var ctls = JSKitLib.mapClass2Object({}, div); + if(!title) ctls['js-JSIPETitle'].style.display = "none"; + return {'main': div,'input': ctls['js-JSIPEInput'], 'cleaner':ctls['js-JSIPECleaner']}; +} + +JSIPE.prototype.dtContent +='' ++' ' ++' ' ++' ' ++' ' ++' ' ++'
      TITLE' ++' ' ++'
      '; + + + + + +if(!window.JSKW$Events){ + var JSKW$Events = new JSEC(); +} + +///////////////////////////////////// +// JS Event Class +///////////////////////////////////// +function JSEC() { + this.contextHandles = []; +} + +JSEC.prototype.registerEventCallback = function (contextHandle, eventHandle, eventName) { + if(!contextHandle) { + contextHandle = new JSECC(eventHandle, eventName); + this.contextHandles.push(contextHandle); + contextHandle.cHdlId = this.contextHandles.length - 1; + } else { + contextHandle.registerEventCallback(eventHandle, eventName); + } + return contextHandle; +} + +JSEC.prototype.deRegisterEventCallback = function (contextHandle, eventHandle, eventName) { + contextHandle.deRegisterEventCallback(eventHandle, eventName); +} + +JSEC.prototype.syncBroadcast = function (eventName) { + var args = arguments; + JSKitLib.fmap(this.contextHandles, function(c){ + if(c) c.broadCast.apply(c, args); + }); +} + +JSEC.prototype.asyncBroadcast = function (eventName) { + var self = this; + var args = arguments; + setTimeout(function(){ + self.syncBroadcast.apply(self, args); + }, 0); +} + +JSEC.prototype.invalidateContext = function (contextHandle) { + if(contextHandle) { + contextHandle.invalidateContext(); + delete this.contextHandles[contextHandle.cHdlId]; + } +} + +///////////////////////////////////// +// JS Event Context Class +///////////////////////////////////// +function JSECC(eventHandle, eventName) { + this.registeredCallbacks = []; + if(eventName || eventHandle) this.registerEventCallback(eventHandle, eventName); +} + +JSECC.prototype.registerEventCallback = function (eventHandle, eventName) { + var ev = eventName || ''; + if(!this.registeredCallbacks[ev]) this.registeredCallbacks[ev] = []; + this.registeredCallbacks[ev].push(eventHandle); +} + +JSECC.prototype.deRegisterEventCallback = function (eventHandle, eventName) { + var ev = eventName || ''; + var self = this; + if(!eventHandle) { + delete this.registeredCallbacks[ev]; + return; + } + var k=0; + while(k=0 && Cnt) ? this.items.slice(sIdx, sIdx+Cnt) : []; +} + +JSPGC.prototype.deleteItems = function (sIdx, Cnt) { + var items = this.getItems(sIdx, Cnt); + var res = 0; + JSKitLib.fmap(this.getItems(sIdx, Cnt), function(e) { + res += (e && e.obj && + e.obj.status!='D' && e.obj.status!='DT') ? 1 : 0; + }); + this.items.splice(sIdx, Cnt); + this.itemsCount -= Cnt; + return res; +} + +JSPGC.prototype.setItemsCount = function (newItemsCount) { + if(newItemsCount0) this.items[newItemsCount-1] = undefined; + this.itemsCount = newItemsCount; + } +} + +JSPGC.prototype.getItemIdxById = function (itemId) { + var itemIdx; + for(var i=0; i=0 && Cnt) ? this.pages.slice(pageIdx, pageIdx+Cnt) : []; +} + +JSPGC.prototype.getPage = function (pageIdx) { + var pageArr = this.getPages(pageIdx, 1); + return (pageArr.length>0) ? pageArr[0] : undefined; +} + +JSPGC.prototype.getStartPageItem = function (pageIdx) { + return pageIdx * this.itemsPerPage; +} + +JSPGC.prototype.setPageCount = function (newPageCount, newItemsCount) { + while(this.pageCount0) this.deletePage(); + this.pageCount = newPageCount; + this.setItemsCount(newItemsCount); + if(!newItemsCount && newPageCount) this.setPageAttr(0, 1, {invalidData: false}); +} + +JSPGC.prototype.getPageAttr = function (pageIdx, Attr) { + var page = this.getPage(pageIdx); + return page ? page[Attr] : undefined; +} + +JSPGC.prototype.setPageAttr = function (pageIdx, Cnt, Attrs) { + JSKitLib.fmap(this.getPages(pageIdx, Cnt), + function(curPage) { + JSKitLib.fmap(Attrs, function(V,K){ curPage[K] = V }) + }); +} + +JSPGC.prototype.getPageByItemIdx = function(index) { + return Math.floor(index/this.itemsPerPage); +} + +JSPGC.prototype.getPageCntByItemCnt = function(itemCnt) { + return Math.ceil(itemCnt/this.itemsPerPage); +} + +JSPGC.prototype.setPageItems = function (startPage, newData) { + var pageCount = this.getPageCntByItemCnt(newData.length); + this.setPageAttr(startPage, pageCount, {invalidData: false, invalidVisualization: true}); + var startItem = this.getStartPageItem(startPage); + var self = this; + this.setItems(startItem, newData.length, JSKitLib.fmap(newData, function(C){ return self.newItem({obj: C}); })); +} + +JSPGC.prototype.addPageItem = function (item, itemIdx) { + if(this.pageCount*this.itemsPerPage==this.itemsCount) { + this.addPage(); + this.setPageAttr(this.pageCount-1, 1, {invalidData: false}); + } + var idx = (typeof itemIdx == "undefined") ? this.itemsCount : itemIdx; + this.addItem(item, idx); + var insertPageIdx = this.getPageByItemIdx(idx); + this.setPageAttr(insertPageIdx, this.pageCount-insertPageIdx, { invalidVisualization: true}); + for(var i=insertPageIdx+1; i1) this.deletePage(); + return res; +} + +JSPGC.prototype.getPageItems = function (pageIdx) { + var startItem = this.getStartPageItem(pageIdx); + var itemsCnt = this.getPageItemsCnt(pageIdx); + return this.getItems(startItem, itemsCnt); +} + +JSPGC.prototype.invalidatePagesView = function (pageIdx, Cnt) { + this.setPageAttr(pageIdx, Cnt, {invalidVisualization: true}); +} + +JSPGC.prototype.invalidatePages = function (pageIdx, Cnt) { + for(var i=0; i=this.pageCount) return cb(undefined); + var curPage = this.getPage(pageIdx); + var getPageFunc = function(){ self.getPageVisualization(pageIdx, cb); }; + if(this.getPageAttr(pageIdx, 'invalidData')) + return this.dataRequest(pageIdx, curPage, cb); + if(this.getPageAttr(pageIdx, 'invalidVisualization')) { + curPage.invalidVisualization = false; + return this.dataVisualizator(this.getStartPageItem(pageIdx), this.getPageItems(pageIdx), curPage, getPageFunc); + } + return cb(this.getPage(pageIdx).target, true); +} + +JSPGC.prototype.getPageItemsCnt = function(pageIdx) { + if(pageIdx<0 || pageIdx>=this.pageCount) return 0; + return (pageIdx==this.pageCount-1 ? (this.itemsCount-pageIdx*this.itemsPerPage) : this.itemsPerPage); +} + +JSPGC.prototype.getItemById = function(itemId) { + var itemsArr = this.getItems(this.getItemIdxById(itemId), 1); + return (itemsArr.length>0) ? itemsArr[0] : undefined; +} + +JSPGC.prototype.getPageByItemId = function(itemId) { + return this.getPageByItemIdx(this.getItemIdxById(itemId)); +} + +JSPGC.prototype.getFirstItem = function () { + if(this.itemsCount) { + var itemsArr = this.getItems(0, 1); + return (itemsArr.length>0) ? itemsArr[0] : undefined; + } else { + return undefined; + } +} + +JSPGC.prototype.invalidateItemView = function (itemId) { + var itemIdx = this.getItemIdxById(itemId); + this.invalidateItemsAttr(itemIdx, 1, 'html'); + var pageIdx = this.getPageByItemIdx(itemIdx); + this.invalidatePagesView(pageIdx, 1); +} + +JSPGC.prototype.invalidate = function () { + this.invalidatePages(0, this.pageCount); +} + + + + + +//////////////////// JSRVC +// requestObj +// request: {uri: someuri, param1: val1, param2: val2, ...} +// [transport: ("GET" | "POST")] +// [target: some_DOM_element] +// [variableRequest: [{param1_1: val1_1, param1_2: val1_2, ...}, +// {param2_1: val2_1, param2_2: val2_2,...}, ...]] +// [form: some_form] +// [onreturn: some_callback] +// [randevu : (true | false)] +// [requestId: some request identity] +// [trailer: specifies the name of parameter which should terminate +// each sub-request of multi-request] + +function JSRVC(requestObj) { + var s = this; + s.requestId = requestObj.requestId || s.generateRequestId(); + s.requestsInProgress = 0; + s.requestsQueue = []; + s.trailer = requestObj.trailer; + s.processRequest(requestObj); +} + +JSRVC.prototype.generateRequestId = function() { + return ((new Date()).valueOf() + Math.random()).toString(); +} + +JSRVC.prototype.processRequest = function(requestObj) { + var s = this; + s.error = undefined; + if(s.requestsInProgress) { + s.requestsQueue.push(requestObj); + return; + } + s.requestObj = requestObj; + if(s.requestObj.pickup && !s.eventCtx) s.eventCtx = JSKW$Events.registerEventCallback(s.eventCtx, function() {s.eventCallback.apply(s, arguments);}, "randevu_answer"); + var req = s.requestObj; + s.preProcessRequest(); + if(!req.transport) + req.transport = req.form ? "POST" : s.getRequestTransport(); + req.target = req.target || document.body; + var onCompleteCB = req.timeout ? function() { + s.startTimeoutTimer.call(s); + } : undefined; + var handlers = {'onload': s.onLoadRequest, 'onreadystatechange': s.onLoadRequest}; + switch(req.transport) { + case "GET": + s.processGETRequest(onCompleteCB, handlers); + break; + case "POST": + s.processPOSTRequest(onCompleteCB, handlers); + break; + } +} + +JSRVC.prototype.preProcessRequest = function() { + var req = this.requestObj; + if(!req.request) req.request = {}; + JSKitLib.fmap(req.epb || {}, function(v, k) { req.request[k] = v; }); + if (req.ref) req.request.ref = req.ref; + req.request.randevuId = this.requestId; + if(!req.variableRequest) req.variableRequest = []; + if(req.pickup) req.request.randevuRnd = Math.random(); +} + +JSRVC.prototype.calcGetRequest = function() { + var s = this; + var req = s.requestObj; + var reqvar = req.variableRequest; + var permGETReq = s.serializeRequest(req.request); + var varGETReq = JSKitLib.fmap(reqvar, function(el, idx){ + return s.serializeRequest(el, '[' + idx + ']'); + }); + return [permGETReq, varGETReq]; +} + +JSRVC.prototype.getRequestTransport = function() { + var ser = this.calcGetRequest(); + var permReq = ser[0]; + var varReq = ser[1]; + var firstReqLen = permReq.length + + (varReq.length>0 ? varReq[0].length : 0); + var totalReqLen = 0; + for(var i=0; i 1700) || (totalReqLen > 3400) ? + "POST" : "GET"); +} + +JSRVC.prototype.startTimeoutTimer = function() { + var s = this; + if(s.timeoutTimer) clearTimeout(s.timeoutTimer); + s.timeoutTimer = setTimeout(function() { s.timeoutExpired(); }, s.requestObj.timeout); +} + +JSRVC.prototype.timeoutExpired = function() { + this.timeoutTimer = undefined; + this.error = "timeout"; + this.returnAnswer(); +} + +JSRVC.prototype.returnAnswer = function(answerData) { + var s = this; + answerData = answerData || {}; + if(answerData.script) { + var script = document.createElement('script'); + script.text = answerData.script; + this.requestObj.target.appendChild(script); + } + if(s.requestObj.onreturn) { + s.requestObj.onreturn.call(s, s.error || "data", answerData.data); + } +} + +JSRVC.prototype.serializeRequest = function(obj, prefix) { + var s = this; + var toString = function(k, v) { + return encodeURIComponent(k) + (prefix || '') + "=" + encodeURIComponent(v); + }; + var request = JSKitLib.fmap(obj, function(v, k) { + if (s.trailer != k) return toString(k, v); + }); + if (s.trailer && typeof(obj[s.trailer]) != "undefined") { + request.push(toString(s.trailer, obj[s.trailer])); + } + return request.join("&"); +} + +JSRVC.prototype.setElementAttributes = function(obj, attrs) { + var s = this; + if (!obj) return; + JSKitLib.fmap(attrs, function(v, k) { + obj[k] = function() { v.call(s, obj) }; + }); +} + +JSRVC.prototype.runScript = function(src, data, handlers) { + var script = document.createElement('script'); + this.setElementAttributes(script, handlers); + script.setAttribute("charset", "utf-8"); + script.setAttribute("src", src + (data ? '?' + data : '')); + this.requestsInProgress++; + this.requestObj.target.appendChild(script); + this.script = script; +} + +JSRVC.prototype.processGETRequest = function(onCompleteCB, handlers) { + var s = this; + var ser = s.calcGetRequest(); + var reqperm = ser[0]; + var reqpermlen = reqperm.length; + var reqvar = ser[1]; + var reqvarlen = reqvar.length; + var currequest = ''; + for(var i=0; i 2000) { + s.runScript(s.requestObj.uri, + reqperm + currequest, handlers); + currequest = ''; + } + } + if((currequest) || (!reqvarlen)) + s.runScript(s.requestObj.uri, + reqperm + '&' + currequest, handlers); + if(onCompleteCB) onCompleteCB(); +} + +JSRVC.prototype.processPOSTRequest = function(onCompleteCB, handlers) { + var s = this; + var req = s.requestObj.request; + var reqvar = s.requestObj.variableRequest; + var reqvarlen = s.requestObj.variableRequest.length; + var createForm = function() { + var iframe = 'js-ifrm-' + Math.random(); + var ifr = JSKitLib.createHiddenIframe(iframe, s.requestObj.target); + var doc = ifr.contentDocument ? ifr.contentDocument : ifr.document; + var f = doc.createElement('FORM'); + f.doc = doc; + if(JSKitLib.isIE()) doc.charset = "utf-8"; + f.target = iframe; + JSKitLib.timedRetry({ + timeout: 100, + maxRetries: 50, + onSuccess: function() { + doc.body.appendChild(f); }, + pred: function() { return !!doc.body; } + }); + return f; + }; + var getForm = function() { + return (s.requestObj.form && !reqvarlen) ? + s.requestObj.form : createForm(); + } + var fillForm = function(form, obj) { + form.method = 'POST'; + form.enctype = "application/x-www-form-urlencoded"; + form.acceptCharset = 'UTF-8'; + form.action = s.requestObj.uri; + JSKitLib.fmap(obj, function(v, k) { + var frmel = (form.doc || document).createElement('INPUT'); + frmel.type = "hidden"; + frmel.name = k; + frmel.value = v; + form.appendChild(frmel); + }); + } + var postRequest = function(pobj, vobj) { + var form = getForm(); + fillForm(form, pobj); + if(vobj) fillForm(form, vobj); + if (form.target) s.setElementAttributes(document.getElementById(form.target), handlers); + JSKitLib.fmap(handlers, function(v, k) { + form[k] = v; + }); + s.requestsInProgress++; + JSKitLib.timedRetry({ + timeout: 100, + maxRetries: 50, + onSuccess: function() { + form.submit(); }, + pred: function() { + return (form.parentNode && + form.parentNode.nodeType!=11); } + }); + } + JSKitLib.fmap(reqvar, function(v) { + postRequest(req, v); + }); + if(!reqvarlen) postRequest(req); + if(onCompleteCB) onCompleteCB(); +} + +JSRVC.prototype.onLoadRequest = function(el) { + var s = this; + if(el.readyState && el.readyState != 'loaded' + && el.readyState != 'complete') return; + el.onreadystatechange = el.onload = null; + if(!s.requestObj.pickup) { + s.requestObj.checked = true; + s.requestsInProgress--; + } + s.postProcessRequest(); +} + +JSRVC.prototype.postProcessRequest = function(source, data) { + var s = this; + if(s.requestObj.pickup && source!="pickup") return; + if(s.requestObj.randevu && !s.error && s.requestObj.transport == "POST") { + s.processRequest({ + 'uri': '//js-kit.com/api/server-answer.js', + 'ref': s.requestObj.ref, + 'epb': s.requestObj.epb, + 'pickup': true, + 'onreturn': s.requestObj.onreturn, + 'target': s.requestObj.target}); + return; + } + s.returnAnswer(data); + if(!s.requestsInProgress) { + if(s.timeoutTimer) { + clearTimeout(s.timeoutTimer); + s.timeoutTimer = undefined; + } + if(s.requestsQueue.length && !s.error) + s.processRequest(s.requestsQueue.pop()); + } +} + +JSRVC.prototype.eventCallback = function(eventName, randevuId, status, data) { + if(this.requestId != randevuId) return; + this.requestsInProgress--; + if(this.script && this.script.parentNode) { + this.script.parentNode.removeChild(this.script); + this.script = undefined; + } + switch(status) { + case "ready": + if(this.eventCtx) { + JSKW$Events.invalidateContext(this.eventCtx); + this.eventCtx = undefined; + } + this.postProcessRequest("pickup", data); + break; + case "timeout": + if(this.error) { + this.returnAnswer(data); + } else { + this.processRequest(this.requestObj); + } + break; + case "exceeded": + this.error = "attempts_number_exceeded"; + this.returnAnswer(); + break; + } +} + +JSRVC.prototype.cancelRequest = function() { + this.error = 'canceled'; +} + + + + + +function JSKitModalDialog(content, config) { + this.config = config; + this.content = content; + this.backdrop = JSKitLib.html('
      '); + this.loadCSS(); + JSKitLib.hide(this.backdrop); + JSKitLib.addChild(document.body, this.backdrop, true); + JSKitLib.setOpacity(this.backdrop, 0.5); +} + +JSKitModalDialog.prototype.open = function() { + if (!this.container) { + var pos = JSKitLib.calcCenterPos(this.config.width, this.config.height); + this.container = JSKitLib.html('
      '); + JSKitLib.addStyle(this.container, + "width: " + this.config.width + "px;" + + "height: " + this.config.height + "px;" + + "left: " + pos[0] + "px;" + + "top: " + pos[1] + "px;"); + JSKitLib.addChild(this.container, this.content); + JSKitLib.addChild(document.body, this.container, true); + } + JSKitLib.show(this.backdrop); + JSKitLib.show(this.container); +} + +JSKitModalDialog.prototype.close = function() { + JSKitLib.hide(this.container); + JSKitLib.hide(this.backdrop); +} + +JSKitModalDialog.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-modal-dialog-container { position: absolute; z-index: 12000; background: #FFFFFF; }" + + ".js-kit-modal-dialog-backdrop { opacity: 0; background-color: #404040; z-Index: 11500; " + + (JSKitLib.isPreIE8() + ? "filter:progid:DXImageTransform.Microsoft.Alpha(opacity='0'); position: absolute; top: expression(eval(-(document.body.offsetTop + (document.body.offsetHeight - document.body.clientHeight)/2))); left: expression(eval(-(document.body.offsetLeft + (document.body.offsetWidth - document.body.clientWidth)/2))); height: expression(eval(Math.max(document.body.offsetHeight, document.documentElement.scrollHeight))); width: expression(eval(Math.max(document.body.offsetWidth, document.documentElement.scrollWidth)));" + : "position: fixed; left: 0; top: 0; height: 100%; width: 100%; -webkit-transition: opacity 0.5s ease-out;" ) + + "", "modalDialog"); +} + + + + + +function JSKitUniversalObject() {} + +JSKitUniversalObject.prototype.applyProperties = function(properties, sourceObject) { + var obj = sourceObject || this; + JSKitLib.fmap(properties || {}, function(value, name) { obj[name] = value; }); +} + +JSKitUniversalObject.prototype.applyConfig = function() { + var self = this; + var args = arguments; + this._config = JSKitLib.foldl({}, ["basic", "local", "global"], function(name, container, idx) { container[name] = args[idx] || {}; }); + return { + "set" : function(key, value) { self._config.local[key] = value; }, + "get" : function(key, defaultValue) { return self._config.local[key] || self._config.global[key] || defaultValue || self._config.basic[key] || ""; } + }; +} + +JSKitUniversalObject.prototype.assemble = function(template, layoutBlocksPrefix, descriptors) { + var content = JSKitLib.html(template); + var components = JSKitLib.mapClass2Object({}, content); + var structure = { + "get" : function(name, noPrefix) { return components[((noPrefix) ? "" : layoutBlocksPrefix + "-") + name]; }, + "content" : content + }; + JSKitLib.fmap(components, function(component, id) { + var pattern = id.match(layoutBlocksPrefix + "-(.*)"); + var descriptor = (pattern) ? pattern[1] : undefined; + if (descriptor && typeof(descriptors[descriptor]) == "function") { + var node = descriptors[descriptor](component); + if (node) component.appendChild(node); + } + }); + return structure; +} + +JSKitUniversalObject.prototype.data2DOM = function(data, target) { + var dom; + switch (typeof(data)) { + case "function" : dom = data(target); break; + case "string" : dom = JSKitLib.html("
      " + data + "
      "); break; + default : dom = data; + } + return dom; +} + +JSKitUniversalObject.prototype.processCallback = function(name, sourceObject) { + var obj = sourceObject || this; + if (obj.callbacks && obj.callbacks.hasOwnProperty(name)) obj.callbacks[name](); +} + +JSKitUniversalObject.prototype.append = function(element, content) { + JSKitLib.removeChildren(element); + element.appendChild(content); + return element; +} + +JSKitUniversalObject.prototype.mergeObjects = function(master, slave) { + return JSKitLib.foldl.call(this, master, slave, function(value, acc, name) { + if (typeof(value) == "object") { + if (!master[name]) master[name] = {}; + this.mergeObjects(master[name], slave[name]); + } else { if (!acc[name]) acc[name] = value; } + }); +} + + + + + +function JSKitUniversalContainer(content, options, callbacks, target) { + if (!target) target = document.createElement("DIV"); + if (!target.parentNode) JSKitLib.addChild(document.body, target, true); + this.config = this.applyConfig({ + "mode" : "popup", + "size" : {"width" : "550", "height" : "500"}, + "title" : "Untitled", + "opacity" : false, + "backdrop" : "yes", + "resizable" : "yes", + "cssPrefix" : "", + "sizeLimit" : {"width" : "550", "height" : "450"}, + "whiteLabel" : false, + "contentOverflow" : "auto" + }, options); + this.applyProperties({ + "target" : target, + "isOpen" : true, + "callbacks" : callbacks || {}, + "imagesPath" : "//cdn.js-kit.com/images/container/" + }); + this.loadCSS(); + this.render(content); +} + +JSKitUniversalContainer.prototype = new JSKitUniversalObject(); + +JSKitUniversalContainer.prototype.render = function(content, title, isRerendering) { + var self = this; + this.applyProperties({ + "title" : title || self.config.get("title"), + "content" : content || document.createElement("DIV") + }); + this.dom = this.assemble(this.template, "jskit-container", this.prepareDescriptors()); + this.append(this.target, this.dom.content); + JSKitLib.addClass(this.target, this.config.get("cssPrefix") + " js-kit-widgetsContainer js-kit-widgetsContainer-" + this.config.get("mode")); + var dimensions = this.config.get("size", { + "width" : self.dom.get("main").offsetWidth, + "height" : self.dom.get("main").offsetHeight + }); + if (!isRerendering) JSKitLib.addStyle(this.target, "width: " + parseInt(dimensions.width) + "px; height: " + parseInt(dimensions.height) + "px;"); + this.dom.get("content").style.overflow = this.config.get("contentOverflow"); + if (this.config.get("whiteLabel")) JSKitLib.hide(this.dom.get("poweredBy")); + + if (this.config.get("mode") == "popup") { + new JSDL(this.target, [this.dom.get("header"), this.dom.get("footer")]); + var opacity = this.config.get("opacity"); + if (opacity) { + this.target.jsk$on_start_drag = function(e) { JSKitLib.setOpacity(this, opacity); }; + this.target.jsk$on_stop_drag = function(e) { JSKitLib.setOpacity(this, "1"); }; + } + if (!isRerendering) { + var calcPos = JSKitLib.calcCenterPos(dimensions.width, dimensions.height); + var pos = this.config.get("position", {x: calcPos[0], y: calcPos[1]}); + JSKitLib.addStyle(this.target, "left: " + parseInt(pos.x) + "px; top: " + parseInt(pos.y) + "px;"); + } + + // make container resizable + if (this.config.get("resizable") == "yes") + this.makeResizableContainer(this.target, this.dom.get("resizeControl"), this.dom.get("content")); + + // display backdrop + if (this.config.get("backdrop") == "yes") { + if (!this.containerBackdrop) { + this.containerBackdrop = JSKitLib.html('
      '); + JSKitLib.addChild(document.body, this.containerBackdrop, true); + } + JSKitLib.show(this.containerBackdrop); + JSKitLib.setOpacity(this.containerBackdrop, 0.3); + } + } + this.processCallback("onContainerOpened"); +} + +JSKitUniversalContainer.prototype.updateTitle = function(title) { + this.append(this.dom.get("title"), this.data2DOM(title || this.config.get("title"))); +} + +JSKitUniversalContainer.prototype.makeResizableContainer = function(target, resizeCtrl, stretchBlock) { + var self = this; + var data; + var limit = this.config.get("sizeLimit"); + var opacity = this.config.get("opacity"); + var useStretchBlock = JSKitLib.isPreIE7() || (JSKitLib.isIE() && document.compatMode == "BackCompat"); + var getMousePos = function(e) { + var scroll = JSDL.prototype.getCurScroll(); + var mousePos = JSKitLib.getMousePosition(e); + return {"x" : mousePos.x + scroll.scroll_left, "y" : mousePos.y + scroll.scroll_top}; + }; + var onStartResize = function(e) { + data = {"pos" : getMousePos(e), "size" : {"width" : target.offsetWidth, "height" : target.offsetHeight}}; + JSKitLib.stopEventPropagation(e); + JSKitLib.preventDefaultEvent(e); + if (opacity) JSKitLib.setOpacity(target, opacity); + JSKitLib.addHandlers(document, onResize, onEndResize); + }; + var onResize = function(e) { + var mousePos = getMousePos(e); + target.style.width = Math.max(limit.width, data.size.width + mousePos.x - data.pos.x) + "px"; + target.style.height = Math.max(limit.height, data.size.height + mousePos.y - data.pos.y) + "px"; + if (useStretchBlock && stretchBlock) stretchBlock.style.width = target.style.width; + JSKitLib.preventDefaultEvent(e); + }; + var onEndResize = function(e) { + data = undefined; + if (JSKitLib.isOpera() || JSKitLib.isIE()) + target.style.width = (((useStretchBlock && stretchBlock) ? stretchBlock : target).offsetWidth - 1) + "px"; + if (opacity) JSKitLib.setOpacity(target, "1"); + JSKitLib.removeHandlers(document, onResize, onEndResize); + }; + JSKitLib.addEventHandler(resizeCtrl, ["mousedown"], onStartResize); +} + +JSKitUniversalContainer.prototype.close = function() { + this.processCallback("onContainerBeforeClose"); + this.target.parentNode.removeChild(this.target); + // Remove backdrop + if (this.containerBackdrop) { + JSKitLib.setOpacity(this.containerBackdrop, 0); + JSKitLib.hide(this.containerBackdrop); + } + this.isOpen = false; + this.processCallback("onContainerClosed"); +} + +JSKitUniversalContainer.prototype.getElement = function(name) { return this.dom ? this.dom.get(name) : false; } + +JSKitUniversalContainer.prototype.prepareDescriptors = function() { + var self = this; + return { + "title" : function() { return self.data2DOM(self.title || self.config.get("title")); }, + "content" : function() { return self.content; }, + "closeButton" : function(element) { self.assembleCloseButton(element); }, + "resizeControl" : function(element) { self.assembleResizeControl(element); }, + "closeButtonImg" : function(element) { if (self.config.get("mode") != "embedded") JSKitLib.addPNG(element, self.imagesPath + "closeWindow.png"); } + }; +} + +JSKitUniversalContainer.prototype.assembleCloseButton = function(element) { + var self = this; + if (this.config.get("mode") != "embedded") { + JSKitLib.notDraggable(element); + element.onclick = function(e) { + self.close(); + JSKitLib.stopEventPropagation(e); + } + } else JSKitLib.hide(element); +} + +JSKitUniversalContainer.prototype.assembleResizeControl = function(element) { + if (this.config.get("mode") != "embedded" && this.config.get("resizable") == "yes") { + JSKitLib.addPNG(element, this.imagesPath + "resizeHandle.png"); + return; + } + JSKitLib.hide(element); +} + +JSKitUniversalContainer.prototype.template = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
         
      ' + + '
      '; + +JSKitUniversalContainer.prototype.loadCSS = function() { + var oldStyleIE = JSKitLib.isPreIE8() || (JSKitLib.isIE() && !JSKitLib.isPreIE8() && document.compatMode == "BackCompat"); + JSKitLib.addCss( + ".js-kit-containerBackdrop { opacity: 0; background-color: #404040; z-Index: 13800; width: 100%; " + (oldStyleIE ? "filter:progid:DXImageTransform.Microsoft.Alpha(opacity='0'); position: absolute; top: expression(eval(document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + 'px'); right: 0; bottom: 0; height: expression(eval(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)); width: expression(eval(document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth));" : "position: fixed; left: 0; top: 0; height: 100%; -webkit-transition: opacity 0.5s ease-out;" ) + "}" + + ".js-kit-widgetsContainer { " + (oldStyleIE ? "width: " + parseInt(this.config.get("size").width) + "px; height:" + parseInt(this.config.get("size").height) + "px;" : "") + " cursor: default; text-align: left; line-height: normal; color: #000000; font-weight: normal; }" + + "div.js-kit-widgetsContainer a, div.js-kit-widgetsContainer a:visited { background-color: transparent; font-weight: normal; }" + + ".js-kit-widgetsContainer-embedded {}" + + ".js-kit-widgetsContainer-popup { position: absolute; -webkit-box-shadow: 0px 10px 50px #222; " + (JSKitLib.isGChrome() ? "" : "-webkit-border-radius: 7px;") + " z-Index: 14000; }" + + ".jskit-container-main { position: relative; font-family: Helvetica, sans-serif; background: #dfebf2; padding: 0px; " + (JSKitLib.isGChrome() ? "" : "-moz-border-radius: 7px; -webkit-border-radius: 7px;") + " border: 1px solid #C4CFD5; height: 100%; }" + + ".jskit-container-wrapper { " + (oldStyleIE ? "position: relative; border: 0px; height: 100%;" : "position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; border: 5px solid #DFEBF2;") + " -moz-border-radius: 7px; -webkit-border-radius: 7px; }" + + ".jskit-container-header { height: 27px; " + (oldStyleIE ? "margin-top: 5px;" : "") + "}" + + ".jskit-container-title { float: left; font-size: 18px; font-weight: bold; margin: 0px 0px 2px 5px; color: #424242; width: 90%; overflow: hidden; height: 23px; }" + + ".jskit-container-closeButton { width: 18px; height: 18px; float: right; margin: 1px " + (JSKitLib.isIE() ? (JSKitLib.isPreIE7() ? "0" : "5") : "1") + "px 0px; color: #95a0a9; cursor: pointer; }" + + ".jskit-container-closeButtonImg { width: 10px; height: 10px; margin: 4px; }" + + ".jskit-container-content { " + (oldStyleIE ? "zoom: 1; position: relative; height: expression(eval(this.parentNode.offsetHeight - 63) + 'px'); width: expression(eval(this.parentNode.offsetWidth - 10) + 'px'); margin: 0px 5px;" : "position: absolute; top: 0px; bottom: 0px; margin : 32px 0px 25px 0px; width: 100%; -moz-border-radius: 5px;") + " padding: 0px; background: #FFFFFF; }" + + ".jskit-container-footer { " + (oldStyleIE ? "margin-right: 5px;" : "position: absolute; bottom: 0px; right: 0px;") + " width: 100%; }" + + ".jskit-container-footerArea { float: left; }" + + ".jskit-container-poweredBy { float: right; border: 0px; cursor: pointer; font-size: 10px; color: #808080; margin: 6px " + (JSKitLib.isPreIE7() ? "5" : "20") + "px 5px 0px; }" + + "div.jskit-container-poweredBy a, div.jskit-container-poweredBy a:hover { font-size: 10px; color: #808080; text-decoration: none; background-color: transparent; }" + + ".jskit-container-resizeControl { position: absolute; " + (JSKitLib.isPreIE7() ? "top: expression(eval(this.parentNode.offsetHeight - 14) + 'px');" : "bottom: 0px;" ) + " right: 0px; width: 12px; height: 12px; cursor: se-resize; font-size: 10px; }" + + ".js-SettingsWindow { z-index: 16000 !important; }" + + ".js-kit-clear { clear: both; }", "universalContainer"); +} + + + + + +function jskEchoInit(ref, target) { + return (window.JSK$Echo || (window.JSK$Echo = new JSKEcho(ref, target))); +} + +function JSKEcho(ref, target) { + var s = this; + s.ref = ref; + s.target = target; + s.existingRenderers = []; + s.subscribers = []; + s.subscribeRequest = []; + s.uriDomain = '//js-kit.com'; +} + +JSKEcho.prototype.getRendererById = function(rendererId) { + var rs = this.existingRenderers; + var rsl = rs.length; + for(var i=0; i0) ? itemsArr[0] : undefined; +} + +JSKEchoPGC.prototype.getItemIdxById = function (itemId) { + var itemIdx; + for(var i=0; i=0 && Cnt) ? this.items.slice(sIdx, sIdx+Cnt) : []; +} + +JSKEchoPGC.prototype.deleteItem = function (itemId) { + var itemIdx = this.getItemIdxById(itemId); + if(typeof itemIdx == 'undefined') return 0; + + var r = 0; + var self = this; + var item = this.items[itemIdx]; + if(item.obj && item.obj.thread) { + JSKitLib.fmap(item.obj.thread, + function(c) { + r += self.deleteItem(c.ID); + }); + } + if(item.obj && item.obj.status!='D' && item.obj.status!='DT') r++; + if(itemIdx <= this.displayItemIdx) { + this.displayItemIdx--; + var div = item.div; + if(div && div.parentNode) div.parentNode.removeChild(div); + } + this.items.splice(itemIdx, 1); + this.itemsCount--; + return r; +} + +JSKEchoPGC.prototype.getPageByItemId = function(itemId) { + var itemIdx = this.getItemIdxById(itemId); + return (itemIdx <= this.displayItemIdx) || + (!itemIdx && this.displayItemIdx == -1) ? 0 : 1; +} + +JSKEchoPGC.prototype.invalidateItemView = function (itemId) { + var itemIdx = this.getItemIdxById(itemId); + if(itemIdx <= this.displayItemIdx) { + delete this.items[itemIdx].html; + this.invalidVisualization = true; + } +} + +JSKEchoPGC.prototype.invalidatePagesView = function (pageIdx, Cnt) { + if(!pageIdx) this.invalidVisualization = true; +} + +JSKEchoPGC.prototype.getFirstItem = function () { + if(this.itemsCount) { + var itemsArr = this.getItems(0, 1); + return (itemsArr.length>0) ? itemsArr[0] : undefined; + } else { + return undefined; + } +} + +JSKEchoPGC.prototype.getPageItemsCnt = function(pageIdx) { + return pageIdx ? undefined : this.displayItemIdx + 1; +} + +JSKEchoPGC.prototype.invalidate = function () { + this.invalidData = true; + this.invalidVisualization = true; + this.items = []; + this.itemsCount = 0; + this.displayItemIdx = -1; +} + +JSKEchoPGC.prototype.getItemsToDisplay = function () { + return this.getItems(0, this.displayItemIdx + 1); +} + +JSKEchoPGC.prototype.getPageVisualization = function (pageIdx, cb) { + var self = this; + var getPageFunc = function(){ self.getPageVisualization(pageIdx, cb); }; + var getMore = (this.itemsPerPage + this.displayItemIdx) >= this.itemsCount && pageIdx && this.echo_after ? true : false; + if(this.invalidData || getMore) { + this.invalidVisualization = true; + return this.dataRequest(0, getMore, this.echo_after, cb); + } + if(this.invalidVisualization || pageIdx) { + this.displayItemIdx = this.itemsCount-1; + this.invalidVisualization = false; + return this.dataVisualizator(this.getItemsToDisplay(), getPageFunc); + } + return cb(this.target, true); +} + +JSKEchoPGC.prototype.getPlaceIdxByTS = function(TS) { + var items = this.getItems(0, this.itemsCount); + for(var i=0; i=items[i].obj.TS) return items[i].obj.ID; + } + return 0; +} + +JSKEchoPGC.prototype.newItem = function(item) { + var newItem = { obj: undefined, html: undefined, div: undefined }; + if(item) JSKitLib.fmap(item, function(V,K){ newItem[K] = V; }); + return newItem; +}; + +JSKEchoPGC.prototype.addNewItem = function (obj, itemId, isPrepend) { + var item = this.newItem({'obj': obj}); + var itemIdx = itemId ? this.getItemIdxById(itemId) + (isPrepend ? 0 : 1) : this.itemsCount; + this.items.splice(itemIdx, 0, item); + this.itemsCount++; + if(itemIdx<=this.displayItemIdx || + (!obj.paginated && itemIdx==this.displayItemIdx+1) || + (!itemIdx && this.displayItemIdx == -1)) { + this.displayItemIdx++; + this.invalidVisualization = true; + } +} + +JSKEchoPGC.prototype.newData = function (newData, echo_after) { + var s = this; + s.$old_echo_after = s.echo_after; + s.echo_after = echo_after; + JSKitLib.fmap(newData, function(o) { + var itemIdx = s.getItemIdxById(o.ID); + if(typeof itemIdx != 'undefined') { + JSKitLib.fmap(s.items[itemIdx].obj, function(v, k){ + s.items[itemIdx].obj[k] = o[k]; }); + if(itemIdx<=s.displayItemIdx) { + delete s.items[itemIdx].html; + s.invalidVisualization = true; + } + } else { + s.items[s.itemsCount++] = s.newItem({'obj': o}); + } + }); + this.displayItemIdx = this.itemsCount - 1; + this.invalidData = false; + this.loading = false; +} + + + + + +if(!window.JSFSearch) JSFSearch = { threshold: 0.9 }; + +JSFSearch.get_hash_list = function(s) { + return s.split(/[ \t]+/); +} + +JSFSearch.normalize = function(s) { + return s.toLowerCase().replace(/<\/wbr>/g, '').replace(/<[^<]*>/g,' '); +} + +JSFSearch.make_hash = function(s) { + var hash_list = JSFSearch.get_hash_list(JSFSearch.normalize(s)); + var hash_length = JSKitLib.foldl(0, hash_list, + function(v, acc){ return acc + v.length }); + return {'hash_length': hash_length, 'hash_list': hash_list.sort()}; +} + +JSFSearch.get_hash_info = function(obj) { + if(!obj.$hash_info) + obj.$hash_info = JSFSearch.make_hash(obj.Text); + return obj.$hash_info; +} + +JSFSearch.compare_hash_lists$ = function(hash1, hash2, cnt1, cnt2, matched_count, mismatched1, mismatched2) { + var hl1 = hash1.length; + var hl2 = hash2.length; + if(cnt1 >= hl1 && cnt2 >= hl2) + return {'matched_count': matched_count, + 'mismatched1': mismatched1, 'mismatched2': mismatched2}; + if(cnt1 >= hl1) { + mismatched2.push(hash2[cnt2]); + cnt2++; + } else + if(cnt2 >= hl2) { + mismatched1.push(hash1[cnt1]); + cnt1++; + } else + if(hash1[cnt1] == hash2[cnt2]) { + matched_count += hash1[cnt1].length; + cnt1++; + cnt2++; + } else + if(hash1[cnt1] <= hash2[cnt2]) { + mismatched1.push(hash1[cnt1]); + cnt1++; + } else { + mismatched2.push(hash2[cnt2]); + cnt2++; + } + return JSFSearch.compare_hash_lists$(hash1, hash2, cnt1, cnt2, + matched_count, mismatched1, mismatched2); + +} + +JSFSearch.compare_hash_lists = function(hash1, hash2) { + return JSFSearch.compare_hash_lists$(hash1, hash2, 0, 0, 0, [], []); +} + +JSFSearch.get_avg = function(hash) { + var flat_list = hash.join(''); + var sum = 0; + var len = flat_list.length; + for(var i=0; i 0) { + l--; + if(l>=l1) calc_summs(0, avg2.list.charCodeAt(l)) + else if(l>=l2) calc_summs(avg1.list.charCodeAt(l), 0) + else calc_summs(avg1.list.charCodeAt(l),avg2.list.charCodeAt(l)); + } + return {'sum1': sum1, 'sum2': sum2, 'sum3': sum3}; +} + +JSFSearch.calc_distance = function(hash1, hash2) { + var avg_info1 = JSFSearch.get_avg(hash1); + var avg_info2 = JSFSearch.get_avg(hash2); + var sums = JSFSearch.corr_coeff(avg_info1, avg_info2); + return ((sums.sum2 < 0.1 || sums.sum3 < 0.1) ? 0 : + sums.sum1/Math.sqrt(sums.sum2)/Math.sqrt(sums.sum3)); +} + +JSFSearch.compare_hashes = function(hash1, hash2) { + var hl1 = hash1.hash_length; + var hl2 = hash2.hash_length; + if(hl1 == 0 && hl2 == 0) return 1; + var compare_info = JSFSearch.compare_hash_lists(hash1.hash_list, + hash2.hash_list); + var total_len = (hl1 + hl2) / 2; + var matched_pcnt = compare_info.matched_count / total_len; + if(total_len - compare_info.matched_count < 0.1) return 1; + if(compare_info.matched_count < total_len/2) return 0; + if(matched_pcnt > JSFSearch.threshold) return 0.99; + if(matched_pcnt > 0.75 && compare_info.matched_count > hl1 * 0.9) + return 0.99; + if(matched_pcnt > 0.75 && compare_info.matched_count > hl2 * 0.9) + return 0.99; + return (matched_pcnt + + Math.abs(JSFSearch.calc_distance( + compare_info.mismatched1, compare_info.mismatched2)) * + (total_len - compare_info.matched_count) / total_len); +} + +JSFSearch.compare_obj = function(obj1, obj2) { + return (JSFSearch.compare_hashes(JSFSearch.get_hash_info(obj1), + JSFSearch.get_hash_info(obj2)) > JSFSearch.threshold); +} + +JSFSearch.search = function(items, obj) { + if(!obj.event_publisher || obj.ParentID || obj.depth || !obj.Text) + return obj.ParentID; + for (var i=0; i=0; i--) { + var fName = jovs[i][0]; + var func = jovs[i][1]; + this[fName] = func; + } + } + } else { + if(!document.body){ + alert($JCL("savingScriptMessage")); + return; + } + JSKitLib.preloadImg('//cdn.js-kit.com/images/loading-yellow.gif'); + + var request = { + base_uri: JSCC.URI + 's-data.js', + trailer: 'jx', + extra_params: this.comment_location ? {'jsid': this.comment_location} : {} + }; + JSKitLib.initWidgets('comments', request, function(div) { + var obj = new JSCC(div, {'config': {'noDataRequest': true}}); + var params = groupSingleRequestParams(obj); + obj.singleRequestParams = params; + return obj; + }); + + JSKitLib.fmap([ + 'comment-deleting', + 'comment-deleted', + 'comment-added', + 'comments-data-loaded', + 'comments-count-updated' + ], function(e) { + JSKitAPI.subscribe(e, function(eventName, eventParams) { + $JCA[eventParams.jcaIndex].eventsHandler(eventName, eventParams); + }); + }); + JSKitLib.fmap({ + 'JSKitAuth_logout': 'user-logout', + 'JSKitAuth_success_login': 'user-login' + }, function(v, k) { + JSKW$Events.registerEventCallback(undefined, function() { + JSKitAPI.publish(v, {"nofocus": false}); + }, k); + }); + + return; + } + target.jsk$initialized = true; + target.className = idName; + target.id = ""; + + // Handling user configuration settings + this.config = JSKitLib.readConfig("comments", + target, + this.config, + 'path', + 'display-mode', + ['standalone', 'no'], + ['scoring', 'yes'], + 'paginate', + 'backwards', + ['disabled', 'no'], + 'domain', + ['sort', ['date','karma','name','status','rating']], + ['thread', ['yes','no']], + 'adminBgColor', + 'flashColor', + 'moderate', + 'permalink', + 'skin', + 'noautoexpand', + 'label', + ['smiles', 'no'], + ['editable', 'no'], + ['thread-title', $JCL("defaultThreadTitle")], + 'popup-title', + 'popup-width', + 'popup-height', + 'include-sources', + 'exclude-sources', + ['page-title', document.title] + ); + if (!this.config.backwards) { + if (this.config.paginate) + this.config.backwards = 'yes'; + else + this.config.backwards = this.config.nolc && !this.IM ? 'yes' : 'no'; + } + this.uniq = this.config.path; + this.pathOverride = this.config.path; + this.sourceFilter = initSourceFilter(this.config); + this.config.thread = this.config.nolc && !this.IM ? 'no' : this.config.thread; + this.config.domain = this.config.moderate || this.config.domain; + this.config.noautoexpand = this.config.noautoexpand == 'yes'; + + self.target = target; + + this.server = function(ext, data, ajax, rvcparams) { + if((self.serverFilter && !self.serverFilter(ext)) || self.config.disabled == 'yes') return; + + // ensure window.location is current (re:blogspot) + var wl = window.location; + var prms = data; + JSKitLib.fmap(((extra||{})['sargs']||{}), + function(v, k){ prms[k] = v; }); + var getAction = function(scr) { + return scr.match(self.uriDomain) ? wl.protocol + scr : wl.protocol + self.uri + scr; + }; + var action = getAction(ext); + var so = this.serverOptions; + prms = JSKitLib.appendExternalParams("comments", ext, prms); + prms.p = this.pathOverride; + prms.nonce = so && so.nonce || ""; + prms['page-title'] = self.config['page-title']; + var req = { + uri: action, + ref: JSKitLib.getRef(self), + epb: JSKitEPB.getAsHash({}), + request: prms, + target: self.target, + randevu: !!ajax + }; + if (rvcparams) JSKitLib.fmap(rvcparams, function(v, k) { req[k] = v; }); + new JSRVC(req); + } + + this.getpages = function(sp, ap) { + self.loading = (new Date()).valueOf(); + var prms = {}; + JSKitLib.fmap(groupSingleRequestParams(self, {sp: sp}), function(v, k) {prms[k + "[0]"] = v;}); + if(ap) JSKitLib.fmap(ap, function(v,k){ prms[k] = v ;}); + self.server("s-data.js", prms); + } + + JSKitLib.fmap(['user-login', 'user-logout'], function(e) { + JSKitAPI.subscribe(e, function(eventName, eventParams) { + self.eventsHandler(eventName, eventParams); + }); + }); + + if (!this.config.noDataRequest) this.getpages(); +} + +JSKitLib.addCss('' ++ '.js-WelcomePanel { margin: 0px 0px 10px 0px; font: 12px Arial; text-align: left; }' ++ '.js-WelcomePanelBottom { margin: 10px 0px 0px 0px; }' ++ '.js-WelcomePanelTitle { padding-left: 7px; border-bottom: 1px solid #d1bea4; background: #e4d0b3; color: #fff; font: 14px Arial; font-weight: bold; line-height: 21px; }' ++ '.js-WelcomePanelClose { height: 21px; width: 20px; float: right; cursor: pointer; position: relative; top: 7px; ' + (JSKitLib.isIE() ? 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="//cdn.js-kit.com/images/welcome/close.png", sizingMethod="crop")' : 'background: no-repeat url(//cdn.js-kit.com/images/welcome/close.png);') + ' }' ++ '.js-WelcomePanelContent { padding: 18px 20px; background-color: #fffae4; color: #2e2e30; line-height: 21px; ' + (JSKitLib.isIE() ? 'zoom: 1' : '') + ' }' ++ '.js-WelcomePanelContentBlock a, .js-WelcomePanelContentBlock a:link, .js-WelcomePanelContentBlock a:visited, .js-WelcomePanelContentBlock a:hover, .js-WelcomePanelContentBlock a:active { text-decoration: none; color: #2e2e30; font: 12px Arial; white-space: nowrap; }' ++ '.js-WelcomePanelContentBlock a:hover, .js-WelcomePanelContentBlock a:active { text-decoration: underline; }' ++ '.js-WelcomePanelHeader { font: 16px Arial; font-weight: bold; color: #2e2e30; padding: 0px; line-height: 20px; ' + (JSKitLib.isIE() ? 'zoom: 1' : '') + ' }' ++ '.js-WelcomePanelContentBlock { float: left; padding-bottom: 5px; ' + (JSKitLib.isIE() ? 'zoom: 1' : '') + '}' ++ '.js-WelcomePanelContentBlock table img { vertical-align: middle; }' ++ '.js-WelcomePanelCtls { float: left; text-align: center; margin-top: 9px; line-height: 15px; }' ++ '.js-WelcomePanelCtls a, .js-WelcomePanelCtls a:active, .js-WelcomePanelCtls a:visited, .js-WelcomePanelCtls a:hover { color: #2e2e30; font: 11px Arial; }' ++ '.js-WelcomePanelArrow { height: 12px; }' ++ JSKitLib.fmap({Info: 'information', Reg: 'pencil', Profile: 'edit_profile', Help: 'help', Custom: 'bullet_wrench', Dashboard: 'dashboard', Twitter: 'twitter', Support: 'support', Widgets: 'widgets', Panel: 'admin_panel' }, function(v, k) { + var paddingTop = (k == 'Info' || k == 'Reg' ? 4 : 1); + var paddingLeft = (k == 'Info' || k == 'Reg' ? 23 : 25) - (JSKitLib.isIE() ? 2 : 0); + return '.js-WelcomeImg' + k + ' { height: 16px; line-height: 16px; padding: ' + paddingTop + 'px 0px 0px ' + paddingLeft + 'px; float: left; ' + (JSKitLib.isIE() ? 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="//cdn.js-kit.com/images/welcome/' + v + '.png", sizingMethod="crop");' : 'background: url(//cdn.js-kit.com/images/welcome/' + v + '.png) no-repeat left center;') + ' }'; +}).join('') +, 'welcome'); + +JSKitLib.addCss("" ++ ".js-CommentsSkin-smoothgray .js-commentInputName { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-commentInputEmail { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-commentInputUrl { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-AuthAreaWrap { margin-right: 110px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" ++ ".js-CommentsSkin-smoothgray .js-CCButtons { margin: 0.3em 0 0.5em 5px; width: 100%;" + (JSKitLib.isIE() ? "zoom: 1; " : "") + "}" ++ ".js-authSelector { float: left; margin-bottom: 5px; }" ++ ".js-logoutSpan { display:none; margin-left: 5px;" + (JSKitLib.isIE() ? "zoom: 1; " : "margin-top: 3px; ") + "}", "AuthAreaWrap"); + +// Optionally leave all CSS up to template +if (!window.$JSKitNoCommentCss) { + JSKitLib.addCss('' + + ".js-OldComments { margin-bottom: 1px; clear:both;}" + + ".js-LeaveComment { margin: 5px 0 0 5px; }" + + ".js-CreateComment, .js-EditComment { text-align: left; display: none; }" + + ".js-commentInputUrl { display: none; }" + + ".js-CCMore { padding-left: 3px }" + + ".js-commentOptions { float: left; }" + + ".js-commentPubOptions { float: left; padding: 2px 5px; }" + + ".js-commentShareCheckbox { float: left; margin: " + (JSKitLib.isIE() ? "-3px" : "1px") + " 0 0 5px; }" + + ".js-commentShareLabel { margin: 1px 3px 0 3px; line-height: 13px; float: left; }" + + ".js-commentYahooShareLabelLogo {margin: 1px 0 0 0; float: left; width: 49px; height: 13px; " + (JSKitLib.isIE() ? 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="//cdn.js-kit.com/images/yahoo/yoslogo.png", sizingMethod="crop");' : 'background: no-repeat url(//cdn.js-kit.com/images/yahoo/yoslogo.png);') + " }" + + ".js-commentSubmit { text-align: right; }" + + ".js-CreateCommentBg { margin: 1em; padding: 0.5em; border: solid 1px #c0c0c0; text-align: left; float: left; }" + + ".js-EditComment .js-CreateCommentBg { float: none; border: none; padding: 0; }" + + ".js-CreateCommentArea { -moz-border-radius: 7px; -webkit-border-radius: 7px; padding: 5px 5px 5px 9px; }" + + ".js-CommentsArea .js-CreateCommentArea { background-color: #cbcbcb; }" + + ".js-OldComments { background-color: transparent; }" + + ".js-CreateCommentFieldsWrap { margin-left: -4px; background-color: #ececec; border: solid 1px #b0b0b0; padding: 4px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }" + + '.js-CreateCommentFields {zoom: 1; color: #404040; background-color: #e8e8e8; padding: 4px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }' + + ".js-PageNavTop { margin-bottom: 3px; }" + + ".js-PageNavBottom { margin-top: 3px; clear: both; }" + + ".js-PageNOther { text-decoration: none; }" + + ".js-PageNCur { font-weight: bold; }" + + ".js-PageArrowCur { opacity: 0.3; zoom:1; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); }" + + ".js-commentFieldSubject { font-weight: bold; margin-bottom: 5px;}" + + ".js-commentFieldLabel { margin-top: 5px; clear:both; margin-right: 0.5em;}" + + ".js-pmFieldLabel { margin-top: 5px; clear:both; margin-right: 0.5em; text-align: left;}" + + ".js-commentFieldNote { font-family: Verdana; font-size: 7pt; color: #808080; }" + + ".js-siteAdmin { font-weight: bold; }" + + ".js-singleComment { zoom: 1; font-size: 8pt; font-family: Verdana, Helvetica; border: solid 1px #c0c0c0; text-align: left; margin-bottom: -1px; }" + + ".js-singleCommentBg { zoom: 1; padding: 0.3em; }" + + ".js-singleCommentCheckbox { float: left; margin: " + (JSKitLib.isIE()?"0":"2") + "px 2px 0px 0px; width: 16px; height: 16px; cursor: pointer; }" + + '.js-singleCommentHeader { color: #484848; margin: 3px 0; }' + + '.js-singleCommentBody { clear: both; color: #404040; background-color: #fefefe; padding: 4px 4px 4px 8px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }' + + 'table.js-singleCommentBodyT { margin: 0; padding: 0; font-family: Verdana, Helvetica; text-align: left; font-size: 8pt; color: #404040; }' + + '.js-singleCommentQuote { position:relative; top: 4px; font-family: "Times New Roman"; font-size: 32px; line-height: 24px; padding-right: 1px; display: none; }' + + ".js-singleCommentINFO { color: #808080; float: right; padding: 3px; margin-left: 2em; text-align: right;}" + + ".js-singleCommentAvatar { float: right; }" + + ".js-singleCommentAvatarCell { text-align: right; }" + + ".js-singleCommentText { padding-top: " + (JSKitLib.isIE()?"0":"4") + "px; }" + + ".js-singleCommentName { font-weight: bold; text-decoration: underline; }" + + ".js-singleCommentUrl { margin: 0px 0px 0px 2px; padding: 0px; border: 0px; width: 10px; height: 10px; display: none; vertical-align: top; }" + + ".js-singleCommentDate { font-size: 7pt; }" + + ".js-singleCommentOrigin { display: inline; bottom: 0.3em; font-size: 7pt; color: #808080; }" + + ".js-singleCommentKarmaComMod { clear: both; }" + + ".js-singleCommentKarma { float: left; font-size: 7pt; color: #808080; margin-right: 1em; padding-top: 3px; }" + + ".js-singleCommentKarmaShow { float: left; font-size: 7pt; color: #808080; margin-right: 2em; padding-top: 3px; display: none; }" + + ".js-singleCommentKarmaScore { display: none; }" + + ".js-singleCommentComMod { float: left; font-size: 7pt; color: #808080; display: inline; padding-top: 3px; margin-right: 1em; }" + + ".js-singleCommentCtls { float: right; white-space: nowrap; }" + + ".js-singleCommentMenu { float: left; margin: -4px 15px 0px 0px; " + (JSKitLib.isIE() ? "zoom: 1; " : "") + " white-space: nowrap; }" + + ".js-singleCommentControl, .js-singleCommentKarmaY, .js-singleCommentKarmaN { cursor: pointer; }" + + ".jskit-MenuTitle { cursor:pointer; padding: 3px; white-space: nowrap; color: #476cb8; font-size: 11px; width: 100%; }" + + ".jskit-MenuTitleMO { }" + + ".jskit-MenuTitlePressed { }" + + ".jskit-MenuTitleExpandMarker { width: 16px; height: 16px; margin: 1px 0px 0px -2px; }" + + ".jskit-MenuContainer { border: 1px solid #D6E2E9; background-color: #FFFFFF; cursor:pointer; position: absolute; margin-left: -2px; -moz-border-radius: 4px; -webkit-border-radius: 4px; z-index: 20000;}" + + ".jsk-MenuAdmin td, .js-kit-miniProfile-addAnotherSite td, .jskit-MenuContainer td, .js-singleCommentMenu td, .jsk-HeaderPauseBox td { padding: 0px !important; vertical-align: middle !important; border-collapse: separate !important; border: 0px solid !important;}" + + ".jsk-MenuAdmin table, .js-kit-miniProfile-addAnotherSite table, .jskit-MenuContainer table, .js-singleCommentMenu table, .jsk-HeaderPauseBox table { margin: 0px !important; border-collapse: separate !important; border: 0px solid !important; width: auto !important; }" + + ".jskit-MenuRootContainer { margin: 2px 0px 0px -3px; }" + + ".jskit-MenuRootHTML { float: left; height: 2em; }" + + ".jskit-MenuItem { border: 1px 0px solid #FFFFFF; line-height: 14px; }" + + ".jskit-MenuItemIcon { width: 16px; height: 16px; margin: 4px 6px;" + (JSKitLib.isIE() ? " zoom: 1;" : " float: left;" ) + " }" + + ".jskit-MenuItemCheckboxCnt, .jskit-MenuItemRadioCnt { height: 24px; width: 65px; float: left; white-space: nowrap; margin: 0px; line-height: 14px;" + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" + + ".jskit-MenuItemTitle { margin: 5px 20px 4px 0px; color: #000000; font: 12px Arial; text-decoration: none; white-space: nowrap; zoom: 1;}" + + ".jskit-MenuItemEnding { height: 16px; margin: 2px; font-size: 14px; color: #000000; display: inline; font-family: Arial; }" + + "div.jskit-AvatarMenuItemEnding { display: block; margin: 1px 3px; }" + + ".jskit-MenuItemMO { background-color: #EDEDED; }" + + ".jskit-MenuItemMO .jskit-MenuDeleteButton { visibility: visible; }" + + ".jskit-MenuDelimeter { margin: 2px 0px; height: 1px; width: 100%; background-color: #CCCCCC; font-size: 1px; width: 100%; }" + + ".jskit-MenuItemInput { line-height: 16px; font: 12px Arial; padding: 0px; border: 1px solid #AAAAAA; height: 16px; margin: " + (JSKitLib.isIE() ? "3px" : "3px") + " 0px; width: 120px; position: absolute; }" + + ".jskit-MenuItemCheckbox, .jskit-MenuItemRadio { margin: 4px 4px 4px 10px; padding: 0px 8px; line-height: 16px; height: 16px; float: left; }" + + ".jskit-MenuDeleteButton { width: 16px; height: 16px; margin: 7px 0px 0px 2px; display: block; visibility: hidden; }" + + 'div.js-singleCommentEdit, div.js-singleCommentReply, div.js-singleCommentDelete, div.js-singleCommentModerate { background: right top url(//cdn.js-kit.com/images/button-clear.png) no-repeat; height: 16px; font-size: 8pt; line-height: 9px; color: #404040; cursor: pointer; float: left; margin: 0 0.5em 0 4px; }' + + 'div.js-singleCommentEdit div, div.js-singleCommentReply div, div.js-singleCommentDelete div, div.js-singleCommentModerate div { background: left top url(//cdn.js-kit.com/images/button-clear.png) no-repeat; height: 16px; padding: 2px 4px 0px 5px; position: relative; left: -1px; float: left; }' + + ".js-kit-lcf-miniProfile { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-singleCmtProfileEnabled .js-kit-miniProfile-avatar, .js-kit-singleCmtProfileEnabled .js-kit-miniProfile-stats, .js-kit-singleCmtProfileEnabled .js-kit-miniProfile-viewDetails, .js-kit-singleCmtProfileEnabled .js-kit-miniProfile-name { cursor: pointer; }" + + ".js-kit-lcj-miniProfile-name-ipe { cursor: text; }" + + ".js-kit-singleCmtProfileDisabled .js-kit-miniProfile-viewDetails { display: none; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfileNameWrap { padding-bottom: 5px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-name, .js-kit-lcf-miniProfile .js-kit-miniProfile-siteLinksIcons { float: left; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfileSitesWrap { border-top: 2px dotted #E4E4E4; padding-top: 5px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-addAnotherSite { float: left; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "margin: 1px 0px 0px 0px; cursor: pointer; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-addAnotherSite span.text { color: #0066CC; margin-right: 5px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-siteLinksIcons { border: 0px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-name-ipe { margin-right: 70px; height: 24px; line-height: 20px; font-size: 16px; border: 0px; outline: 0px;}" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-logout { " + (JSKitEPB.isExists() ? "display: none" : "float: right; margin: 1px 0px 0px -70px; cursor: pointer; color: #0066CC; font-size: 10px;") + "}" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-logoutIcon { float: left; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " margin: 2px 0px 0px 5px; padding: 0px 5px; font-size: 8px; width: 10px; height: 10px; }" + + ".js-kit-lcf-miniProfile .js-kit-miniProfile-logoutLink { float: left; " + (JSKitLib.isIE() ? "zoom: 1; padding-bottom: 2px;" : "") + " }" + + ".js-kit-lcf-extraControlsMenuWrapper { float: left; }" + + ".js-kit-relative { position: relative; }" + + ".js-CreateComment .js-kit-tabs-singleTab { display: block; }" + + ".js-CreateComment .js-kit-tab { padding: 5px 0px 5px 0px; margin-right: 20px; background: transparent; cursor: pointer; }" + + ".js-CreateComment .js-kit-tab-title { color: #0066CC; }" + + ".js-CreateComment .js-kit-tab .js-kit-tab-expandMarker { float: left; width: 16px; height: 16px; }" + + ".js-kit-lcf-extraControlsMenuContent { border: 1px solid #BBBBBB; background: #FFFFFF; margin-top: 10px; color: #3a3a3a;}" + + ".js-kit-images-wrapper, .js-kit-follow-wrapper { padding: 10px; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-images-form { margin: 20px 0px; }" + + ".js-kit-images-form .js-uploadImageForm { display: inline; }" + + ".js-kit-images-form .js-uploadImageInputLabel { display: inline; margin-right: 5px; font-size: 12px; }" + + ".js-kit-images-form .js-kit-images-imgSizeSpec { display: none; }" + + ".js-kit-follow-openingProfile { cursor: default; text-decoration: none; }" + + ".js-kit-follow-activeNotifyMode-noemail { background: none; }" + + ".js-kit-follow-activeNotifyMode-email, .js-kit-follow-activeNotifyMode-anymails { background: #fffea9; }" + + ".js-kit-follow-notifyOptionRadio { float: left; width: 16px; height: 16px; cursor: pointer; }" + + ".js-kit-follow-notifyOptionLabel { float: left; margin-left: 3px; font-size: 12px; cursor: pointer; }" + + ".js-kit-follow-emailAddress { margin: 0px 5px; }" + + ".js-kit-follow-leftColumn { float: left; margin-right: -26px; position: relative; width: 26px; }" + + ".js-kit-follow-rightColumnWrapper { float: left; width: 100%; }" + + ".js-kit-follow-rightColumn { margin-left: 26px; }" + + ".js-kit-follow-emailContainer { " + (JSKitLib.isPreIE8() ? "zoom: 1; margin-left: 5px;" : "") + " font-size: 12px; margin-bottom: 10px; }" + + ".js-kit-follow-rssContainer { " + (JSKitLib.isPreIE8() ? "zoom: 1;" : "") + " }" + + ".js-kit-follow-rightSubColumn { float: right; position: relative; margin-left: -95px; width: 85px; }" + + ".js-kit-follow-leftSubColumnWrapper { float: right; width: 100%; }" + + ".js-kit-follow-leftSubColumn { margin-right: 95px; }" + + ".js-kit-follow-notifyModeSelector { margin: 5px 0px; }" + + ".js-kit-follow-rssThreadButton { padding: 0px; margin-left: 5px; cursor: pointer; }" + + ".js-kit-follow-label { font-size: 12px; font-weight: bold; }" + + ".js-kit-follow-emailIcon, .js-kit-follow-rssIcon { width: 16px; height: 16px; }" + + ".js-kit-follow-input { width: " + (JSKitLib.isIE() ? "98%" : "100%") + "; }" + + ".js-kit-exp-banner-container { background: #fffac3; border: 1px solid #fee747; position: absolute; z-index: 20100; width: 320px; height: 200px; margin: 0px; padding: 15px 20px; font-size: 12px; line-height: 120%; text-align: left; }" + + ".js-kit-exp-banner-header { margin-bottom: 10px; text-align: center; }" + + ".js-kit-exp-banner-title { font-weight: bold; }" + + ".js-kit-exp-banner-label { font-weight: bold; margin-right: 5px; }" + + ".js-kit-exp-banner-button-container { text-align: center; margin-top: 20px; }" + + ".js-kit-exp-banner-button { background-color: transparent; background-image: url('//cdn.js-kit.com/images/common/continue.png'); border: none; cursor: pointer; margin: 0; padding: 0; width: 112px; height: 39px; }" + + ".js-kit-replies-expand-container { padding: 10px 0px; cursor: pointer; text-align: center; background: url(//cdn.js-kit.com/images/replies-expand-bg.png) repeat-x center; }" + + ".js-kit-replies-expand-wrapper { display: inline; padding: 0px 10px; }" + + ".js-kit-replies-expand-label { display: inline; background: url(//cdn.js-kit.com/images/whirlpool-comments.png) center left no-repeat; padding-left: 15px; }" + + ".js-singleCommentNotice { color: #ff0000; font-size: 8pt; }" + + ".js-commentControl { float: left; margin-right: 2em; }" + + '.js-commentFieldInput { border: solid 1px #7f99b9; width:' +(JSKitLib.isPreIE7()?'98%':'100%')+';}' + + '.js-commentFieldInputProfile { border: solid 1px #7f99b9; width:' +(JSKitLib.isIE()?'98%':'100%')+' !important;}' + + ".js-CmtButton { margin-right: 0.5em }" + + ".js-CCButtons { margin: 0.3em 0 0.5em 0 }" + + ".js-CCButtons INPUT { font-size: 8pt; }" + + ".js-poweredBy { margin-top: 2pt; color: #808080; font-size: 7pt; font-family: Verdana, Helvetica; }" + + ".js-poweredBy A, .js-poweredBy A .js-poweredBy-text { text-decoration: none; color: #8080a0 !important; cursor: pointer; }" + + ".js-antispamBy { text-align: right; }" + + ".js-Progress { position: absolute; visibility: hidden; right: 5px; top: 5px; width: 15px; height: 15px; }" + + ".js-SettingsWindow { padding: 0.3em; border: solid 1px #cccccc; color: #404040; white-space: normal; font-family: Verdana, Helvetica; font-size: small; z-index: 400; }" + + ".js-SettingsWindowNolc { z-index: 14400 }" + + ".js-SettingsWindowHeader { text-align:center; padding: 5px 0; margin-bottom: 5px; background-color: #e6e9ec; font-size: 10pt; font-family: Verdana, Helvetica; color: #435362}" + + ".js-ControlBlockText, .js-ControlBlockTextDisabled {font-size: 8pt; text-align: left;}" + + ".js-ControlBlockButton {font-size: 8pt;}" + + ".js-ControlBlockTextDisabled {color: #808080}" + + ".js-showBorder {border:ridge 2px #a0a0a0;}" + + ".js-hideBorder {border:solid 2px #fefefe;}" + + ".js-SearchTitle {margin-right: 5px;}" + + ".js-SearchWords {padding: 0px; margin-right: 5px; border-bottom: 1px dashed #0000ff}" + + ".js-uploadAvatarForm {margin-top: 0px;}" + + ".js-singleCommentConversationHead {padding: 0.3em; " + (JSKitLib.isIE() ? "margin-top: 36px !important;" : "margin-top: 26px !important;") + "}" + + ".js-singleCommentConversationChild {padding: 0.3em; margin-top: -1px !important}" + + ".js-Conversation {padding: 0.3em; position: relative; top: -20px; display: inline; }" + + ".js-ConversationWrapper { height: 0px; " + (JSKitLib.isIE() ? "overflow: hidden;" : "") + "}" + + ".js-TornPageTop { margin-left: -5px; margin-right: -5px; " + (JSKitLib.isIE() ? "height: 6px;" : "height: 11px; margin-top: -5px; background: url(//cdn.js-kit.com/images/tornPaperT.gif) no-repeat;") + " }" + + ".js-TornPageBottom { margin-left: -5px; margin-right: -5px; " + (JSKitLib.isIE() ? "height: 6px;" : "height: 11px; margin-bottom: -5px; background: url(//cdn.js-kit.com/images/tornPaperB.gif) no-repeat;") + " }" + + ".js-TornPageTopImg { " + (JSKitLib.isIE() ? (JSKitLib.isPreIE7() ? "position: absolute;" : "float: left;") : "") + " margin-top: -5px; height: 11px; width: 100%; }" + + ".js-TornPageBottomImg { " + (JSKitLib.isIE() ? (JSKitLib.isPreIE7() ? "position: absolute;" : "float: left;") : "") + " margin-bottom: -5px; height: 11px; width: 100%; }" + + ".js-TornPageDivider { margin-left: -5px; margin-right: -5px;" + (JSKitLib.isPreIE7()?"":"margin-bottom: -1px;") + " height: 22px; background-color: #CBCBCB; }" + + ".js-TornPageDividerTop { height: 10px; background-color: #ECECEC; border: solid 1px #b0b0b0; border-top-width: 0; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; margin-bottom: 6px; }" + + ".js-TornPageDividerBottom { height: 10px; background-color: #ECECEC; border: solid 1px #b0b0b0; border-bottom-width: 0; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; }" + + ".js-commentBodyLabel { clear: both; }" + + ".js-CreateCommentFieldsBaseInfo { float: right; margin-bottom : 5px; width: 100%; }" + + ".js-commentCmtTextarea { clear: both; }" + + ".js-CommentsSkin-wireframe .js-commentAvatar { background: #FFFFFF; border: 1px solid #c0c0c0; width: 96px; height: 96px; margin: 0px 0px 5px 0px; }" + + ".js-CommentsSkin-smoothgray .js-commentAvatar { background: #FFFFFF; position: relative; float: right; margin-left: -102px; border: 1px solid #c0c0c0; width: 96px; height: 96px; }" + + ".js-kit-lcf-avatarsManagerWrapper { float: left; position: relative; width: 64px; height: 64px; margin-right: 10px; margin-right: -75px; overflow: visible !important; }" + + ".js-kit-basicUserInfoWrap { float: left; width: 100%; }" + + ".js-kit-lcf-userInfoWrapper { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-nonLoggedUserInfo .js-kit-lcf-fromMenuAnonymous, .js-kit-nonLoggedUserInfo .js-kit-lcf-toMenu, .js-kit-nonLoggedUserInfo .js-kit-fromMenuAnonymous { margin-left: 75px; }" + + ".js-kit-from-to-menu-title { margin: 5px 8px 0px 8px; font-weight: bold; font-size: 10px; }" + + ".js-kit-from-to-menu-footer { margin-top: 8px; }" + + ".js-kit-lcf-toMenu { margin: 9px 0px; }" + + ".js-kit-lcf-toField, .js-kit-from-menuAnonymousWrap { background-color: #FFFFFF; border: 1px solid #BBBBBB; }" + + ".js-kit-from-menuAnonymousWrap { " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-kit-lcf-toField .jskit-MenuRootHTML { cursor: pointer; }" + + ".js-kit-lcf-toField { cursor: pointer; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".jskit-MenuRootHTML { cursor: pointer; }" + + ".js-kit-from-control { float: left; margin-right: -85px; position: relative; }" + + ".js-kit-from-field { float: left; width: 100%; height: 26px; cursor: text; }" + + ".js-kit-from-name { margin: 5px 0px 0px " + (JSKitLib.isIE() ? "85" : "81") + "px; font-size: 14px; border: 0px; cursor:text; width: 15em; line-height: 14px; outline: 0px;}" + + ".js-kit-from-name input.jsipe-input { margin: 0px; padding: 0px; border: 0px; background: #FFFFFF; outline: 0px; font-size: 14px !important; }" + + ".js-kit-disabledNameField { background-color: #fffea9; cursor: pointer; }" + + ".js-kit-disabledNameField .js-kit-from-name, .js-kit-disabledNameField .js-kit-miniProfile-name-ipe { width: auto; cursor: pointer; }" + + ".js-kit-loggedUserInfo { margin-left: 0px; }" + + ".js-CmtSpam { background: url(//cdn.js-kit.com/images/bio-hazard.gif) bottom right repeat-x !important; background-color: #ffffe0 !important; color: #404040; }" + + (JSKitLib.isIE() ? ".js-CreateComment { zoom: 1; }" : "") + + ".js-previewImageDescr { width: 102px; left: 0px; bottom: 0px; }" + + ".js-previewImage { position: relative; text-align: center; margin: 4px; float: left; width: 102px; }" + + ".js-all-previewImages {margin-top: 15px; border-top: 1px solid #ececec; border-bottom: 1px solid #ececec; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" + + ".js-all-previewImages .js-previewImage { position: static; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + " }" + + ".js-uploadImageButton { float: left; color: blue; cursor: pointer; }" + + ".js-previewImageTitle { background-color: #ececec; font-size: 7pt; float: left;}" + + ".js-uploadImageInputWrapper2 { margin: 0; padding: 0; position: absolute; top: 0px; left: 0px;}" + + ".js-uploadImageInputWrapper1 {position: relative;}" + + ".js-uploadGreyDescr { color: #c0c0c0; }" + + ".js-uploadImageIcon { height: 16px; vertical-align: "+(JSKitLib.isSafari()?"sub":"middle")+"; margin-right: 5px; }" + + ".js-CommentsPopupLink { cursor: pointer; }" + + ".js-kit-popupComments { z-index: 13900 !important; }" + + ".js-kit-popupComments .js-CommentsArea { padding: 7px }" + + ".js-kit-popupComments .js-LeaveComment { font-family: Arial; font-size: 11pt; }" + + ".js-kit-follow-popup-container { border: 4px solid #CBCBCB; text-align: left; }" + + ".js-kit-follow-popup-header { font-family: Verdana, Helvetica; font-weight: bold; font-size: 12pt; color: gray; }" + + ".js-kit-follow-popup-header, .js-kit-follow-popup-footer { padding: 10px; background: #ECECEC; }" + + ".js-kit-follow-popup-editNotifications { float: left; cursor: pointer; font-size: 14px; padding-top: 3px; }" + + ".js-kit-follow-popup-cancelButtonContainer, .js-kit-follow-popup-doneButtonContainer { float: right; }" + + ".js-kit-follow-popup-cancelButton { margin-right: 5px; }" + + ".js-kit-clickable { cursor: pointer; }" + , 'cmt'); + if(JSKitLib.isOpera()) JSKitLib.addCss("wbr:after{content:\"\\00200B\"}", 'wbr'); + else JSKitLib.addCss(".js-singleCommentTEXT{word-wrap:break-word}", 'wbr'); + + JSKitLib.addCss("" + + ".js-CommentsSkin-smoothgray .js-OldCommentsWrap {zoom:1; margin-bottom: 1px; clear: both; background-color: #cbcbcb; -moz-border-radius: 7px; -webkit-border-radius: 7px; padding: 5px; }" + + ".js-CommentsSkin-smoothgray .js-OldComments { background-color: #ececec; border: solid 1px #b0b0b0; padding: 4px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; }" + + ".js-CommentsSkin-smoothgray .js-singleComment { border-style: none; margin: 0px; " + (JSKitLib.isIE() ? "zoom:1;" : "") + "; background: transparent; }" + + ".js-CommentsSkin-smoothgray .js-PageNOther { font-weight: bold; color: #0066cc; text-decoration: none; } " + + ".js-CommentsSkin-smoothgray .js-PageNCur { color: #fe9600; } " + + ".js-CommentsSkin-smoothgray .js-OldComments .js-CreateCommentArea { background-color: transparent; }" + + ".js-CommentsSkin-smoothgray .js-OldComments .js-singleCommentName { color: #0066cc; }" + + ".js-CommentsSkin-smoothgray .js-singleCommentBody { clear: both; color: #404040; background-color: #fefefe; padding: 4px 4px 4px 8px; -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; " + (JSKitLib.isIE() ? "zoom:1;" : "") + "}" + + ".js-CommentsSkin-smoothgray .js-singleCommentCtls { float: right; }" + + ".js-CommentsSkin-smoothgray .js-singleCommentBg { zoom: 1; padding: 0.3em; position: relative; }" + , "comments-skin-smoothgray"); + JSKitLib.addCss(".js-CommentsSkin-haloscan .js-singleComment { font-size: 11px; font-family: Verdana, Helvetica; border: none; zoom: 0; }" + + ".js-CommentsSkin-haloscan .js-singleCommentCtls { float: right; white-space: nowrap; }" + + ".js-CommentsSkin-haloscan .js-singleCommentAvatar { padding-bottom: 1em }" + + ".js-CommentsSkin-haloscan .js-LeaveComment { text-align: center; }" + + ".js-CommentsSkin-haloscan .js-commentControl, .js-CommentsSkin-haloscan .js-commentTool, .js-CommentsSkin-haloscan .js-poweredBy, .js-CommentsSkin-haloscan .js-poweredBy div { display: inline; float: none; }" + + ".js-CommentsSkin-haloscan .js-antispamBy { display: block; }" + + ".js-CommentsSkin-haloscan .js-CreateCommentBg { width: 30em; margin-top: 1em; margin-left: auto; margin-right: auto; padding: 0.5em; text-align: left; float: none; border: none; }" + + ".js-CommentsSkin-haloscan .js-singleCommentBg { padding: 0em }" + , "comments-skin-haloscan"); + + // new skin layout + JSKitLib.addCss('' + + '.js-CommentsSkin-echo .jsk-ThreadWrapper { margin-bottom: 1em; padding: 10px; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; ' + (JSKitLib.isIE() ? 'zoom:1;' : '') + ' }' + + '.js-CommentsSkin-echo .jsk-StreamWrapper { margin-bottom: 1em; background: url(//cdn.js-kit.com/images/dot-gray.png) repeat-x bottom; }' + + '.js-CommentsSkin-echo .jsk-HeaderWrapper { padding-top: 1em; padding-bottom: 1em; }' + + '.js-CommentsSkin-echo textarea.js-CmtText-noWYSIWYG, .js-CommentsSkin-echo textarea.js-CmtTextEdit-noWYSIWYG { border: 0px; background: #FFFFFF; padding: 0px; }' + + '.js-CommentsSkin-echo .jsk-CommentFormBody-noWYSIWYG, .js-CommentsSkin-echo .jsk-CommentEditFormBody-noWYSIWYG { ' + (JSKitLib.isIE() ? "zoom: 1;" : "") + ' border: 1px solid #BBBBBB; padding: 5px 7px; background: #FFFFFF; }' + + '.js-CommentsSkin-echo .js-commentTool { display: none; }' + + ".js-CommentsSkin-echo .js-singleCommentAvatar { background-position: center; }" + + ".js-PageMore { text-align: center; border: solid 1px #E4E4E4; padding: 10px; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; cursor: pointer; font-weight: bold; background-color: #FFFFFF; " + (JSKitLib.isIE() ? "zoom: 1;" : "") + "}" + + '.jsk-HeaderInfoBox { float: left; }' + + '.jsk-HeaderInfoBoxImg { float: left; padding: 0px; width: 16px; height: 16px; }' + + '.jsk-CommentsCountWrap { float: left; ' + (JSKitLib.isIE() ? "zoom: 1;" : "") + ' padding: 0px; margin-left: 5px; line-height: normal !important; }' + + '.jsk-CommentsCount { font-weight: bold !important; }' + + '.jsk-HeaderMenu { float: right; }' + + '.jsk-HeaderPauseBox { display: none; margin: 0px; padding: 3px; float: right; vertical-align: middle;}' + + '.jsk-HeaderPauseBoxImg { float: left; width: 16px; margin-right: 2px; }' + + '.jsk-MenuAdmin { float: right; }' + + '.jsk-MenuAdmin .jskit-MenuItem { text-align: left; }' + + '.jsk-ItemWrapper { padding-bottom: 1em; padding-top: 1em; background: url(//cdn.js-kit.com/images/dot-gray.png) repeat-x top; line-height: 150%; }' + + '.jsk-ItemWrapper-borderless { background: none; }' + + '.jsk-ItemUserAvatarWrapper { float: left; padding: 2px; }' + + '.jsk-ItemContentWrapper { margin-left: 10px }' + + '.jsk-ItemFooter { text-align: left; }' + + '.jsk-ItemAttachmentsTitle { float: left; line-height: 100%; font-size: 0.8em; padding: 1px; }' + + '.jsk-ItemAttachmentIconWrapper { padding: 5px; border: 1px solid #ECECEC; }' + + '.jsk-ItemAttachmentWrapper { float: left; margin: 0px; margin: 5px 12px 5px 12px; text-align: center; width: 110px; }' + + '.js-singleCommentAdminStar { border: 0; width: 16px; height: 16px; vertical-align: middle; display: none; }' + + + ".jsk-CommentFormSurface { zoom: 1; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; border: 1px solid #dddddd; padding: 11px; line-height: normal; }" + + ".jsk-CommentFormAvatar { float: left; }" + + ".jsk-CommentFormFooter { margin-top: 11px; width: 100%; }" + + ".jsk-CommentFormAvatarsArea { border: 1px solid #bbbbbb; margin: 0em 0em 0.6em 0em; padding: 0.3em; }" + + ".jsk-CommentFormAvatarsArea .jsk-avt-section-label { font-weight: bold; font-size: 12px; }" + + ".jsk-CommentFormAvatarsArea .jsk-avt-upload-label { font-size: 8pt; }" + + ".jsk-CommentFormInputsWrapper { padding-left: 113px; margin-bottom: 11px; }" + + ".jsk-CommentFormButton { margin-left: 0.5em; }" + + ".jsk-CommentFormWrapper { margin-bottom: 1em; }" + + // new pager + + '.jsk-PagerWrapper { width: 100%; text-align: center; padding: 0.75em 0px; }' + + '.jsk-Pager { border: 0; margin: 0; padding: 0; display: inline; }' + + '.jsk-Pager li { border:0; margin:0; padding:0; list-style:none; display: inline; margin-left: 3px; }' + + '.jsk-Pager a { border: solid 1px #DDDDDD; }' + + '.jsk-Pager .jsk-PrevOff, .jsk-Pager .jsk-NextOff { color:#666666; padding: 5px 8px; }' + + '.jsk-Pager .jsk-Prev a, .jsk-Pager .jsk-Next a { border:solid 1px #DDDDDD; }' + + '.jsk-Pager .jsk-Active { color:#ff0084; font-weight:bold; padding: 5px 8px; }' + + '.jsk-Pager a:link, .jsk-Pager a:visited { color:#0063e3; padding: 4px 7px; text-decoration:none; }' + + '.jsk-Pager a:hover { border:solid 1px #666666; }' + + '.jsk-PagerItemHover { background-color: #E4E4E4; }' + + // new skin theme + // colors: + + '.jsk-PrimaryBackgroundColor { background-color: #FFFFFF; }' + + '.jsk-SecondaryBackgroundColor { background-color: #f4f4f4; }' + + '.jsk-TrinaryBackgroundColor { background-color: #ECEFF5; }' + + '.jsk-PrimaryHighlightColor { color: #fffea9; }' + + '.jsk-SecondaryHighlightColor { color: #ffff00; }' + + '.jsk-PrimaryFontColor { color: #3a3a3a; }' + + '.jsk-SecondaryFontColor, .jsk-ThreadWrapper a.jsk-SecondaryFontColor { color: #c6c6c6; }' + + '.jsk-ThreadWrapper a, .jsk-LinkColor { color: #476cb8; }' + + '.jsk-H1Color { color: #878487; }' + // fonts: + + '.jsk-PrimaryFont, .jsk-PrimaryFont a:hover, .jsk-CommentFormSurface input, .js-kit-follow-popup-container input { font-family: Lucida grande, Tahoma, Verdana, Arial; }' + + '.jsk-PrimaryFont { font-size: 8pt; font-weight: normal; }' + + '.jsk-H1Font { font-size: 1.38em; font-weight: bold; line-height: 1.4em; }' + + '.jsk-LinkFont, .jsk-ThreadWrapper a, .jsk-ThreadWrapper a:hover { text-decoration: none; font-weight: normal; }' + + // other skin's properties + + '.jsk-DisabledFontColor { color: #9c9c9c; }' + + '.jsk-ItemName { font-weight: bold; }' + + 'input.jsk-CommentFormButton { font-size: 1.25em; }' + + '.jsk-HeaderMenu table td { border-spacing: 0; padding: 0; margin: 0; vertical-align: middle; height: 16px; }' + + '.jsk-HeaderMenu table td .js-singleCommentMenuTitleExpandMarker { margin: 0; padding: 0; }' + + '.jsk-HeaderMenu .js-singleCommentMenuTitle { padding: 0; margin: 0; }' + + '.js-CommentsSkin-echo .js-poweredBy { font-family: Arial; font-size: 9px; color: #bbbbbb; margin-top: 1.2em; white-space: nowrap; line-height: normal; text-align: right; }' + + '.js-CommentsSkin-echo .js-poweredBy-wrapper { float: right; }' + + '.js-CommentsSkin-echo .js-poweredBy-logo { ' + (JSKitLib.isPreIE8() ? "zoom: 1;" : "") + ' border: none; margin-left: 5px; height: 14px; width: 25px; float: right; }' + + '.js-CommentsSkin-echo .js-poweredBy-text { ' + (JSKitLib.isIE() ? "zoom: 1; padding-bottom: 3px;" : "") + 'float: right; }' + + '.js-CommentsSkin-echo .js-commentAvatar { margin: 0; }' + + ".js-CommentsSkin-echo .js-commentFieldInput { outline: 0px; border: 0px solid; width: 100%; }" + + ".js-CommentsSkin-echo .js-commentFieldLabel { clear: none; margin: 0; }" + + ".js-CommentsSkin-echo .js-authSelector { float: none; }" + + '.js-CommentsSkin-echo .js-singleComment { border: none; }' + + '.js-CommentsSkin-echo .js-singleCommentBg { padding: 0; position: static; }' + + '.js-CommentsSkin-echo .jsk-ItemChildrenMarker { border-color: transparent transparent #ECEFF5; border-width: 0px 11px 11px; border-style: solid; margin: 3px 0px 0px 67px; height: 1px; width: 0px; display: none;' + (JSKitLib.isIE() ? ' font-size: 1px; line-height: 1px; filter: chroma(color=black);' : '') + ' }' // This is magic "arrow up". Only color and margins could be changed + + '.js-CommentsSkin-echo .jsk-ItemWrapperThread { padding-bottom: 1px; }' + + '.js-CommentsSkin-echo .jsk-ItemWrapperThread .jsk-ItemChildrenMarker { display: block; }' + + '.js-CommentsSkin-echo .jsk-ItemWrapperChild { padding: 10px; margin: 0px 20px 2px 0px; background-image: none; }' + + '.js-CommentsSkin-echo .js-singleCommentCtls { float: left; white-space: normal; }' + + '.js-CommentsSkin-echo .js-singleCommentDate { font-size: 1em; }' + + '.js-CommentsSkin-echo .js-previewImageDescr { width: 110px; }' + + '.js-CommentsSkin-echo .jsk-ItemAge { float: left; margin: 0 0.5em 0 0; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmit { position: absolute; left: 11px; bottom: 3px; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitImg { margin-bottom: -3px; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitLabel { margin-left: 5px; color: #000000; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitRetry { display: none; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitMsg { position: relative; -moz-border-radius: 0.5em; -webkit-border-radius: 0.7em; background-color: #FFFF99; border: solid 1px #C6C677; padding: 10px; margin: 0 40px; }' + + '.js-CommentsSkin-echo .js-CommentWaitSubmitWrapper { background-color: #FFFFFF; position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-transition: opacity 0.5s ease-out; -moz-border-radius: 0.5em; -webkit-border-radius: 0.7em; vertical-align : middle; text-align: center; }' + + '.js-singleViaLinkWrapper { text-align: right; float: right; margin-right: 7px; }' + + '.js-singleCommentViaIcon { ' + (JSKitLib.isIE() ? "zoom: 1;": "") + ' border: 0; margin: 0.1em 0.3em 0 0.3em; width: 16px; height: 16px; float: right; }' + + '.js-singleViaText { ' + (JSKitLib.isIE() ? "zoom: 1;": "") + ' margin-bottom: 0.5em; white-space: nowrap; float: right; }' + + 'table.mceToolbar { width: auto !important; }' + + 'table.mceLayout td { padding: 0px !important; }' + + (JSKitLib.isIE() && !JSKitLib.isPreIE8() ? 'table.mceLayout a { display: none; }' : '') // hiding with empty text + + , 'comments-skin-echo'); + + JSKitLib.addCss("" + + ".js-kit-lcf-Border { border: 1px solid #BBBBBB; overflow: hidden; }" + + ".jskit-GoogleLikeMenuBar { width: " + (JSKitLib.isIE() ? "79" : "75") + "px; height: 26px; border-right: 1px solid #BBBBBB; font-size: 12px; line-height: 26px; cursor: pointer; text-align: right; white-space: nowrap; background: url(//cdn.js-kit.com/images/google-like-button.png);}" + + ".jskit-GoogleLikeMenuBarExpandMarker { float: right; line-height: 12px; height: 10px; width: 10px; margin: 9px 5px 0px 5px; }" + + ".jskit-GoogleLikeMenuBarText { float: right; font-weight: bold; color: #3a3a3a; }" + + ".jskit-Dogtag { background-color: #E2E9FF; float: left; margin: 1px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border: 1px solid #88AADD; white-space: nowrap; height: 22px; cursor: default; }" + + ".jskit-DogtagIcon { width: 16px; height: 16px; margin: 3px; float: left; }" + + ".jskit-DogtagCross { width: 10px; height: 10px; margin: 6px 5px 6px 0px; float: left; cursor: pointer; line-height: 10px; }" + + ".jskit-DogtagText { float: left; margin: 4px 7px 3px 2px; font-size: 11px; " + (JSKitLib.isIE() && document.compatMode == "BackCompat" ? "line-height: 22px; margin-top: 0px;" : "") + " }" + + ".js-nsgecko { -moz-user-select: none; }"); +} + +JSCC.prototype.setStreamState = function(paused, forced) { + if (!forced && this.pause.forced) return; + this.pause.state = paused; + this.pause.forced = !!forced; + this.renderPauseIndicator(); + if(!paused) { + if(this.pause.queue.length > 0) { + var events = this.pause.queue; + this.pause.queue = []; + this.renderSubscribeEvents(events); + } + this.renderPauseCounter(); + } +} + +JSCC.prototype.renderPauseIndicator = function() { + if(!this.pause.visible) return; + JSKitLib.show(this.TC["jsk-HeaderPauseBox"], 'block'); + var state = this.pause.state; + if(!this.pause.forced && !this.pause.visible) { + this.pause.state = false; + } + JSKitLib.setStyle(this.TC["jsk-HeaderPauseBoxImg"], "background: url('//cdn.js-kit.com/images/control_" + (state ? "pause" : "play") + ".png') no-repeat center center"); + JSKitLib.text($JCL(state ? 'statePaused' : 'stateLive'), this.TC["jsk-HeaderPauseBoxName"], true); + JSKitLib.preventSelect(this.TC["jsk-HeaderPauseBoxName"]); +} + +JSCC.prototype.renderPauseCounter = function() { + if(!this.pause.visible) return; + JSKitLib.text(this.pause.queue.length == 0 ? '' : + '(' + this.pause.queue.length + ' ' + $JCL('itemsNew') + ')', this.TC["jsk-HeaderPauseBoxCount"], true); + JSKitLib.preventSelect(this.TC["jsk-HeaderPauseBoxCount"]); +} + +JSCC.prototype.setDefaultField = function(name,value) { + JSKitLib.fmap.call(this, ["fieldDfl", "extraFormFields"], function(section) { + this[section][name] = JSKitEPB.getValue(name) || value || ""; + }); +} + +JSCC.prototype.addChild = function(to, what) { + if (typeof(to) != 'object') + return; + + if(arguments.length == 3 && arguments[2]) + to.insertBefore(what, to.firstChild); + else + to.appendChild(what); +} + +JSCC.prototype.a = function() { + var a = this.cr("a"); + a.href = "javascript:void(0);"; + for(var text = '', i = 0; i < arguments.length; i++) + text += arguments[i]; + a.innerHTML += text; + return a; +} + +JSCC.prototype.div = function(id) { + var self = this; + var div = this.cr("div"); + for(var i = 1; i < arguments.length; i++) { + var arg = arguments[i]; + switch(typeof(arg)) { + case "string": + this.addChild(div, document.createTextNode(arg)); + break; + case "undefined": + break; + default: + case "object": + if(!arg) break; + this.addChild(div, arg); + break; + } + } + if(id) { + div.className = id; + var arr = String(id).split(/[ ]+/); + JSKitLib.map(function(el) { + if(el.substr(0, 3) == 'js-') + self.TC[el] = div; + }, arr); + } + return div; +} + +JSCC.prototype.dtComment + = '
      ' + + '
      ' + + '
      ' + + '
      ' + + '{Name}' + + '' + + '
      {Date}
      ' + + '
      ' + + '' + + '
      {Text}
      ' + + '
      ' + + '
      {Notice}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:likeThisComment}' + + ' [{Label:yes}]' + + ' [{Label:no}]' + + ' ({Label:Score}:' + + ' 0 {Label:byVotes}' + + ' 0)' + + '' + + '
      ' + + '
      {Label:communityAssignedCarmaScore}:' + + ' 0 {Label:byVotes}' + + ' 0' + + '
      ' + + '
      ' + + '[{Label:btnReply}]' + + ' [{Label:btnDelete}]' + + ' [{Label:btnEdit}]' + + ' [{Label:btnModerate}]' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' +; + +JSCC.prototype.dtComment2 + = '
      ' + + '
      ' + + '
      ' + + '
      ' + + '{Name}' + + '' + + ' {Label::depth?replies:says}:' + + '
      ' + + '
      {Age}
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '' + + '
      {Text}
      ' + + '
      {Notice}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:likeThisComment}' + + ' [{Label:yes}]' + + ' [{Label:no}]' + + ' ({Label:Score}:' + + ' 0 {Label:byVotes}' + + ' 0)' + + '' + + '
      ' + + '
      {Label:communityAssignedCarmaScore}:' + + ' 0 {Label:byVotes}' + + ' 0' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:btnReply}
      ' + + '
      {Label:btnDelete}
      ' + + '
      {Label:btnEdit}
      ' + + '
      {Label:btnModerate}
      ' + + '
      ' + + '
      ' + + '
      ' // Body + + '
      ' + + '
      ' +; + +JSCC.prototype.dtComment3 + = '
      ' + + '
      ' + + '' + + '
      ' + + '{Text}
      ' + + '
      ' + + '
      ' + + '

      ' +; + +JSCC.prototype.dtCommentEcho + = '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + ' ' + + '{Name}' + + '{IP}' + + ' ' + + '
      ' + + '{Text}' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Age}
      ' + + '
      ' + + '' + + '' + + '{Label:btnFlag|ucf}' + + '' + + '' + + '' + + '{Label:btnLike|ucf}' + + '' + + '' + + '' + + '{Label:btnReply|ucf}' + + '' + + '' + + '' + + '{Label:btnDelete|ucf}' + + '' + + '' + + '' + + '{Label:btnEdit|ucf}' + + '' + + '' + + '' + + '{Label:btnModerate|ucf}' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' +; + +JSCC.prototype.ffComment + = '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + ' ' + + '{content.user.name}' + + ' ' + + '
      ' + + '{content.title}' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Age}
      ' + + '
      ' + + '' + + '' + + '{Label:btnFlag|ucf}' + + '' + + '' + + '' + + '{Label:btnLike|ucf}' + + '' + + '' + + '' + + '{Label:btnReply|ucf}' + + '' + + '' + + '' + + '{Label:btnDelete|ucf}' + + '' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' +; + +JSCC.prototype.dtHeaderEcho + = '
      ' + + '
      ' + + '
      ' + + '
      {Title}' + + ' {CountLabel}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
       
      ' + + '' + + ' ' + + '' + + ' –' + + '
      ' + + '
      ' + + '
      ' + + '
      ' +; + +JSCC.prototype.dtCreate + = '
      ' + + '
      ' + + '
      {Label:leaveComment}
      ' + + '
      ' + + '
      {Label:nicknameLabel}
      ' + + '
      ' + + '
      ' + + '
      {Label:url}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:emailLabel}' + + '
      {Label:emailNote}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:ratingLabel}
      ' + + '
      ' + + '
      {Label:commentLabel}
      ' + + '
      ' + + '
      {Label:avatar}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '' + + '[{Label:more}]' + + '
      ' + + '' + + '
      (Spam filtering by Akismet)
      ' + + '

      ' +; + +JSCC.prototype.dtCreate2 + = '
      ' + + '
      ' + + '
      {Label:leaveComment}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:nicknameLabel}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:url}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:emailLabel}' + + '
      {Label:emailNote}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:ratingLabel}
      ' + + '
      ' + + '
      {Label:commentLabel}
      ' + + '
      ' + + '
      ' + + '
      ' // Fields + + '
      ' + + '
      ' + + '{Label:addPicText}' + + '
      ' + + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      (Spam filtering by Akismet)
      ' + + '
      ' + + '

      ' +; + +JSCC.prototype.dtCreate3 + = '
      ' + + '
      ' + + '
      {Label:leaveComment}
      ' + + '
      ' + + '
      {Label:nicknameLabel}
      ' + + '
      ' + + '
      ' + + '
      {Label:emailLabel}' + + '
      {Label:emailNote}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:url}
      ' + + '
      ' + + '
      ' + + '
      {Label:ratingLabel}
      ' + + '
      ' + + '
      {Label:commentLabel}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '[{Label:more}]' + + '
      ' + + '' + + '
      (Spam filtering by Akismet)
      ' + + '

      ' +; + +JSCC.prototype.dtCreateEcho += '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' ++ '
      '; + +JSCC.prototype.dtProfileCreate + = '
      ' + + '
      ' + + '
      {Label:leaveComment}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:nicknameLabel}
      ' + + '
      ' + + '
      ' + + '
      {Label:emailLabel}' + + '
      {Label:emailNote}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:commentLabel}
      ' + + '
      ' + + '
      ' // Fields + + '
      ' + + '
      ' + + '' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '

      ' +; + +JSCC.prototype.dtEditComment + = '' +; + +JSCC.prototype.dtEditComment2 + = '' +; + +JSCC.prototype.dtConversation + = '
      ' + + '
      ' + + '{Label}{Name}' + + '
      ' + + '
      ' +; + +JSCC.prototype.dtMiniProfileLeaveComment = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + +JSCC.prototype.dtCreateUserInfoLogged = + '
      ' + + '
      ' + + '
      ' + + '
      '; + +JSCC.prototype.dtCreateUserInfoNonLogged = + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      '; + +JSCC.prototype.dtCommentsPopupLink + = '{LinkLabel}'; + +JSCC.prototype.dtPostingCommentDialog + = '
      ' + + '
      ' + + '' + + '' + + ' (' + + '{Label:retry}/' + + '{Label:cancel}' + +')' + + '
      ' + + '
      '; + +JSCC.prototype.dtFollowPanel = +'
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:follow_emailNotification}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:follow_notifyMode_noemail}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:follow_notifyMode_anymails}
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '{Label:follow_emailAddressLabel}' + + '' + + '' + + '({Label:follow_editProfile})' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      {Label:follow_rssThread}
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + + '
      ' + +'
      '; + +JSCC.prototype.dtFollowPanelPopup = + '
      ' + + '
      {Label:follow_popupHeader}
      ' + + '
      ' + + '' + + '
      '; + +JSCC.prototype.dtExpirationBanner = + '
      ' + + '
      ' + + '
      {Label:expirationBanner_title}
      ' + + '
      {Label:expirationBanner_description}
      ' + + '
      ' + + '
      ' + + '{Label:expirationBanner_domain}' + + '' + + '
      ' + + '
      ' + + '{Label:expirationBanner_subscriptionType}' + + '' + + '
      ' + + '
      ' + + '{Label:expirationBanner_serviceFirstDate}' + + '' + + '
      ' + + '
      ' + + '{Label:expirationBanner_expirationDate}' + + '' + + '
      ' + + '
      ' + + '' + + '
      ' + + '
      '; + +JSCC.prototype.localDate = function(t) { + if(!t) return ""; + var d = new Date(t * 1000); + return d.toLocaleDateString(); +} + +JSCC.prototype.localTime = function(t) { + if(!t) return ""; + var d = new Date(t * 1000); + return d.toLocaleTimeString(); +} + +JSCC.prototype.localAge = function(t) { + if(!t) return ""; + if(t) + var d = new Date(t * 1000); + var offset = d.getTimezoneOffset() * 60; + var day = Math.ceil(((new Date()).valueOf() - offset * 1000) / 86400000) * 86400; + var when = Math.floor((day - t + offset) / 86400); + switch(when) { + case 0: when = $JCL("leftToday"); break; + case 1: when = $JCL("leftYesterday"); break; + default: + if(when > 0 && when < 6) + when = when + $JCL("leftDaysAgo"); + else + when = d.toLocaleDateString(); + } + return when + ", " + d.toLocaleTimeString(); +} + +JSCC.prototype.viaLink = function(content) { + if (!content) return ""; + + if (content.service && content.service.profileUrl) { + return content.service.profileUrl; + } else if (content.user && content.user.profileUrl) { + return content.user.profileUrl; + } else { + return ""; + } +} + +JSCC.prototype.JCL = function(v) { + return $JCL( + (v == 'leaveComment') ? (this.config.label || v) : v + ); +} + +JSCC.prototype.gtmpl = function(t, mObj) { + var s = this; + var lowercase = function(a, m) { return String(m).toLowerCase(); } + t = t.replace(/^[^<]*(<[\s\S]*>)[^>]*$/, "$1"); + t = t.replace(/(<[\/]?[A-Z]+)/g, lowercase); + if(mObj && mObj.ID) t = t.replace(/(<[a-z]+)/, '$1 id="' + mObj.ID + '"'); + t = t.replace(/{Label:([^:\|}]+[^\|}]*)\|?([^}]*)}/g, + function(a, m, modifier) { + var loc = s.JCL(m); + switch (modifier) { + case 'uc' : loc = loc.toUpperCase(); break; + case 'lc' : loc = loc.toLowerCase(); break; + case 'ucf': loc = loc.substr(0, 1).toUpperCase() + loc.substr(1); break; + } + return loc; + }); + t = t.replace(/{([a-zA-Z]+\.)+([a-zA-Z]+)}/g, + function(a) { + var arr = a.substr(1,a.length-2).split(/\./); + var res = mObj; + JSKitLib.fmap(arr, function(v) { + if(res[v]) { + res = res[v] + } else { + return ''; + } + }); + return res || ''; + }); + return t; +} + +JSCC.prototype.tmpl = function(t, obj, dontPutId) { + var self = this; + t = self.gtmpl(t, dontPutId ? false : obj); + t = t.replace(/{Age}/g, self.localAge(obj.TS)); + t = t.replace(/{Date}/g, self.localDate(obj.TS)); + t = t.replace(/{Time}/g, self.localTime(obj.TS)); + t = t.replace(/{Via}/g, self.viaLink(obj.content)); + if (obj.IP) t = t.replace(/{IP}/g, " (" + obj.IP + ")"); + var text = String(obj.Text); + if ((obj.status == 'M' || obj.status == 'H') + && (this.serverOptions.mmode == 'pre' || this.serverOptions.mmode == 'onhold' || (obj.msgtype && obj.msgtype.match(/T|P/)))) { + text += (this.serverOptions.mtext || ''); + } + text = text.replace(/^[ \s]+|[ \s]+$/, ''); + text = text.replace(/\n\n+/g, '\n\n'); + text = text.replace(/\n/g, ' 
      '); + if(text.indexOf('<') == -1) + text = text.replace(/([^&<>\s]{12})([^&<>\s]{12})/g, '$1$2'); + text = text.replace(/{/g, '{'); + t = t.replace(/{Text}/g, text); + t = t.replace(/{Label:(:([a-z]+)\?([^:}]*):([^}]*))?([^}]*)}/g, + function(a,b,p,f,s,m){ + if(p) m = (obj[p]?f:s)+m; + return $JCL(m); + }); + var d = {"SO:":this.serverOptions,"":obj}; + t = t.replace(/{([A-Z]+:)?([A-Za-z0-9]+)(\+\d+)?}/g, + function(a,t,m,p){ var v = ((d[t]||obj)[m])||''; if(p) v = parseInt(v) + parseInt(p); return v; }); + return t; +} + +JSCC.prototype.setCommentStyle = function(cmt, className) { + var el = cmt.ctls['js-singleCommentBody'] || cmt; + if(el) JSKitLib.addClass(el,className); +} + +JSCC.prototype.cmtSetSpamStatus = function(cmt, s) { + cmt.cobj.status = s ? 'S' : 'A'; + if(s) { + this.setCommentStyle(cmt, "js-CmtSpam"); + } else { + cmt.style.backgroundColor = ""; + cmt.style.backgroundImage = ""; + cmt.style.color = ''; + } + if(cmt.domINFO) cmt.domINFO.style.backgroundColor = s ? '#ffffe0' : ""; +} + +JSCC.prototype.cmtSetOffensiveStatus = function(cmt, s) { + cmt.cobj.status = s ? 'O' : 'A'; + if(s) { + this.setCommentStyle(cmt, "js-CmtSpam"); + } else { + cmt.style.backgroundColor = ""; + cmt.style.backgroundImage = ""; + cmt.style.color = ''; + } + if(cmt.domINFO) cmt.domINFO.style.backgroundColor = s ? '#ffffe0' : ""; +} + +JSCC.prototype.blockAction = function(action) { + var s = this; + var cid = s.ctBlock.forId; + var cmt = s.jspg.getItemById(cid).div; + s.hideSettingsWindow('ctBlock'); + switch(action) { + case "approve": + s.cmtApprove(cid); + break; + case "approveuser": + s.cmtApproveUser(cid); + break; + case "delete": + s.cmtDelete(cid, 'delete'); + break; + case "spam": + s.cmtSetSpamStatus(cmt, true); + s.cmtDelete(cid, 'spam'); + break; + case "ip": + case "user": + s.cmtDelete(cid, 'block_by_action', action); + break; + case "unban": + s.cmtDelete(cid, action); + } +} + +JSCC.prototype.moderationCommentsListUpdate = function(id, moderate) { + if (moderate) this.moderationCommentsList[id] = true; + else delete this.moderationCommentsList[id]; + return true; +} + +JSCC.prototype.hideExpirationBanner = function() { + if (!this.expirationBanner) return; + this.expirationBanner.parentNode.removeChild(this.expirationBanner); + delete this.expirationBanner; +} + +JSCC.prototype.showExpirationBanner = function(target) { + var s = this; + var recalcPosition = function() { + var coords = { + "local": JSKitLib.findPos(target), + "global": JSKitLib.findPos(s.target) + }; + s.expirationBanner.style.top = (coords.local[1] + target.offsetHeight) + "px"; + s.expirationBanner.style.left = (coords.global[0] + (s.target.offsetWidth - s.expirationBanner.offsetWidth)/2) + "px"; + }; + if (s.expirationBanner) { + recalcPosition(); + return; + } + var template = s.gtmpl(s.dtExpirationBanner); + var descriptors = { + "domain": function() { + return JSKitLib.text(s.config.domain); + }, + "creation": function(element, dom) { + if (s.account.creation) { + return JSKitLib.text(s.localDate(s.account.creation)); + } + JSKitLib.hide(dom.get("creation-wrap")); + }, + "expiration": function() { + return JSKitLib.text(s.localDate(s.account.expiration)); + }, + "subscription": function() { + var subscriptions = { + "free": "Echo Free", + "pro": "Echo Live", + "proplus": "Echo PRO" + }; + return JSKitLib.text(subscriptions[s.account.subscription || "free"]); + }, + "button": function(element) { + JSKitLib.setEventHandler(element, ["click"], function() { + window.open("//js-kit.com/settings/pricing.cgi?site=" + s.config.domain, "_blank"); + }); + } + }; + s.expirationBanner = JSKitLib.toDOM(template, "js-kit-exp-banner-", descriptors).content; + s.target.appendChild(s.expirationBanner); + recalcPosition(); +} + +JSCC.prototype.cmtBlock = function(cid) { + var s = this; + var cmt = s.jspg.getItemById(cid).div; + if (s.account.expired) { + s.showExpirationBanner(cmt.domCtls || cmt.domINFO); + return; + } + var status = cmt.cobj.status; + var msgtype = cmt.cobj.msgtype || ''; + var cmtreason; + if (status && status=='S' && cmt.cobj.reason) { + switch (cmt.cobj.reason) { + case 'Blocked by User': + case 'User': + cmtreason = 'User'; + break; + case 'IP': + case 'Blocked by IP': + cmtreason = 'IP'; + break; + } + } + if(s.ctBlock) { s.hideSettingsWindow('ctBlock'); return; } + if(!s.blockDom) { s.blockDom = {}; } + if(!s.blockDom[status]) { s.blockDom[status] = {}; } + if(!s.blockDom[status][cmtreason]) { var jca = '$JCA[' + s.jcaIndex + '].blockAction'; + var cb = function(a, d) { + return '" class="js-ControlBlockButton" '+(d ? 'disabled="on"' : '')+'" onclick="this.blur();'+jca+"('"+a+'\');return false;" />
      ';} + var trth = ''; + var trtd = ''; + var trtdd = ''; + var tinp = '' + + (s.serverOptions.mmode != 'onhold' ? '' : ( + trth + $JCL("approveUser") + trtd + aumsg + + tinp + $JCL("approveUser") + cb('approveuser'))) + + trth + $JCL("approveMessage") + + mtrt + ammsg + + tinp + $JCL("approveMessage") + cb('approve') + + trth + $JCL("deleteUnwantedComment") + + trtd + $JCL("getRidOfComment") + + tinp + $JCL("deleteMessage") + cb('delete') + + ((cmtreason == 'User' || cmtreason == 'IP') ? + '' : + trth + $JCL("flagAsSpam") + + trtd + $JCL("trainAksimet") + + tinp + $JCL("spamJunk") + cb('spam')) + + ((cmtreason == 'User') ? + unbantext + : trth + $JCL("blockCommenter") + + trtd + $JCL("hideCommentsFromUser") + + tinp + $JCL("blockUser")+cb('user')) + + ((cmtreason == 'IP') ? + unbantext + : trth + $JCL("blockCommenterIP") + + trtd + $JCL("hideCommentsFromIP") + + tinp + $JCL("blockIP")+cb('ip')) + + ""); + } + s.settingsWindow('ctBlock', cmt.domCtls || cmt.domINFO, s.blockDom[status][cmtreason]); + s.ctBlock.forId = cid; +} +JSCC.prototype.cmtApprove = function(cid) { + var cmt = this.jspg.getItemById(cid).div; + if(cmt.cobj.status == 'S') { + this.cmtSetSpamStatus(cmt, false); + cmt.cobj.status = 'S'; // cmtDelete's deal + } + if(cmt.cobj.status == 'O') { + this.cmtSetOffensiveStatus(cmt, false); + cmt.cobj.status = 'O'; + } + this.cmtDelete(cid, 'message'); +} + +JSCC.prototype.cmtApproveUser = function(cid) { + var cmt = this.jspg.getItemById(cid).div; + if(cmt.cobj.status == 'S') { + this.cmtSetSpamStatus(cmt, false); + cmt.cobj.status = 'S'; // cmtDelete's deal + } + this.cmtDelete(cid, 'user'); +} + +JSCC.prototype.routeAction = function(fun) { + var a = [this]; + for(var i = 0; i < $JCA.length; i++) { + if($JCA[i].jcaIndex != this.jcaIndex + && $JCA[i].config.domain == this.config.domain + && $JCA[i].config.path == this.config.path + && $JCA[i].config['display-mode'] == 'inline' + && !this.IM && !$JCA[i].IM && !$JCA[i].config.userProfileComments) + a.push($JCA[i]); + } + for(var i = 0; i < a.length; i++) { + var e = a[i]; + if(i) e.serverFilter = function(n) { + return (n == 's-data.js'); } + fun.apply(e); + delete e.serverFilter; + } +} + +JSCC.prototype.cmtDelete = function(cid, approvalMode) { + var args = arguments; + this.routeAction(function() { + this.cmtDeleteAct.apply(this, args); + }); +} + +JSCC.prototype.cmtDeleteAct = function(cid, approvalMode, action) { + var s = this; + var item = this.jspg.getItemById(cid); + if (!item) return; + var cmt = item.div; + if(!cmt) { + (this.objById[cid]||{}).status = 'D'; + this.jspg.deleteItem(cid); + this.reCalcPages(); + return; + } + + if(arguments.length == 1) approvalMode = 'delete'; + + var oldStatus = cmt.cobj.status; + + var path = (this.config.moderate || (this.config.nolc && !this.IM)) ? + cmt.cobj.path : this.config.path; + if(this.config.nolc && !this.IM) + this.config.domain = cmt.cobj.domain; + this.moderationCommentsListUpdate(cid); + var idlist = [{'id': cid, 'p': path}]; + switch(approvalMode) { + case 'message': + if (!this.inlineModeration) { + this.preHandlerDelete(cmt); + } + if(oldStatus == 'S') { + this.groupModerationRequest(approvalMode, + {'spam': idlist, 'appr': [], 'del': []}); + cmt.cobj.action = 'unban'; + } else if(oldStatus == 'O') { + this.groupModerationRequest(approvalMode, + {'spam': [], 'appr': idlist, 'del': []}); + } else { + this.groupModerationRequest(approvalMode, + {'spam': [], 'appr': [], 'del': idlist}); + } + if (this.inlineModeration) this.postHandlerModerate(cid); + break; + case 'user': + if (!this.inlineModeration) { + this.preHandlerDelete(cmt); + } + this.groupModerationRequest(approvalMode, idlist, + (oldStatus == 'S' ? {'junk': 'no'} : {})); + if (this.inlineModeration) this.postHandlerModerate(cid); + break; + case 'delete': + this.preHandlerDelete(cmt); + this.groupModerationRequest(approvalMode, idlist); + break; + case 'block_by_action': + this.preHandlerDelete(cmt); + this.groupModerationRequest('block' + action, idlist); + cmt.cobj.action = 'ban'; + break; + case 'unban': + if (!this.inlineModeration) { + this.preHandlerDelete(cmt); + } + this.groupModerationRequest(approvalMode, idlist); + cmt.cobj.action = 'ban'; + if (this.inlineModeration) this.postHandlerModerate(cid); + break; + case 'spam': + this.groupModerationRequest(approvalMode, idlist); + setTimeout(function() { // screen del + s.removeComment(cmt, true); + }, 1000); + break; + case 'ignore': + /* Just delete from screen */ + default: + this.removeComment(cmt, true); + } +} + +JSCC.prototype.preHandlerDelete = function(cmt) { + this.publishEvent('comment-deleting', {'cmtId': cmt.cobj.ID}); +} + +JSCC.prototype.postHandlerDelete = function(cmt) { + this.publishEvent('comment-deleted', {'cmtId': cmt.cobj.ID}); +} + +JSCC.prototype.removeComment = function(cmt, useRecursion) { + var cobj = cmt.cobj; + var deletedPageIdx = this.jspg.getPageByItemId(cobj.ID); + if(cobj.ParentID && this.objById[cobj.ParentID]) { + var prn = this.objById[cobj.ParentID]; + this.jspg.invalidateItemView(cobj.ParentID); + var parentPageIdx = this.jspg.getPageByItemId(cobj.ParentID); + this.jspg.invalidatePagesView(parentPageIdx, deletedPageIdx-parentPageIdx); + } else { + if(deletedPageIdx && cobj.ParentID) this.jspg.invalidatePagesView(deletedPageIdx-1, 1); + } + if(cobj.cedge) { + var curItemIdx = this.jspg.getItemIdxById(cobj.ID); + if((cobj.cedge==1 && !this.IM && typeof curItemIdx!='undefined') || (cobj.cedge==2 && typeof curItemIdx!='undefined')) { + var itemIdxD = cobj.cedge==1 ? 1 : -1; + var items = this.jspg.getItems(curItemIdx+itemIdxD, 1); + if(items.length && items[0]) items[0].obj.cedge += cobj.cedge; + } + } + var self = this; + var deletedComment = function(dobj) { + return (dobj.status=='D' || dobj.status=='DT'); + } + var delCount = deletedComment(cobj) ? 0 : 1; + if(this.IM) { + var cnt = 0; + var deletedPageItems = this.jspg.getPageItems(deletedPageIdx); + JSKitLib.fmap(deletedPageItems, function(V){ + if(!deletedComment(V.obj) && V.obj.conversation==cobj.conversation) cnt++; + }); + if(cnt>1) { + if(cmt.cobj.hasCnvs) { + cmt.cobj.status = 'DT'; + this.jspg.invalidateItemView(cobj.ID); + } else { + this.jspg.deleteItem(cmt.cobj.ID); + } + } else if(cnt<=1){ + JSKitLib.fmap(deletedPageItems, function(V){ + if(V.obj.conversation==cobj.conversation) self.jspg.deleteItem(V.obj.ID); + }); + } + } else { + delCount = this.jspg.deleteItem(cobj.ID); + this.reCalcPages(); + } + this.ctag = null; + var pageNo = this.curPage; + this.curPage = 0; + this.displayPage(pageNo, function(immed){ + if(immed) { + if(useRecursion && this.jspg.getItemById(cmt.cobj.ID)) { + self.removeComment(cmt); + } + } + }); + return delCount; +} + +JSCC.prototype.postHandlerModerate = function(cid) { + var cmt = this.jspg.getItemById(cid).div; + cmt.cobj.status = 'A'; + this.jspg.invalidateItemView(cid); + var pageNo = this.curPage; + this.curPage = 0; + this.displayPage(pageNo); +} + +JSCC.prototype.createCommentAsHTML = function(obj) { + if(obj.status == 'D') return ''; + if(this.objppc) this.objppc(obj); + return this.tmpl(this.dtComment, obj); +} + +JSCC.prototype.getUserProperty = function(name, defaultValue) { + return JSKitEPB.getValue(name) || this.TC && this.TC["js-Cmt" + name] && !JHI2.isEmpty(this.TC["js-Cmt" + name]) && this.TC["js-Cmt" + name].value || defaultValue; +} + +JSCC.prototype.markOffensive = function(cid) { + if(confirm($JCL("isJunkVote"))) { + if ((this.adminMode) && (!this.inlineModeration)) { + this.cmtDelete(cid); + } else { + var item = this.jspg.getItemById(cid); + if(!item) return; + var obj = item.obj; + var req = { + 'id': cid, + 'permalink': this.config.permalink, + 'Text': obj.Text || + (obj.content ? obj.content.title : ''), + 'Name': this.getUserProperty("Name", $JCL("guest")) + }; + this.server('-mark.off', req); + } + } +} + +JSCC.prototype.getLikeInstanceByID = function(cid){ + var comment = this.jspg.getItemById(cid); + return comment.obj.likeInstance; +} + +JSCC.prototype.postLikeVote = function(cid, obj) { + var voter = { + "name" : this.getUserProperty("Name", "") + }; + var avatar = this.avatarsManager.getActiveAvatar(); + if (avatar) { + voter.avatar = avatar.name; + voter.avatar_width = avatar.width; + voter.avatar_height = avatar.height; + } + var likeInstance = this.getLikeInstanceByID(cid); + if (likeInstance.busy) return; + likeInstance.busy = true; + likeInstance.renderLikeControl("progress"); + likeInstance.sendRequest(voter); +} + +JSCC.prototype.handleLikeResponse = function(cid, action, data){ + this.routeAction(function() { + this.serverOptions.profile = data.profile; + var likeInstance = this.getLikeInstanceByID(cid); + likeInstance.busy = false; + likeInstance.vote(action, data); + }); +} + +JSCC.prototype.showProfile = function(target, data, extraConfig) { + if (data.ProfileURL && !data.profile) { + window.open(data.ProfileURL); + return; + } + var s = this; + var so = s.serverOptions; + if (!data.profile || (data.profile != so.profile && !so.showProfile) || $JSKitGlobal.isProfileLoaded == "no") return; + var applyFollowPanelsCallback = function(func) { + JSKitLib.fmap([s.followPanel, s.followPanelPopup], function(panel) { + if (panel) func(panel); + }); + }; + var config = JSKitLib.foldl({ + "parentTarget" : s.target, + "targetRef" : JSKitLib.getRef(s), + "whiteLabel" : so.whitelabel, + "callbacks" : { + "onsave" : function(profile) { + s.extraFormFields["Email"] = profile.getEmail() || ""; + var email = s.extraFormFields["Email"] || $JCL("follow_emptyEmail"); + applyFollowPanelsCallback(function(panel) { + var link = panel.get("emailAddress"); + var action = s.extraFormFields["Email"] ? "remove" : "add"; + JSKitLib.text(email, link, true); + JSKitLib[action + "Class"](link, + "js-kit-follow-activeNotifyMode-" + so.notifyMode); + }); + }, + "onload" : function(profile) { + if (profile.isYours()) so.profile = profile.getProfileID(); + applyFollowPanelsCallback(function(panel) { + var link = panel.get("editProfileLink"); + JSKitLib.text($JCL("follow_editProfile"), link, true); + JSKitLib.removeClass(link, "js-kit-follow-openingProfile"); + JSKitLib.addClass(panel.get("rssThreadButton"), "js-kit-follow-rssButton"); + }); + } + } + }, extraConfig || {}, function(value, acc, key) { acc[key] = value; }); + if (!$JSKitGlobal.profileObjectInitialized) { + $JSKitGlobal.isProfileLoaded = "no"; + JSKitLib.addScript(s.uriDomain + "/widgets/profile.js", target, function() { + $JSKitGlobal.isProfileLoaded = "yes"; + JSKW$openProfile(data.profile, target, config); + }); + } else JSKW$openProfile(data.profile, target, config); +} + +JSCC.prototype.appendProfileHandler = function(target, data) { + var self = this; + var isAvailable = this.serverOptions.showProfile && (data.profile || data.ProfileURL); + var avatarDims = {"width": "48", "height": "48"}; + var openProfile = function(element) { + JSKitLib.addEventHandler(element, ["click"], function(e) { + JSKitLib.stopEventPropagation(e); + JSKitLib.preventDefaultEvent(e); + self.showProfile(target, data); + return false; + }); + }; + JSKitLib.addClass(target, "js-kit-clickable"); + if (this.IM || this.getSkin() != "echo") return openProfile(target); + if (data.event_publisher) { + data.Name = data.content.user.name + } + var descr = { + "avatar": function(element) { + var container = { + "instance": element, + "width": avatarDims.width, + "height": avatarDims.height + }; + self.appendAvatarImage(container, data); + if (isAvailable) openProfile(element); + } + }; + if (isAvailable) descr.name = descr.viewDetails = function(element) { openProfile(element); }; + var config = { + "labels": $JCL, + "uriDomain": self.uriDomain, + "uriAvatar": self.uriAvatar, + "avatarSize": avatarDims, + "cssPrefix": "js-kit-singleCmtMiniProfile js-kit-singleCmtProfile" + (isAvailable ? "Enabled" : "Disabled"), + "descriptors": descr, + "openFullProfile": function() { self.showProfile(target, data); }, + "isNativeProfileDisabled": !isAvailable + }; + + eval("var wp = " + JSKitLib.htmlUnquote((data.Webpresence || "[]"))); + var webpresence = JSKitLib.fmap(wp, function(item) { + if (!item[2] || item[2] == "checked") { + var type = item[0].replace(/login-/, ""); + var group = item[0].match(/login-/) ? "login" : "web"; + if (group == "web" && !self.serverOptions.extraFieldURL) return; + var identity = self.jskauth.assembleIdentity(item[1], type, group); + if (type == "gfc" && self.jskauth.getAuthIdentity("gfc")) { + identity.url = item[1]; + identity.params.domain = self.config.domain; + } + return identity; + } + }); + var url = data.Url ? [self.jskauth.assembleIdentity(data.Url, "home", "web")] : []; + data.identities = {"auth": {}, "web": JSKitLib.merge(webpresence, url)}; + + var clearTimer = function(timer) { + clearTimeout(timer); + timer = undefined; + }; + var openMiniProfile = function(ttl) { + clearTimer(self.miniProfileCollapseTimer); + self.miniProfileExpandTimer = setTimeout(function() { + if (data.miniProfile) { + data.miniProfile.display(target); + } else { + data.miniProfile = new JSKitMiniProfile(target, data, config); + } + data.miniProfile.getContent().onmouseover = function() { + clearTimer(self.miniProfileCollapseTimer); + }; + }, ttl); + }; + target.onclick = function() { openMiniProfile(0); } + target.onmouseover = function() { openMiniProfile(JSCC.MINI_PROFILE_TTL); } + target.onmouseout = function() { + clearTimer(self.miniProfileExpandTimer); + self.miniProfileCollapseTimer = setTimeout(function() { + JSKW$Events.syncBroadcast("miniProfile_collapseAll"); + }, JSCC.MINI_PROFILE_TTL); + }; +} + +JSCC.prototype.fixComment = function(cmt, obj, pageIdx, globalIdx, itemsOnPage) { + var self = this; + if (obj.profile == this.serverOptions.profile) obj.yours = true; + var so = this.serverOptions; + var cfg = this.config; + var typeCondition = obj.msgtype && obj.msgtype.match(/T|P/) && !so.trackbackreply; + var flagCondition = !so.commod || obj.yours || cfg.nolc || typeCondition; + var anonymous = so.anonymousCmt && !self.jskauth.isLogged(); + + self.objById[obj.ID] = obj; + if(obj.status == 'D') { + cmt.style.display = 'none'; + return; + } + + if(obj.depth) { + cmt.style.marginLeft = this.level4margin(obj.depth) + } else { + obj.depth = 0; + } + + var ctls = JSKitLib.mapClass2Object({}, cmt); + cmt.ctls = ctls; + cmt.cobj = obj; + var imgArea = cmt.ctls["js-singleCommentPreviewImage"]; + if (imgArea && cmt.cobj.imgs && cmt.cobj.imgs.length && self.config.uploadImages){ + self.addChild(imgArea,self.createImages(cmt.cobj.imgs)); + imgArea.style.display = "block"; + } + + var jsc = function(t){return ctls['js-singleComment'+t]} + + var switchClasses = function(controls, class2add, class2remove) { + JSKitLib.fmap(controls, function(element) { + JSKitLib.addClass(element, class2add); + JSKitLib.removeClass(element, class2remove); + }); + }; + + var appendHoverActions = function(controls){ + var container = jsc(""); + if (!container || self.getSkin() != "echo") return; + JSKitLib.addEventHandler(container, ["mouseout"], function() { + switchClasses(controls, "jsk-SecondaryFontColor", "jsk-LinkColor"); + }); + JSKitLib.addEventHandler(container, ["mouseover"], function() { + switchClasses(controls, "jsk-LinkColor", "jsk-SecondaryFontColor"); + }); + }; + + cmt.bg = jsc('Bg'); + var stripe = jsc('Body') || jsc(''); + stripe.className += " js-singleCommentDepth" + (obj.depth || 0); + if (this.useEcho()) { + if (obj.depth) { + stripe.className += " jsk-TrinaryBackgroundColor jsk-ItemWrapperChild"; + switchClasses([cmt.bg], 'jsk-TrinaryBackgroundColor', 'js-singleCommentBg'); + } else if (obj.thread && obj.thread.length) { + stripe.className += " jsk-ItemWrapperThread"; + } + } + if(!(cmt.style.display.match(/none/))){ + stripe.className += " js-comment-stripe-" + ((globalIdx % this.stripecount) + 1); + } + + if(self.IM && typeof(obj.conversation)=='number') { + if(obj.hasCnvs) { + this.appendConversation(cmt, obj.conversation); + } else { + this.appendConversationChild(cmt); + } + } + + /* Handle avatars */ + if(obj.status!='DT' && obj.status!='DD') self.placeAvatar(obj, jsc('Avatar')); + + /* Handle if ratings are present */ + if (obj.Rating > 0 && ( ! this.isStandalone()) ) { + var self = this; + var action = function() { + if (!jsc('Rating')) return; + jsc('Rating').appendChild(self.createMiniStarObject(obj.Rating, 10)); + jsc('Rating').appendChild(JSKitLib.html('
      ')); + JSKitLib.show(jsc('Rating')); + } + $JSKitGlobal.tryRatingsAppObjectAction(this.uniq, action); + } else { + if (jsc('Rating')) JSKitLib.hide(jsc('Rating')); + } + + var sa = jsc("Name"); + if(sa) { + self.rerenderName(cmt); + if(obj.admin) sa.className = sa.className + " js-siteAdmin"; + } + + var renderKarmaView = function(karma, container, value, voters) { + JSKitLib.text(karma.score, value, true); + JSKitLib.text(karma.votesText, voters, true); + JSKitLib.show(container, "inline"); + }; + var kS = jsc("KarmaScore"); + if(kS && obj.karma) { + var kVal = jsc("KarmaValue"); + var kVot = jsc("KarmaVoters"); + if(obj.karma.votes) renderKarmaView(obj.karma, kS, kVal, kVot); + var setKarmaAction = function(name, score) { + if (!jsc(name)) return; + JSKitLib.setEventHandler(jsc(name), ['click'], function() { + obj.karma.recomputeScore(score); + renderKarmaView(obj.karma, kS, kVal, kVot); + this.blur(); + }); + } + setKarmaAction("KarmaY", 1); + setKarmaAction("KarmaN", -1); + } + if(jsc("KarmaShow") && obj.karma && obj.yours && obj.karma.votes) { + renderKarmaView(obj.karma, jsc("KarmaShow"), jsc("KarmaValueShow"), jsc("KarmaVotersShow")); + } + if (so.likedBy && jsc("LikedBy")){ + var anonymousAvatar = self.avatarsManager.anonymousAvatarData(); + eval("var votersList = " + (obj.like || "[]") + ";"); + obj.likeInstance = new JSCCLike({ + "ID" : obj.ID, + "jx": self.jcaIndex, + "ref": JSKitLib.getRef(self), + "path": self.pathOverride, + "voters" : votersList, + "target" : jsc("LikedBy"), + "profile": function(){ return self.serverOptions.profile; }, + "translator" : $JCL, + "onInit" : function(){ + var expandMarker = this.getExpandMarker(); + if (expandMarker) appendHoverActions([expandMarker]); + }, + "onVoterInit" : function(target, data){ + var avatar = data.avatarData || anonymousAvatar; + data.avatar = avatar.name; + data.avatarWidth = avatar.width; + data.avatarHeight = avatar.height; + delete data.avatarData; + self.appendProfileHandler(target, data); + }, + "onVoterRender" : function(dom, data){ + self.avatarsManager.assembleAvatar({ + "instance": dom.get("avatar"), + "width": "16", + "height": "16" + }, data.avatar || anonymousAvatar); + }, + "likeControl": jsc("Like") + }); + } + + var functionsToBind = [ + ["Edit", "ShowCommentDialog", [{isEditing: true}]], + ["Flag", "markOffensive"], + ["Like", "postLikeVote"], + ["Reply", "ShowCommentDialog"], + ["Block", "cmtBlock"], + ["Delete", "cmtDelete"], + ["Approve", "cmtApprove"], + ["Moderate","cmtBlock"], + ["ComModMark", "markOffensive"], + ["ApproveUser", "cmtApproveUser"] + ]; + + JSKitLib.fmap(functionsToBind, function(list){ + (function(elementName, funcName, args) { + if (!jsc(elementName)) return; + args = args || []; + args.unshift(cmt.id); + JSKitLib.setEventHandler(jsc(elementName), ['click'], function(){ + self[funcName].apply(self, args); + }); + }).apply(self, list); + }); + + var elementVisibilityConditions = { + "IP" : !self.adminMode, + "Url" : obj.Url, + "Karma" : !this.scoringEnabled() || obj.yours || !obj.karma || typeCondition || cfg.nolc, + "ComMod" : flagCondition, + "LikedBy" : !so.likedBy, + "Editable" : cfg.editable != 'yes' || cfg.nolc || !(self.adminMode || self.ownerMode), + "Likeable" : !so.likedBy || anonymous, + "Flagable" : flagCondition, + "Deletable" : (!self.adminMode || !obj.event_type) && ((!obj.yours && !self.IM && !self.ownerMode) || (self.adminMode && !cfg.nolc)), + /* FIXME(?) Lev, this.serverOptions are not defined in moderation mode but the result is likely as desired, i.e. admin can still reply */ + "Replyable" : so.mmode == "pause" || !self.isSourceAvailable("Comments") || typeCondition || (cfg.nolc && (!self.IM || obj.yours)), + "Moderatable" : !self.adminMode || cfg.nolc, + "ApproveUser" : so.mmode != "onhold", + "ProfileLinkable" : !obj.profile || cfg.nolc + }; + JSKitLib.fmap(elementVisibilityConditions, function(flag, name){ + if (jsc(name) && flag) JSKitLib.hide(jsc(name)); + }); + + cmt.bg.style.zIndex = this.czidx - (pageIdx % this.czidx); + cmt.domINFO = jsc('INFO'); + cmt.domCtls = jsc('Ctls') || jsc('controls'); + + if(obj.status == 'S') + this.cmtSetSpamStatus(cmt, true); + + if(obj.status == 'O') + this.cmtSetOffensiveStatus(cmt, true); + + if(obj.admin) { + JSKitLib.addClass(cmt, "js-commentByAdmin"); + if(cfg.adminBgColor) { + cmt.style.backgroundColor = cfg.adminBgColor; + cmt.bg.style.backgroundColor = cfg.adminBgColor; + } + var star = jsc('AdminStar'); + if(star) JSKitLib.show(star, 'inline'); + } + + if(obj.status == 'DT') { + if(cmt.domINFO) JSKitLib.hide(cmt.domINFO); + if(cmt.domCtls) JSKitLib.hide(cmt.domCtls); + } + if(obj.status == 'DD') { + if(cmt.domCtls) JSKitLib.hide(cmt.domCtls); + this.placeProcessAvatar(jsc('Avatar')); + } + if(jsc("Checkbox")) { + var checkbox = jsc("Checkbox"); + var state = this.moderationCommentsList[obj.ID] ? "checked" : "unchecked"; + this.setInputState("checkbox", checkbox, state); + checkbox.onclick = function() { + var state = self.moderationCommentsList[obj.ID] ? "unchecked" : "checked"; + self.setInputState("checkbox", checkbox, state); + self.moderationCommentsListUpdate(obj.ID, state == "checked"); + }; + } + if(jsc("Menu")) { + if(!obj.menu) + obj.menu = self.addMenu(cmt, obj); + if(obj.menu) + jsc("Menu").appendChild(obj.menu); + } + if(jsc("ViaIcon")) JSKitLib.addPNG(jsc("ViaIcon"), obj.content.service.iconUrl); + var controls = JSKitLib.fmap(["Flag", "Like", "Reply", "Moderate", "Edit", "Delete", "ViaThirdPartyService"], function(name){ + var element = jsc(name); + if (element) return element; + }); + appendHoverActions(controls); +} + +JSCC.prototype.setInputState = function(type, element, state) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/common/" + type + "_" + state + ".png"); +} + +JSCC.prototype.level2margin = function(level) { + if(level < 20) return "10px"; + if(level < 40) return "4px"; + return "0px"; +} +JSCC.prototype.level4margin = function(level) { + switch (this.config.skin) { + case 'echo': + if(level > 1) level = 1; + return ((parseInt(this.maxAvatarDims.width) + 10) * level) + 'px'; + default: + if(level <= 20) return (10 * level) + 'px'; + if(level <= 40) return (200 + 4 * level) + 'px'; + return '280px'; + } +} +JSCC.prototype.cmtInDiv = function(div, obj, fincb) { + JSKW$Events.syncBroadcast("smileys-newCommentInDiv", obj); + if (!obj.isEditing) { + var cIdx, insBefore = false; + if(this.config.backwards == 'yes') { + var fitem = this.jspg.getFirstItem(); + if(fitem) { + cIdx = fitem.obj.ID; + insBefore = true; + } + } + if(this.config.thread != 'yes') { + obj.Notice = $JCL('commentMoveNotice'); + cIdx = obj.ParentID || cIdx; + delete obj.ParentID; + delete obj.depth; + } + if(this.useEcho()) { + cIdx = this.jspg.getPlaceIdxByTS(obj.TS); + insBefore = true; + } + obj.cedge = 3; + if(obj.ParentID) { + obj.cedge = 0; + var prn = this.objById[obj.ParentID]; + var td = (prn && prn.depth) ? prn.depth : 0; + if(prn) { + if (this.useEcho()) { + JSKitLib.addClass(this.jspg.getItemById(obj.ParentID).div, 'jsk-ItemWrapperThread'); + } + if(!obj.depth) { + prn.thread.push(obj); + obj.depth = 1 + td; + } + if(this.IM && typeof(prn.conversation)=='number') obj.conversation = prn.conversation; + cIdx = this.getLastReply(obj.ParentID).obj.ID; + insBefore = false; + var curItem = this.jspg.getItemById(cIdx); + if(curItem && curItem.obj.cedge>1) { + obj.cedge = 2; + curItem.obj.cedge -= 2; + var parentPageIdx = this.jspg.getPageByItemId(obj.ParentID); + var insertedPageIdx = this.jspg.getPageByItemId(cIdx); + this.jspg.invalidatePagesView(parentPageIdx, insertedPageIdx-parentPageIdx+1); + } + } + } + + if(this.IM) { + for(var i=0; i 0) { + cmt.cobj.height += cmtHeight; + cmt.style.height = cmt.cobj.height + 'px'; + return true; + } else if (cmt.cobj.cntBorderPause == 8) { + cmt.style.overflow = ""; + cmt.style.height = ""; + cmt.cobj.height = -1; + cmt.cobj.cntBorderPause--; + return true; + } else if (cmt.cobj.cntBorderPause > 0) { + cmt.cobj.cntBorderPause--; + return true; + } else if (cmt.cobj.cntBorderUp < 256) { + cmt.cobj.cntBorderUp += 10; + var blue = cmt.cobj.cntBorderUp; + bg.style.backgroundColor = "rgb(256, 256, " + (blue > 256 ? 256 : blue) + ")"; + return true; + } else { + self.setOpacity(bg, 1); + bg.style.backgroundColor = ""; + delete cmt.cobj.echoItemFirstTime; + return false; + } + } + var oldEffectStep = function(cmt) { + if (cmt.cobj.cntDown > 0) { + self.setOpacity(bg, calcOpacity()); + return true; + } else { + bg.style.backgroundColor = ""; + self.setOpacity(bg, 1); + return false; + } + } + cmt.cobj.cntDown -= cmt.cobj.cntMode ? decr.f : decr.s; + return cmt.cobj.echoItemFirstTime ? echoEffectStep(cmt) : oldEffectStep(cmt); + } + + var runStep = function() { + obj.intvl = setTimeout(function() { + var nextStep = effectStep(cmt); + if (nextStep) runStep(); + else { + obj.intvl = null; + delete obj.havingEffect; + } + }, 50); + }; + runStep(); +} + +JSCC.prototype.foldInputFields = function(e, acc, f) { + if(e.getAttribute) { + var name = e.getAttribute('NAME'); + if(name && (name.substr(0, 6) == 'js-Cmt')) { + var shortName = name.substr(6); + acc = f.call(this, e, acc, shortName) || acc; + } + } + var cn = e.childNodes; + if(cn) { + var clen = cn.length; + for(var i = 0; i < clen; i++) + acc = this.foldInputFields(cn[i], acc, f); + } + return acc; +} + +JSCC.prototype.inputFieldsMsg = function(ctl, cmtObj, pText) { + return this.foldInputFields(ctl, [], function(e, a, name){ + if (e.jsk$not_specified || JHI2.isEmpty(e)) return; + var isText = /^Text(Edit)?$/.test(name); + var text = isText ? pText : e.value; + a.push({"Name": "js-Cmt" + name, "Value": text}); + if(isText && this.serverOptions.htmlMode) + text = text.replace(/<[\/]?[a-z]{1,3}(\s+(href)=[^>]+)?>/g, ''); + //text = text.replace(/&/g, '&').replace(//g, '>'); + cmtObj[name] = text; + }); +} + +JSCC.prototype.cmtAvatarPlaceWidth = function(cobj) { + return cobj.ParentID ? this.maxAvatarDims.width/2 : this.maxAvatarDims.width; +} + +JSCC.prototype.cmtInPlace = function(cobj, fincb) { + var div = this.TC["js-OldComments"]; + cobj.Name = cobj.Name || $JCL("guest"); + this.cmtInDiv(div, cobj, function(cmt) { + if(cmt) this.flash(cmt); + if(fincb) fincb.apply(this, [cmt]); + }); +} + +JSCC.prototype.ShowCommentDialog = function(msgId, extra) { + if(this.commentPostingProcess) { + alert($JCL('messagePostingInProgress')); + return; + } + var s = this; + msgId = msgId || ''; + this.forMsg = this.objById[msgId]; + + /* Remove dialog from sight */ + this.CommentCancelled(); + + extra = extra || {}; + if (s.getSkin() == "echo") { + if (this.TC["js-CmtText"] && (this.jskauth.isLogged() || !this.anonymousCmt)) { + var hint = $JCL("defaultCommentText"); + var input = s.TC["js-CmtText"]; + if (s.serverOptions.wysiwyg) { + hint = '' + hint + ''; + input.hint = hint; + input.value = hint; + } else { + JHI2.remove(input); + JHI2.create(hint, input); + } + } + JSKitLib.fmap(s.serverOptions.wysiwyg ? [] : ["js-CmtText", "js-CmtTextEdit", "jsk-CommentFormBody", "jsk-CommentEditFormBody"], function(name) { + if (s.TC[name]) JSKitLib.addClass(s.TC[name], name + "-noWYSIWYG"); + }); + } + + var isReply = !!msgId; + var cct = this.TC["js-LeaveComment"]; + + if (!this.getSkin().match(/smoothgray|echo/)) this.onAddImgButton(this.imgShow); + + var ccd = this.TC[extra.isEditing ? "js-EditComment" : "js-CreateComment"]; + if (extra.isEditing) { + isReply = false; + var cte = this.TC['js-CmtTextEdit']; + if (this.forMsg.originalText) { + cte.value = this.forMsg.originalText; + } else { + cte.value = this.forMsg.Text.replace(/<\/wbr>/g, ''); + if (!this.serverOptions.wysiwyg) { + cte.value = JSKitLib.htmlUnquote(cte.value); + JSKW$Events.syncBroadcast("smileys-beforePostNewComment", cte); + } + } + } + this.replyForId = (isReply ? msgId : ''); + + var placeDialog = function(immediate, apl) { + if (!apl) apl = [this.TC["js-CommentsArea"], this.TC["js-CommentsArea"].firstChild]; + if(msgId){ + apl[0].insertBefore(ccd, apl[1]); + } else if (this.config.backwards == 'yes') { + apl[0].insertBefore(ccd, this.TC['js-WelcomePanel'] ? apl[1].nextSibling : apl[1]); + } else { + this.addChild(apl[0], ccd); + } + if (extra.isEditing) JSKitLib.hide(apl[1]); + + if(this.config.backwards == 'yes' && msgId) + cct.style.visibility = "hidden"; + else + cct.style.display = "none"; + ccd.style.display = "block"; + try { + var name_suffix = (extra.isEditing ? 'Edit' : ''); + var text = this.TC["js-CmtText" + name_suffix]; + /* TinyMCE support (A) */ + if(!text.id) text.id = "js-CmtText" + name_suffix + "-" + this.jcaIndex; + if(!text.richEditor && this.serverOptions.wysiwyg) try { + text.smoothWysiwygLoading = (s.getSkin() == 'echo' && !extra.isEditing); + if (text.smoothWysiwygLoading) { + if (!text.jsk$cover) { + text.jsk$cover = JSKitLib.html('
      '); + text.jsk$wrapper = s.TC['jsk-CommentFormBody']; + } + text.jsk$wrapper.parentNode.replaceChild(text.jsk$cover, text.jsk$wrapper); + JSKitLib.hide(text.jsk$wrapper); + text.jsk$cover.parentNode.insertBefore(text.jsk$wrapper, text.jsk$cover); + } + var addMCECtrl = function(){ + text.jsk$nofocus = extra.nofocus; + text.jsk$widget = s; + if(s.tmce.foreign) tinyMCE.settings = s.tmce.cfg; + tinyMCE.settings.auto_focus = (extra.nofocus ? null : text.id); + text.jsk$hasDefaultValue = (s.getSkin() == 'echo' && !extra.isEditing); + if (text.jsk$hasDefaultValue) { + var re = new RegExp('(

      )?' + text.hint + '(

      )?'); + text.defaultRemoved = !text.value.match(re); + } + tinyMCE.execCommand('mceAddControl', false, text.id); + text.richEditor = true; + if(text.mceLoadedCtx) { + JSKW$Events.invalidateContext(text.mceLoadedCtx); + text.mceLoadedCtx = null; + } + } + if(window.tinyMCE) { + if(tinyMCE.getInstanceById(text.id) == null) { + setTimeout(function() { addMCECtrl(); }, 0); + } + } else text.mceLoadedCtx = JSKW$Events.registerEventCallback(undefined, addMCECtrl, "mceLoaded"); + } catch(e) {} + + var sub = this.TC["js-Cmtsubmit" + name_suffix]; + var can = this.TC["js-Cmtcancel" + name_suffix]; + var prev = function(e){JSKitLib.stopEventPropagation(e); JSKitLib.preventDefaultEvent(e); return false;} + + if(JSKitLib.isOpera()) { + var onkey = function(){}; + } else if(JSKitLib.isIE()) { + var onkey = function(d,f){d.onkeydown=f}; + } else { + var onkey = function(d,f){d.onkeypress=f}; + } + + /* combined ratings */ + var commentRatingElements = JSKitLib.getElementsByClass(ccd, "js-commentRatingDisplay"); + var commentRatingDisplay = 'none'; + this.submitRating = false; + if (this.hasRatingsAppObject() && ( ! isReply)) { + if (this.TC["js-commentFieldRating"]) { + this.embedRatingsAppObject(this.TC["js-commentFieldRating"]); + commentRatingDisplay = ''; + this.submitRating = true; + } + } + for (var i=0; i < commentRatingElements.length; i++) { + commentRatingElements[i].style.display = commentRatingDisplay; + } + + + var flds = this.foldInputFields(ccd, [], + function(e, a, name) { + var dfl = this.fieldDfl[name]; + if(dfl) { + if(e.jsk$setdfl) + e.jsk$setdfl(dfl); + else if(!e.value) + e.value = dfl; + } + var aclen = a.length; + if(e.richEditor) { + if (e.value) { + e.value = e.value.replace(/^\n\n+/, ''); + if(!e.value.match(/^

      (\n|.)*<\/p>$/)) e.value = '

      ' + e.value + '

      '; + } + var o = { focus: function() { + var setupFocusing = function(ed) { + var keyHandler = function(ed, e) { + if(e.keyCode != 9) return true; + window.focus(); + try { + a[aclen+(e.shiftKey?-1:1)].focus(); + } catch(ex) { ; } + return prev(e); + }; + if (JSKitLib.isIE()) ed.onKeyDown.add(keyHandler); else ed.onKeyPress.add(keyHandler); + } + var ed = tinyMCE.getInstanceById(text.id); + if(ed) { + setupFocusing(ed); + } else { + var t = setInterval(function() { + var ed = tinyMCE.getInstanceById(text.id); + if(ed) { clearInterval(t); setupFocusing(ed); } + }, 100); + } + } }; + if(aclen) onkey(a[aclen-1], function(e) { + e = e || window.event; + if(e.keyCode == 9 && !e.shiftKey) { + this.blur(); + o.focus(); + return prev(e); + } + }); + a.push(o); + } else { + a.push(e); + } + }); + + var okd = function(offset) { return function(e) { + e = e || window.event; + if(e.keyCode != 9) return true; + this.blur(); + flds[offset+(e.shiftKey?(flds.length-2):0)].focus(); + return prev(e); + } } + + onkey(flds[flds.length-1], okd(0)); + onkey(flds[0], okd(1)); + + // Place initial focus. + if(!extra.nofocus) { + for(var i = 0; i < flds.length; i++) + if(!flds[i].value || flds[i].type == 'submit') { + flds[i].focus(); + break; + } + if (s.config.backwards != 'yes') + sub.scrollIntoView(false); + } + } catch(e) { } + }; + if(!msgId) { + placeDialog.apply(this,[true]); + } else { + var id = this.useReplyThreadsCollapsing() || extra.isEditing ? + msgId : this.getLastReply(msgId).obj.ID; + var pn = this.jspg.getPageByItemId(id); + var item = this.jspg.getItemById(id); + item.obj.isEditing = extra.isEditing; + this.displayPage(pn+1, function(immed) { + if (!immed) return; + if (!s.useEcho()) item = s.jspg.getItemById(id); + var placement = [item.div.parentNode, item.div.nextSibling]; + if (extra.isEditing) { + s.editingCmt = item.div.ctls['js-singleCommentText']; + placement = [s.editingCmt.parentNode, s.editingCmt]; + } + placeDialog.apply(s, [true, placement]); + }); + s.setStreamState(true, true); + } + var pb = this.TC["js-poweredBy-echo"] || this.TC["js-poweredByJSKit"]; + if (this.serverOptions.whitelabel && pb) JSKitLib.hide(pb); + + if (s.getSkin() != 'echo') { + var oiddiv = s.TC['js-logoutSpan']; + if (oiddiv) oiddiv.style.display = s.jskauth.isLogged() ? 'inline' : 'none'; + s.jskauth.drawSelector(s.TC['js-authSelector']); + s.setThirdPartyShare(); + s.setNameFieldValue(); + } + return false; +} + +JSCC.prototype.CommentCancelled = function() { + if(this.tmce && (this.serverOptions.media || this.serverOptions.smiley)) + this.tmce.cfg.closePopups(); + var cct = this.TC["js-LeaveComment"]; + var ccd = [this.TC["js-EditComment"], this.TC["js-CreateComment"]]; + if (cct) { + cct.style.visibility = ""; + cct.style.display = ""; + } + var name_suffix = (this.editingCmt ? 'Edit' : ''); + var text = this.TC["js-CmtText" + name_suffix]; + if(text && text.richEditor) { + try { + if (!this.anonymousCmt) { + tinyMCE.triggerSave(false, false); + } + var v = text.value; + tinyMCE.execCommand('mceRemoveControl', false, text.id); //tmce set value from its internal property + text.value = v; + } catch(e) { ; }; + text.richEditor = false; + if(text.mceLoadedCtx) { + JSKW$Events.invalidateContext(text.mceLoadedCtx); + text.mceLoadedCtx = null; + } + } + var s = this; + JSKitLib.fmap(ccd, function(el, i){ + el && el.parentNode && el.parentNode.removeChild(el); + }); + if (this.editingCmt) { + JSKitLib.show(this.editingCmt); + delete this.editingCmt; + } + return false; +} + +JSCC.prototype.smileTag = function(smile) { + return '' + smile.title + ''; +} + +JSCC.prototype.textSmiles2Graphical = function(text, reverse) { + var s = this; + if(window.tinyMCE) tinyMCE.settings.smiley = false; + var flag = true; + var orig = text; + JSKitLib.fmap(s.smiles, function(el, i){ + text = reverse ? text.replace(el.regexpTag, ' ' + i + ' ') : text.replace(el.regexpText, function($0, $1){return ($1 ? $0 : s.smileTag(el));}); + if(window.tinyMCE && flag && (text !== orig)) { + tinyMCE.settings.smiley = true; + flag = false; + } + }); + return text; +} + +JSCC.prototype.thirdPartyImport = function(KVLMsg) { + var s = this; + var text = JSKitLib.stripTags(KVLMsg['js-CmtText']); + var permalink = KVLMsg['permalink'] || s.config.permalink; + var reg = RegExp("^http(.)?://(.*?)/"); + var m = reg.exec(permalink); + var domain = (m && m.length>1) ? m[2] : s.config.domain; + var share_data = { + 'domain': domain, + 'permalink': permalink, + 'Text': text + }; + var createTargetDiv = function() { + var tgt = 'div-sharing-' + Math.random(); + var div = JSKitLib.html(''); + s.target.appendChild(div); + return tgt; + } + var facebook = s.jskauth.getAuthIdentity("facebook"); + if(facebook && KVLMsg['js-CmtShare-facebook']=='on') { + var jsk$fb = new JSKitFBSDK( + JSKitLib.getRef(s), + facebook.params.app_id, + facebook.params.xd_receiver, + function() { + this.shareComment(s.serverOptions.whitelabel); + }, + undefined, + share_data); + } + var gfc = s.jskauth.getAuthIdentity("gfc"); + if(gfc && gfc.params.site && KVLMsg['js-CmtShare-gfc']=='on') { + var jsk$gfc = new JSKitGFC( + JSKitLib.getRef(s), + createTargetDiv(), + gfc.params.site, + function(){ + this.sharedata = share_data; + this.shareComment(); + }); + } +} + +JSCC.prototype.appendFormFields = function(fields, tmpObj) { + var self = this; + var formFields = this.getKVListFromMsg(fields); + var extraFields = JSKitLib.foldl({}, this.extraFormFields, function(value, acc, name) { + if (name != "Email" || self.getSkin() != "echo") acc["js-Cmt" + name] = value; + }); + var mergedFields = JSKitLib.foldl(extraFields, formFields, function(value, acc, name) { acc[name] = value; }); + return JSKitLib.fmap(mergedFields, function(value, name) { + tmpObj[name.replace("js-Cmt", "")] = value; + return {"Name": name, "Value": value}; + }); +} + +JSCC.prototype.CommentSubmitted = function() { + var s = this; + var prn = this.forMsg; + var isEditing = prn && prn.isEditing; + + if(!isEditing && this.serverOptions.requireUsername && this.TC["js-CmtName"] && JHI2.isEmpty(this.TC["js-CmtName"])) { + alert($JCL('nicknameRequired')); + s.TC["js-CmtName"].focus(); + return; + } + + /* TinyMCE support (B) */ + var name_suffix = (isEditing ? 'Edit' : ''); + var text = this.TC["js-CmtText" + name_suffix]; + var textValue; + if(text.richEditor) { + tinyMCE.triggerSave(false, false); + JSKW$Events.syncBroadcast("smileys-beforePostNewComment", text); + textValue = String(text.value). + replace(/(<\/p>)[\r\n]+(

      )/g, '$1$2'). + replace(/(

      ) (<\/p>)/g, '$1$2'). + replace(/

      /g, '\n').replace(/<\/p>/g, '').replace(//g, '\n'). + replace(/^\n/, ''); + } else { + textValue = String(text.value).replace(/&/g, '&'); + } + + var textMsg = (this.getSkin() != "echo" || !JHI2.isEmpty(text)) ? encodeURIComponent(textValue) : ""; + if(!textMsg || !textMsg.length) { + alert($JCL("tooShort")); + return; + } + + var mcl = this.serverOptions.maxCommentLength || 3000; + if(text.value.length > mcl) { + alert($JCL("tooLong",{"maxCommentLength":mcl})); + return; + } + + var form = this.TC[isEditing ? "js-EditComment" : "js-CreateComment"]; + var avt = this.avatarsManager.getActiveAvatar() || 'no'; + var permalink = this.config.permalink; + var moderate = this.config.moderate; + + var tmpObj = {yours:true}; + if(prn) { + if (isEditing) { + tmpObj.ID = prn.ID; + } else { + tmpObj.ParentID = prn.ID; + } + tmpObj.path = prn.path; + if(prn.permalink) { + tmpObj.permalink = prn.permalink; + permalink = prn.permalink; + } + } + + if (this.getSkin() == "echo" && this.extraFormFields["Url"] && this.jskauth.isLogged()) { + this.extraFormFields["Url"] = ""; + } + this.extraFormFields["Name"] = this.getUserProperty("Name", ""); + this.extraFormFields["Email"] = this.getUserProperty("Email", ""); + this.extraFormFields["Webpresence"] = this.getSelectedIdentities(); + + var message = this.appendFormFields(this.inputFieldsMsg(form, tmpObj, textValue), tmpObj); + if (this.getSkin() == "echo") { + message.push({'Name': 'js-CmtNotifyMode', 'Value': s.serverOptions.notifyMode}); + } + + tmpObj["Name"] = tmpObj["Name"] || $JCL("guest"); + + /* combined ratings */ + if (this.submitRating) { + rating = this.getRatingsAppObject().userRating; + message.push({'Name': 'js-CmtRating', 'Value': rating}); + tmpObj.Rating = rating; + } + if(prn && !isEditing) { + message.push({'Name': 'js-CmtParentID', 'Value': prn.ID}); + if(this.IM=='own' && prn.profile) { + message.push({'Name': 'destProfile', 'Value': prn.profile}); + } + } + if(permalink) message.push({'Name': 'permalink', 'Value': permalink}); + if (!isEditing) { + if(avt) message.push({'Name': 'avatar', 'Value': (avt.name ? avt.name : avt)}); + } else { + tmpObj.isEditing = true; + } + + if(moderate) this.pathOverride = this.forMsg.path; + + var onsuccess = function(cmtObj) { + var KVLCmt = s.getKVListFromMsg(message); + // API: subscriber expects + // (ConstructedMessageObject[, FormDOM]) + try { + JSKitAPI.askpublic.call(s, "comment-submit", + s.generateEventParams(KVLCmt), form); + } catch(e) { + return; + } + s.CommentCancelled(); + if (s.TC['js-CmtText' + name_suffix]) { + s.TC['js-CmtText' + name_suffix].value = ''; + } + if (s.clearImgs) { + s.clearImgs(); + } + if (!isEditing) { + s.thirdPartyImport(KVLCmt); + } + if (s.extraControlsMenu) { + s.extraControlsMenu.collapseTabs(); + } + var am = s.avatarsManagement; + if (am && am.avatarsListContainer) { + JSKitLib.hide(am.avatarsListContainer); + } + delete s.replyForId; + } + var onerror = function() { + var cover = s.commentPostingProcess.cover; + if (cover) { + JSKitLib.text($JCL('messagePostFailed'), cover.get("Label"), true); + cover.get("Img").src = "//cdn.js-kit.com/images/warning.gif"; + JSKitLib.show(cover.get("Retry"), "inline"); + } else { + alert($JCL("messagePostFailed")); + s.setStateLCF("enable"); + } + } + this.postComment(tmpObj, message, { + 'onsuccess': onsuccess, + 'onerror': onerror + }); +} + +JSCC.prototype.prepareCommentObj = function(tmpObj) { + var cobj = JSKitLib.cloneObject(tmpObj); + if(cobj.isEditing) { + cobj.Text = cobj.TextEdit; + delete cobj.TextEdit; + } else if (cobj.echoItem) { + cobj.extra = {}; + cobj.thread = []; + } else { + this.tmpID++; + cobj.ID = "jst-" + this.tmpID; + cobj.status = 'A'; + cobj.profile = this.serverOptions.profile; + var avatar = this.avatarsManager.getActiveAvatar(); + if (avatar) { + cobj.avatar = avatar.name; + cobj.avatarWidth = avatar.width; + cobj.avatarHeight = avatar.height; + } + cobj.avatarPlaceWidth = this.cmtAvatarPlaceWidth(cobj); + cobj.extra = {}; + cobj.thread = []; + cobj.depth = 0; + cobj.admin = this.adminMode; + var d = new Date(); + cobj.TS = Math.round(d.valueOf() / 1000) + (this.serverDiffTS || 0); + } + cobj.jcaIndex = this.jcaIndex; + return cobj; +} + +JSCC.prototype.postComment = function(tmpObj, tmpMsg, options) { + var s = this; + var cmtObj = JSKitLib.cloneObject(tmpObj); + if (s.useEcho()) { + cmtObj.echoItemFirstTime = true; + } + if(s.images) cmtObj.imgs = s.images; + var msg = JSKitLib.fmap(tmpMsg, function(e){ return e; }); + + if(cmtObj.ParentID && !this.objById[cmtObj.ParentID]) { + this.invalidateJSPG(); + if(options && options.onerror) options.onerror(); + return; + } + + cmtObj = this.prepareCommentObj(cmtObj); + /* Kick in message submission */ + msg.push({'Name': 'tid', 'Value': cmtObj.ID}); + s.prepareImgData(msg); + var src = (cmtObj.isEditing ? '.edit' : '.put'); + var prms = this.getKVListFromMsg(msg); + s.commentPostingProcess = { + attempts: 1, + attemptsMax: 3, + cmtObj: cmtObj, + start: function(){ + s.commentPostingProcess.timer = setTimeout(function(){ + var p = s.commentPostingProcess; + if(!p) return; + if(p.attempts < p.attemptsMax) { + p.attempts++; + s.commentPostingProcess.start(); + } else { + if(options && options.onerror) + options.onerror(); + } + }, JSCC.REPOST_COMMENT_TIMEOUT); + s.setStateLCF("disable"); + s.server(src, prms, true, {transport: 'POST'}); + }, + stop: function(){ + s.setStateLCF("enable"); + clearTimeout(s.commentPostingProcess.timer); + delete s.commentPostingProcess; + if(options && options.onsuccess) + options.onsuccess(cmtObj); + }, + disableLCF: function() { + var container = s.TC["jsk-CommentFormSurface"]; + if (!container || cmtObj.isEditing) return; + JSKitLib.addClass(container, "js-kit-relative"); + var p = s.commentPostingProcess; + p.enableLCF(); + p.cover = s.assembleCoverLCF(); + container.appendChild(p.cover.content); + p.adjustCoverPosition(container); + }, + enableLCF: function() { + var cover = s.commentPostingProcess.cover; + if (cover && cover.content.parentNode) { + var container = cover.content.parentNode; + container.removeChild(cover.content); + JSKitLib.removeClass(container, "js-kit-relative"); + } + }, + adjustCoverPosition: function(container) { + var cover = s.commentPostingProcess.cover; + if (JSKitLib.isIE()) { + cover.content.style.width = container.offsetWidth+ "px"; + cover.content.style.height = container.offsetHeight + "px"; + } + cover.get("Msg").style.top = (container.offsetHeight - cover.get("Msg").offsetHeight)/2 + "px"; + } + }; + s.commentPostingProcess.start(); +} + +JSCC.prototype.setStateLCF = function(state) { + this.setControlsStateLCF(state, [this.TC['js-Cmtcancel']]); + this.commentPostingProcess[state + "LCF"](); +} + +JSCC.prototype.assembleCoverLCF = function() { + var s = this; + var attachEvent = function(element, extraCallback) { + element.href = "javascript:void(0);"; + element.onclick = function() { + s.setStateLCF("enable"); + delete s.commentPostingProcess; + if (extraCallback) extraCallback(); + return false; + }; + }; + var descriptors = { + "Wrapper": function(element) { + JSKitLib.setOpacity(element, 0.7); + }, + "Label": function(element) { + var attempts = s.commentPostingProcess.attempts; + JSKitLib.text($JCL("posting") + (attempts > 1 ? " (" + $JCL("attempt") + " " + attempts + ")" : "") + "...", element, true); + }, + "Post": function(element) { + attachEvent(element, function() { + s.CommentSubmitted(); + }); + }, + "Cancel": function(element) { + attachEvent(element); + } + }; + return JSKitLib.toDOM(s.gtmpl(s.dtPostingCommentDialog), "js-CommentWaitSubmit", descriptors); +} + +JSCC.prototype.getKVListFromMsg = function(msg) { + var prms = {}; + JSKitLib.fmap(msg, function(v) { prms[v.Name] = v.Value; }); + return prms; +} + +JSCC.prototype.getRatingsAppObject = function() { + return this.isStandalone() ? null : $JSKitGlobal.getRatingsAppObject(this.uniq); +} + +JSCC.prototype.hasRatingsAppObject = function() { + return this.getRatingsAppObject() ? true : false; +} + +JSCC.prototype.embedRatingsAppObject = function(node) { + // One time + if ( ! this.embedRatingsAppObjectCompleted) { + $JSKitGlobal.copyRatingsAppObject(this.uniq, node); + this.embedRatingsAppObjectCompleted = true; + } +} + +JSCC.prototype.createMiniStarObject = function(rating, scale) { + + var rao = this.getRatingsAppObject(); + var fullStar = rao.miniFullStar['user']; + var emptyStar = rao.miniEmptyStar['user']; + var starWidth = rao.miniStarWidth + 'px'; + var starHeight = rao.miniStarHeight + 'px'; + + var setImage = function(star, imageURL) { + if(star.imageURL == imageURL) + return; // Already set and we know it + + star.imageURL = imageURL; + + if(document.body.filters) { + star.runtimeStyle.filter + = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + + imageURL + "', sizingMethod='crop')" + } else { + star.style.backgroundImage = 'url(' + imageURL + ')'; + } + } + + var obj = document.createElement('div'); + + /* Increment by Full Star Ratings */ + for (var i=2; i <= scale; i += 2) { + + var star = this.cr('div'); + + star.style.cssFloat = 'left'; + star.style.styleFloat = 'left'; + star.style.width = starWidth; + star.style.height = starHeight; + + setImage(star, (rating >= i ? fullStar : emptyStar)); + + obj.appendChild(star); + } + + return obj; +} + +JSCC.prototype.rerenderName = function(cmt) { + var self = this; + var ctls = cmt.ctls; + var jsc = function(t){return ctls['js-singleComment'+t]}; + var sn = jsc("Name"); + if(sn && !(cmt.cobj.msgtype && cmt.cobj.msgtype.match(/T|P/))) { + sn.style.cursor = 'pointer'; + self.appendProfileHandler(sn, cmt.cobj); + } + var su = jsc("Url"); + if(su && cmt.cobj.Url && self.serverOptions.extraFieldURL + && !(cmt.cobj.msgtype && cmt.cobj.msgtype.match(/T|P/))) { + su.style.cursor = 'pointer'; + su.setAttribute('title', cmt.cobj.Url); + su.style.display = 'inline'; + su.onclick = function() { + window.open(cmt.cobj.Url, '_blank'); + return false; + } + } +} + +JSCC.prototype.gotPermanentId = function(tmpid, msgId) { + var self = this; + if (!this.commentPostingProcess) return; + var cobj = this.commentPostingProcess.cmtObj; + this.commentPostingProcess.stop(); + cobj.ID = msgId; + self.objById[msgId] = cobj; + var aux = arguments.length > 2 ? arguments[2] : {}; + var props = { + 'status': cobj, + 'Text': cobj, + 'originalText': cobj, + 'mtext': self.serverOptions, + 'mmode': self.serverOptions}; + for(var pname in props) { + if(aux.hasOwnProperty(pname)) { + props[pname][pname] = aux[pname]; + } + } + if (aux.Text) { + JSKW$Events.syncBroadcast('smileys-loadCommentsWidget', cobj, self.jcaIndex); + } + if(!self.serverOptions.profile && aux.profile) { + self.serverOptions.profile = aux.profile; + } + if (aux.profile) { + cobj.profile = aux.profile; + } + var fillObject = function(obj) { + if (aux.avatar) { + obj.avatar = aux.avatar; + obj.avatarWidth = aux.avatarWidth; + obj.avatarHeight = aux.avatarHeight; + obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(obj); + } + if (aux.destName) { + obj.destName = aux.destName; + } + if (aux.gravatarId) { + obj.GravatarID = aux.gravatarId; + } + return obj; + }; + cobj = fillObject(cobj); + var cnvsObj = fillObject({"Name": cobj.Name}); + if(aux.avatar || aux.gravatarId) { + self.placeAvatar(cobj); + } + if(this.IM && cobj.waitConversation) { + cnvsObj.direction = "out"; + this.conversations[cobj.waitConversation.cnvsIdx] = cnvsObj; + cobj.conversation = cobj.waitConversation.cnvsIdx; + cobj.waitConversation = false; + cobj.hasCnvs = false; + } + this.isCommentSender = true; + this.routeAction(function() { + if (!this.isSourceAvailable("Comments")) return; + this.cmtInPlace(cobj, function() { + if (!this.isCommentSender) return; + this.controls.reveal(); + this.reCalcPages(); + if (this.useEcho() && this.serverOptions.expandLeaveCmt && !this.config.noautoexpand) { + this.ShowCommentDialog(undefined, {nofocus: true}); + } + delete this.isCommentSender; + }); + }); + this.publishEvent(tmpid == msgId ? 'comment-edited' : 'comment-added', {'cmtId': msgId}); +} + +function JSReplyMSGId(tmpid, msgId) { + try { + var cobj; + var widget; + for(var i = 0; i < $JCA.length; i++) { + var p = $JCA[i].commentPostingProcess; + if(p && p.cmtObj && p.cmtObj.ID == tmpid && p.cmtObj.jcaIndex == $JCA[i].jcaIndex) { + cobj = p.cmtObj; + widget = $JCA[i]; + break; + } + } + if (widget) widget.gotPermanentId.apply(widget, arguments); + } catch(e){} +} + +function JSDeleteMSGId(msgId, jcaIndex, deletedCount) { + try { + var self = $JCA[jcaIndex]; + var item = self.jspg.getItemById(msgId); + if(item) { + var cmt = item.div; + if(cmt.cobj.action) + JSKW$Events.syncBroadcast("comments_serverRequest_" + cmt.cobj.action); + self.routeAction(function() { + if(deletedCount>1){ + this.tag = null; + this.invalidateJSPG(); + var pageNo = this.curPage; + this.curPage = 0; + this.displayPage(pageNo); + } else { + this.postHandlerDelete(cmt); + } + }); + } + } catch(e){} +} + +function JSMarkOffensive() { + alert($JCL('markoffMessage')); +} + +function JSCCLike(config) { + this.uriAvatar = JSCC.URI_AVATAR; + this.uriDomain = JSCC.DOMAIN; + this.avatarSize = {"width": "16", "height": "16"}; + JSKitLib.fmap.call(this, config, function(v, k){ this[k] = v; }); + this.voters = {"raw": this.voters}; + this.initVoters(); + this.loadCSS(); +} + +JSCCLike.prototype.loadCSS = function() { + JSKitLib.addCss( + ".js-kit-like-label { float: left; margin-right: 5px; }" + + ".js-kit-like-expand { float: left; cursor: pointer; }" + + ".js-kit-like-name { float: left; }" + + ".js-kit-like-avatar { float: left; margin-right: 2px; }" + + ".js-kit-like-userButton { float: left; height: 16px; margin: 0px 5px 2px 0px; cursor: pointer; }" , "like"); +} + +JSCCLike.prototype.label = function(key, data){ + return this.translator("like_" + key, data); +} + +JSCCLike.prototype.initVoters = function(){ + var self = this; + + //if voters list contains more than 7 voters - display 5 voters and expand marker + this.displayLimit = {"reduced": 5, "full": 7}; + + var i = 0; + while (i < this.voters["raw"].length){ + if (this.voters["raw"][i].profile == this.profile()){ + //if voters list contains your profile we will show it first + this.voters["raw"].unshift(this.voters["raw"].splice(i, 1).shift()); + this.voted = true; + break; + } + i++; + } + this.guestsCount = 0; + this.voters["normalized"] = JSKitLib.filter(function(voter){ + if (voter.name == "" && voter.profile != self.profile()) self.guestsCount++; + return (voter.name != "" || voter.profile == self.profile()); + }, this.voters["raw"]); + if (this.guestsCount > 0) { + this.displayLimit["full"]--; + this.displayLimit["reduced"]--; + } + if (this.voters["normalized"].length > this.displayLimit["full"]) { + this.voters["reduced"] = this.voters["normalized"].slice(0, this.displayLimit["reduced"]); + } else delete(this.voters["reduced"]); + this.assemble(); + this.renderLikeControl(); +} + +JSCCLike.prototype.renderLikeControl = function(flag) { + var label = this.voted ? "unlike" : "like"; + JSKitLib.text(this.label(label + (flag ? "_progress" : "")), this.likeControl, true); + this.likeControl.title = this.label(label + "_title"); +} + +JSCCLike.prototype.sendRequest = function(obj) { + var params = { + "p": this.path, + "id": this.ID, + "jx": this.jx, + "action": this.voted ? "unlike" : "like" + }; + var request = JSKitLib.foldl(obj, params, function(value, acc, key) { acc[key] = value; }); + new JSRVC({ + "uri": this.uriDomain + '/comment-karma', + "request": request, + "ref": this.ref, + "epb": window.JSKitEPB ? JSKitEPB.getAsHash() : {} + }); +} + +JSCCLike.prototype.vote = function(action, obj) { + var voterInList = JSKitLib.lookup(function(voter){ + return voter.profile == obj.profile; + }, this.voters["raw"]); + + if (action == "like" && !voterInList) { + this.voters["raw"].unshift(obj); + this.initVoters(); + } + if (action == "unlike" && voterInList) { + this.voters["raw"] = JSKitLib.filter(function(voter){ + return voter.profile != obj.profile; + }, this.voters["raw"]); + this.voted = false; + this.initVoters(); + } +} + +JSCCLike.prototype.assembleVotersList = function(voters) { + var self = this; + var container = []; + var assembleSingleVoter = function(textLabel, avatar){ + var template = + '

      ' + + '
      ' + + '
      ' + textLabel + '
      ' + + '
      ' + + '
      '; + var dom = JSKitLib.toDOM(template, "js-kit-like-", {}); + self.onVoterRender(dom, {"avatar": avatar}); + return dom.content; + }; + JSKitLib.fmap(voters || [], function(voter){ + var avatar = voter.avatar ? { + "name": voter.avatar, + "width": voter.avatar_width, + "height": voter.avatar_height + } : undefined; + var textLabel = (voter["profile"] == self.profile()) ? self.label("you") : voter["name"]; + var singleVoter = assembleSingleVoter(textLabel, avatar); + self.onVoterInit(singleVoter, { + "Name": voter.name, + "profile": voter.profile, + "avatarData": avatar + }); + container.push(singleVoter); + }); + if (this.guestsCount > 0){ + var textLabel = self.label((self.guestsCount > 1) ? "guests" : "guest", {"guestsCount": self.guestsCount}); + container.push(assembleSingleVoter(textLabel)); + } + return container; +} + +JSCCLike.prototype.assemble = function() { + var self = this; + if (!self.voters["normalized"].length && self.guestsCount == 0) { + JSKitLib.removeChildren(self.target); + return; + } + + var descriptors = [ + function(container) { + container.appendChild(JSKitLib.html('
      ' + self.label("likedBy") + '
      ')); + }, + function(container){ + JSKitLib.fmap(self.assembleVotersList(self.voters["reduced"] && !self.expanded ? self.voters["reduced"] : self.voters["normalized"]), function(userButton){ + container.appendChild(userButton); + }); + }, + function(container){ + if (!self.voters["reduced"]) return; + self.expandMarker = JSKitLib.html('
      '); + var expandLabel = self.label(self.expanded ? "collapseList" : "andXMore", {"count" : self.voters["normalized"].length - self.displayLimit["reduced"]}); + JSKitLib.text(expandLabel, self.expandMarker, true); + JSKitLib.preventSelect(self.expandMarker); + JSKitLib.setEventHandler(self.expandMarker, ["click"], function(){ + self.expanded = !self.expanded; + JSKitLib.removeChildren(self.target); + self.assemble(); + }); + container.appendChild(self.expandMarker); + } + ]; + JSKitLib.removeChildren(self.target); + JSKitLib.fmap(descriptors, function(descriptor){ + descriptor(self.target); + }); + this.onInit(); +} + +JSCCLike.prototype.getExpandMarker = function(element){ + return this.expandMarker; +} + +function JSCCKarma(cObj, self) { + var kObj = { p: cObj.karmaP || 0, n: cObj.karmaN || 0 }; + this.score = kObj.p - kObj.n; + this.votes = kObj.p + kObj.n; + this.cObj = cObj; + this.self = self; + this.vote2text(); + return this; +} +JSCCKarma.prototype.vote2text = function() { + this.votesText = this.votes + ' ' + + ((this.votes == 1) ? $JCL("vote") : $JCL("votes")); +} + +JSCCKarma.prototype.recomputeScore = function(scoreAdjustment) { + var now = new Date(); + if(this.votedAlready) { + this.score -= this.myVote; + } else { + this.votes += 1; + this.votedAlready = true; + var kObj = this; + setTimeout(function() { + var action = kObj.myVote > 0 ? '+' : '-'; + kObj.self.server('-karma', {'id': kObj.cObj.ID, + 'action': action}); + }, 2000); + } + this.score += scoreAdjustment; + this.myVote = scoreAdjustment; + this.vote2text(); +} + +JSCC.prototype.divPages = function(so, items) { + var srv = so.pages; + this.curPage = 0; + var self = this; + if(!this.jspg && !this.useEcho()) { + this.jspg = new JSPGC(items.length, srv.ps); + this.jspg.dataRequest = function(pageIdx, pg, cb) { + var pageNo = pageIdx+1; + if(!pg.target) pg.target = self.cr('div'); + var tgt = pg.target; + if(tgt.parentNode) tgt.parentNode.removeChild(tgt); + self.dataLoader = function() { + self.renderLeaveCommentForm(); + self.curPage = 0; + self.displayPage(pageNo, function(immed){ cb.apply(self, [undefined, immed])}); + } + if(srv.pn < 10) + srv.pn += 5; + self.getpages(pageNo - Math.ceil(srv.pn / 2), {'pn[0]': srv.pn}); + JSKitLib.text($JCL("loading"), tgt, true); + return cb(tgt, false); + }; + this.jspg.dataVisualizator = function(sIdx, arr, pg, cb) { + if(!pg.target) pg.target = self.cr('div'); + var tgt = pg.target; + if(tgt.parentNode) tgt.parentNode.removeChild(tgt); + var itemsOnPage = arr.length; + var cnvs = []; + var cn = JSKitLib.fmap(arr,function(V,K){ + if(!V.html) { + var oldN = V.obj.Name; + V.obj.Name = (self.IM && V.obj.yours) ? 'Me' : oldN; + var oldT = V.obj.Text; + if(V.obj.status=='DT') V.obj.Text = 'Deleted'; + if (V.obj.Url && !V.obj.Url.match(/^https?:\/\//) ) { + V.obj.Url = "http://" + V.obj.Url; + } + V.obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(V.obj); + V.html = self.createCommentAsHTML(V.obj); + V.obj.Name = oldN; + V.obj.Text = oldT; + delete V.div; + } + V.div = JSKitLib.html(V.html); + V.div.id = V.obj.ID; + V.obj.hasCnvs = !cnvs[V.obj.conversation]; + cnvs[V.obj.conversation] = true; + self.fixComment(V.div, V.obj, K, K+sIdx, itemsOnPage); + return V; + }); + JSKitLib.removeChildren(tgt); + self.pageHeader(tgt, sIdx, arr, itemsOnPage); + if(self.dtGroupModeration) + tgt.appendChild(self.groupModerationBlock(self.dtGroupModeration)); + for(var i=0; i1) { + var crdiv = function(className) { + var div = self.cr("div"); + div.className = className; + return div; + }; + var div = crdiv("js-TornPageDivider"); + var divT = crdiv("js-TornPageDividerTop"); + var divB = crdiv("js-TornPageDividerBottom"); + div.appendChild(divT); + div.appendChild(divB); + tgt.appendChild(div); + } + } + self.pageFooter(tgt, sIdx, arr, itemsOnPage); + if(self.dtGroupModeration) + tgt.appendChild(self.groupModerationBlock(self.dtGroupModeration)); + return cb(tgt, true); + }; + } + if(!this.jspg && this.useEcho()) { + this.jspg = new JSKEchoPGC(srv.ps, srv.echo_after); + this.jspg.dataRequest = function(pageIdx, more, echo_after, cb) { + var pageNo = pageIdx+1; + if(!self.jspg.target) self.jspg.target = self.cr('div'); + var tgt = self.jspg.target; + if(tgt.parentNode) tgt.parentNode.removeChild(tgt); + if(!more) JSKitLib.removeChildren(tgt); + self.dataLoader = function() { + self.renderLeaveCommentForm(); + self.curPage = 0; + self.displayPage(pageNo, function(immed){ cb.apply(self, [undefined, immed])}); + } + var params = {'echo[0]': true}; + if (more && echo_after) params['echo_after[0]'] = echo_after; + self.getpages(undefined, params); + var pageNav = self.TC['js-PageNavBottom']; + if(pageNav) { + JSKitLib.removeChildren(pageNav); + pageNav.appendChild(JSKitLib.html('
      ' + $JCL("loading") + '
      ')); + } + self.jspg.loading = true; + return cb(tgt, false); + }; + this.jspg.dataVisualizator = function(arr, cb) { + if(!self.jspg.target) self.jspg.target = self.cr('div'); + var tgt = self.jspg.target; + var itemsOnPage = arr.length; + var cnvs = []; + var cn = JSKitLib.fmap(arr,function(V,K){ + if(!V.html) { + var oldN = V.obj.Name; + V.obj.Name = (self.IM && V.obj.yours) ? 'Me' : oldN; + var oldT = V.obj.Text; + if(V.obj.status=='DT') V.obj.Text = 'Deleted'; + if (V.obj.Url && !V.obj.Url.match(/^https?:\/\//) ) { + V.obj.Url = "http://" + V.obj.Url; + } + + if(V.obj.event_publisher) { + if(typeof(V.obj.content) == 'string') + eval('var content = ' + V.obj.content + '; V.obj.content = content;'); + + // Removing links to this page + var sanitizer = function(url) { + if (!url) return ''; + if ('/' != url[url.length - 1]) url = url + '/'; + return url.split('#', 2)[0] + .toLowerCase() + .replace(/\butm_(source|medium|term|content|campaign)=[^&$]+(&|$)/g, '') + .replace(/\?*&*$/, '') + .replace(/^https?:\/\/(www\.)?/, '') + .replace(/\/\/+/, '/'); + }; + + var el = document.createElement('div'); + el.innerHTML = V.obj.content.title; + var ref = sanitizer(self.config.permalink); + var links= JSKitLib.getElementsByClass(el, '*', 'a'); + + JSKitLib.fmap(links, function(link) { + var data_resolved = sanitizer(link.getAttribute('data-resolved')); + var href = sanitizer(link.href); + if((href == ref) || (data_resolved == ref)) + link.parentNode.removeChild(link); + }); + + var clearText = JSKitLib.trim(el.innerHTML.replace(/<\/?wbr>/g, '')); + if (clearText == "") { + el.innerHTML = $JCL("sharedThisOn", {"service_name": V.obj.content.service.name || V.obj.event_publisher}); + } + + V.obj.content.title = el.innerHTML; + + if(V.obj.content.user && (V.obj.content.user.profileUrl || V.obj.content.user.avatarUrl)) { + V.obj.avatar = V.obj.GravatarID = (V.obj.content.user.avatarUrl || + V.obj.content.user.profileUrl + "/picture?size=medium"); + V.obj.avatarWidth = "50"; + V.obj.avatarHeight = "50"; + V.obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(V.obj); + V.obj.ProfileURL = V.obj.content.user.profileUrl; + } + V.html = self.tmpl(self.ffComment, V.obj); + } else { + V.obj.avatarPlaceWidth = self.cmtAvatarPlaceWidth(V.obj); + V.html = self.createCommentAsHTML(V.obj); + } + V.obj.Name = oldN; + V.obj.Text = oldT; + V.$olddiv = V.div; + V.$isnew = true; + V.div = JSKitLib.html(V.html); + if (V.obj.extra && V.obj.extra.cssClass) { + JSKitLib.addClass(V.div, V.obj.extra.cssClass); + } + } + V.div.id = V.obj.ID; + V.obj.hasCnvs = !cnvs[V.obj.conversation]; + cnvs[V.obj.conversation] = true; + if(V.obj.echoItemFirstTime && !V.obj.havingEffect) { + V.div.style.overflow = 'hidden'; + V.div.style.height = "1px"; + V.obj.height = 1; + } + if(V.$isnew) + self.fixComment(V.div, V.obj, K, K, itemsOnPage); + return V; + }); + for(var i=0; i0) { + req.variableRequest = idlist.spam; + req.request.junk = 'no'; + req.uri = this.uriDomain + '/comments-junk'; + new JSRVC(req); + } + if(idlist.appr.length>0) { + req.variableRequest = idlist.appr; + req.uri = this.uriDomain + '/comments-approve'; + new JSRVC(req); + } + if(idlist.del.length>0) { + req.variableRequest = idlist.del; + req.request.apr = 'message'; + req.uri = this.uriDomain + '/comments-del'; + new JSRVC(req); + } + break; + case 'delete': + req.uri = this.uriDomain + '/comments-del'; + new JSRVC(req); + break; + case 'spam': + req.request.junk = 'yes'; + req.uri = this.uriDomain + '/comments-junk'; + new JSRVC(req); + break; + case 'user': + req.request.apr = 'user'; + req.uri = this.uriDomain + '/comments-del'; + new JSRVC(req); + break; + case 'blockuser': + req.request.by = 'user'; + req.uri = this.uriDomain + '/comments-block'; + new JSRVC(req); + break; + case 'blockip': + req.request.by = 'ip'; + req.uri = this.uriDomain + '/comments-block'; + new JSRVC(req); + break; + case 'unban': + if(this.config.permalink) req.request.permalink = this.config.permalink; + req.request.unban = 1; + req.uri = this.uriDomain + '/comments-approve'; + new JSRVC(req); + break; + }; +} + +JSCC.prototype.pageHeader = function(target, globalIndex, items, itemsOnPage) { + if(this.getSkin()=='smoothgray' && itemsOnPage>0 && items.length>0 && (!this.adminMode || this.inlineModeration)) { + var obj = items[0].obj; + if(obj.cedge!=3 && obj.cedge!=1) { + var div = this.cr("div"); + div.className = "js-TornPageTop"; + if(JSKitLib.isIE()) { + var img = this.cr("img"); + img.className = "js-TornPageTopImg"; + img.src = "//cdn.js-kit.com/images/tornPaperT.gif"; + div.appendChild(img); + } + target.appendChild(div); + } + } +} + +JSCC.prototype.pageFooter = function(target, globalIndex, items, itemsOnPage) { + if(this.getSkin()=='smoothgray' && itemsOnPage>0 && items.length==itemsOnPage && (!this.adminMode || this.inlineModeration)) { + var obj = items[itemsOnPage-1].obj; + if(obj.cedge!=3 && obj.cedge!=2) { + var div = this.cr("div"); + div.className = "js-TornPageBottom"; + if(JSKitLib.isIE()) { + var img = this.cr("img"); + img.className = "js-TornPageBottomImg"; + img.src = "//cdn.js-kit.com/images/tornPaperB.gif"; + div.appendChild(img); + } + target.appendChild(div); + } + } +} + +JSCC.prototype.htmlPaginate = function(thread) { + return this.htmlPaginator(thread, []); +} + +JSCC.prototype.htmlPaginator = function(thread, arr) { + var tl = thread.length; + for(var i = 0; i < tl; i++) { + var obj = thread[i]; + var present = (obj.status == 'D') ? 0 : 1; + if(present) { + arr.push(obj); + } + this.htmlPaginator(obj.thread, arr); + } + return arr; +} + +JSCC.prototype.restoreEchoAfter = function() { + if(this.useEcho()) { + this.jspg.echo_after = this.jspg.$old_echo_after; + } +} + +JSCC.prototype.invalidateJSPG = function() { + this.restoreEchoAfter(); + this.jspg.invalidate(); +} + +// Part of externally useable API +JSCC.prototype.rerender = function() { + var pageToDisplay = this.curPage; + this.restoreEchoAfter(); + this.curPage = 0; + this.jspg.invalidatePagesView(pageToDisplay-1, 1); + this.displayPage(pageToDisplay); +} + +JSCC.prototype.setPath = function(path) { + this.pathOverride = path; +} + +JSCC.prototype.detectCommentDialogOpened = function() { + var ccd = this.TC[this.forMsg && this.forMsg.isEditing ? "js-EditComment" : "js-CreateComment"]; + return !!ccd && JSKitLib.hasParentNode(ccd) && ccd.style.display == 'block'; +} + +JSCC.prototype.displayPage = function(pageNo, cb) { + if(this.loading && !cb) { + var nt = (new Date()).valueOf(); + if((nt - this.loading) > 5000) { + this.gen++; + } else { + return; + } + } + + if(pageNo < 1) + return; + + if(pageNo > this.jspg.pageCount) + pageNo = this.jspg.pageCount; + + var immediate = true; + + if(this.curPage != pageNo) { + var cd = this.detectCommentDialogOpened(); + try { + if (!this.useEcho() || this.forMsg) this.CommentCancelled(); + } catch(e) { } + + if(!this.useEcho()) + try { + if(this.curPage) { + var p = this.jspg.getPage(this.curPage - 1); + if(p && p.target && p.target.parentNode) + p.target.parentNode.removeChild(p.target); + } + } catch(e) { } + var oc = this.TC["js-OldComments"]; + var self = this; + if(this.useEcho()) { + this.curPage = 1; + var pcb = function(p, immed) { + if(p) { + if(self.jspg.target && !JSKitLib.hasParentNode(self.jspg.target)) oc.appendChild(p); + p.style.display = ''; + } + if(immed && cb) cb.apply(self, [immed]); + }; + this.jspg.getPageVisualization(pageNo-1, pcb); + if(cd && this.replyForId) { + var parentMsg = this.jspg.getItemById(this.replyForId); + this.ShowCommentDialog(parentMsg ? this.replyForId : undefined); + } + cd = undefined; + } else { + this.curPage = pageNo; + var pcb = function(p, immed) { + if(p) { + oc.appendChild(p); + p.style.display = ''; + } + if(immed && cb) cb.apply(self, [immed]); + }; + this.jspg.getPageVisualization(pageNo-1, pcb); + } + immediate = false; + if (cd && !this.forMsg) { // show only if not reply and not editing + if (((this.config.nolc && this.IM == 'foreign') || (this.serverOptions.expandLeaveCmt && !this.config.noautoexpand)) && !this.config.moderate) { + this.ShowCommentDialog(undefined, {nofocus: true}); + } + } + } + + var ocw = this.TC["js-OldCommentsWrap"]; + if (this.jspg.itemsCount != 0) + { + JSKitLib.show(ocw); + } + else + { + JSKitLib.hide(ocw); + } + + if(!this.jspg.loading || !this.useEcho()) this.rePageNavigator(this.curPage-1); + if(immediate && cb) cb.apply(this, [immediate]); +} + +JSCC.prototype.SearchLine = function() { + var self = this; + var sExit = self.cr('span'); + var title = self.cr('span'); + title.className = 'js-SearchTitle'; + title.innerHTML = ''+$JCL("youSearchedFor")+':'; + sExit.appendChild(title); + var line = self.cr('span'); + line.className = 'js-SearchWords'; + text = JSKitLib.truncate(self.searchString, 15, "...", true); + line.insertBefore(JSKitLib.text(text),line.firstChild); + sExit.appendChild(line); + var del = self.cr('input'); + del.type = 'button'; + del.value = $JCL('clearSearch'); + sExit.appendChild(del); + var obj={ + 'containerElement': sExit, + 'field': line, + 'itemObject': self, + 'type': 'Search', + 'Property': 'searchString', + 'title': $JCL("youSearchedFor")+': ', + 'mode': 'full' + }; + obj.jsipe$start = function(){ + del.style.display = "none"; + line.style.border = "0px"; + title.style.display = "none"; + return true; + } + obj.jsk$on_submit_exit = function(value){ + self.searchString = value; + self.viewControl({name: "search"}); + } + line.wasEdited = function(value){ + JSKitLib.text(JSKitLib.truncate(value, 15, "...", true), line, true); + del.style.display = ""; + line.style.borderBottom = ""; + title.style.display = ""; + } + del.onclick = function(){ + this.name="del-line"; + self.viewControl(this); + } + var jsipe = new JSIPE(obj); + return sExit; +} + +JSCC.prototype.navSym = { "prev": "←", "next": "→" }; + +JSCC.prototype.rePageNavigator = function(pageIdx) { + var s = this; + var hasMultiplePages = s.jspg.pageCount > 1 || s.jspg.echo_after; + var display = s.searchString || hasMultiplePages ? "" : "none"; + var assemblePageNavigation = function() { + var navigation = ''; + if (hasMultiplePages) { + navigation = s.useEcho() + ? s.pageNavigatorEchoLive(s.jspg.pageCount, s.jspg.echo_after) + : s.getSkin() == "echo" + ? s.pageNavigatorEcho(s.jspg.pageCount, s.curPage) + : s.pageNavigator(s.jspg.pageCount, s.curPage); + } + return (typeof(navigation) == "string") + ? JSKitLib.html('
      ' + (navigation || '') + '
      ') + : navigation; + }; + var nvs = s.useEcho() ? ['Bottom'] : ['Top','Bottom']; + for(var i = 0; i < nvs.length; i++) { + var bar = s.TC['js-PageNav' + nvs[i]]; + if (!bar) continue; + JSKitLib.replaceChildren(bar, assemblePageNavigation()); + JSKitLib.preventSelect(bar); + bar.style.display = display; + if(i) bar.style.display = ((pageIdx==undefined) ? 'none' : ''); + if(s.searchString) s.addChild(bar, s.SearchLine(), true); + } +} + +JSCC.prototype.pageNavigator = function(pages, cur) { + var self = this; + var arr = []; + var postingProcessValidation = "if ($JCA["+self.jcaIndex+"].commentPostingProcess) { alert($JCL('messagePostingInProgress')); return false; }"; + var f = function(i, txt, cmt, cls, cf) { + return '' + txt + ' '; } + arr.push($JCL('page')); + arr.push(f(cur - 1, this.navSym.prev, $JCL('pagePrevious'), + 'js-PageArrow' + ((cur == 1)?' js-PageArrowCur':''))); + for(var i = 1; i <= pages; i++) { + if((i == 4 || i == 3) && (cur - i) > 3) { + i = Math.floor((cur - i) / 2 + i); + arr.push(f(i, '…', 'Page-' + i)); + i = cur - ((pages - cur > 3 || cur == pages) ? 2 : 1); + } + if((i == cur + 3) && (pages - cur) > 4) { + i = Math.floor((pages - cur) / 2 + cur); + arr.push(f(i, '…', 'Page-' + i)); + i = pages - 1; + } + if(i == cur) { + arr.push(f(i, i, 'Page-' + i, "js-PageNCur", '$JCA['+self.jcaIndex+'].jspg.invalidate(); $JCA['+self.jcaIndex+'].rerender();')); + } else { + arr.push(f(i, i, 'Page-' + i)); + } + } + arr.push(f(cur + 1, this.navSym.next, $JCL('pageNext'), + 'js-PageArrow' + ((pages == cur)?' js-PageArrowCur':''))); + return arr.join(''); +} + +JSCC.prototype.pageNavigatorEcho = function(pages, cur) { + var self = this; + var assemble = function(container, i, txt, cmt, cls, cf) { + var isInactive = function(cls) { + return cls && cls.match(/PrevOff|NextOff|Active/); + }; + var template = + '
    • ' + + (isInactive(cls) ? txt : '' + txt + '') + + '
    • '; + var scroll = function() { + var anchor = self.TC['jsk-HeaderWrapper']; + if (!anchor || JSKitLib.getStyleProperty(anchor, 'display') == 'none') { + anchor = self.TC['jsk-ThreadWrapper']; + } + if (anchor) anchor.scrollIntoView(true); + }; + var linkHandler = function(element) { + element.href = "#" + cmt; + element.onclick = function() { + if (self.commentPostingProcess) { + alert($JCL('messagePostingInProgress')); + return false; + } + if (cf) { + cf(); + return false; + } + self.displayPage(i, function() { + self.hideExpirationBanner(); + setTimeout(scroll, 0); + }); + return false; + }; + JSKitLib.setMouseEvent(element, "over", function() { + window.status = cmt; + }); + JSKitLib.setMouseEvent(element, "out", function() { + window.status = ''; + }); + }; + container.appendChild(JSKitLib.toDOM(template, "js-Page", + {"Link": linkHandler}).content); + } + var template = + '
      ' + + '
        ' + + '
        '; + var assemblePages = function(element) { + assemble(element, cur - 1, $JCL('btnPagePrevious'), $JCL('pagePrevious'), + ((cur == 1) ? 'jsk-PrevOff' : 'jsk-Prev')); + for(var i = 1; i <= pages; i++) { + if((i == 4 || i == 3) && (cur - i) > 3) { + i = Math.floor((cur - i) / 2 + i); + assemble(element, i, '…', 'Page-' + i); + i = cur - ((pages - cur > 3 || cur == pages) ? 2 : 1); + } + if((i == cur + 3) && (pages - cur) > 4) { + i = Math.floor((pages - cur) / 2 + cur); + assemble(element, i, '…', 'Page-' + i); + i = pages - 1; + } + if(i == cur) { + var cb = function() { + self.jspg.invalidate(); + self.rerender(); + }; + assemble(element, i, i, 'Page-' + i, 'jsk-Active', cb); + } else { + assemble(element, i, i, 'Page-' + i); + } + } + assemble(element, cur + 1, $JCL('btnPageNext'), $JCL('pageNext'), + ((pages == cur) ? 'jsk-NextOff' : 'jsk-Next')); + }; + return JSKitLib.toDOM(template, "jsk-", {"Pager": assemblePages}).content; +} + +JSCC.prototype.pageNavigatorEchoLive = function(pages, cur) { + var self = this; + var template = + '
        ' + + '{Label:More}' + + '
        '; + var moreButtonHandler = function(element) { + element.onclick = function() { + self.displayPage(2); + }; + JSKitLib.setMouseEvent(element, "over", function() { + JSKitLib.addClass(element, "jsk-PagerItemHover"); + }); + JSKitLib.setMouseEvent(element, "out", function() { + JSKitLib.removeClass(element, "jsk-PagerItemHover"); + }); + }; + return JSKitLib.toDOM(this.gtmpl(template), "js-Page", {"More": moreButtonHandler}).content; +} + +JSCC.prototype.hideSettingsWindow = function(wname) { + if(this[wname]) this.settingsWindow(wname); +} + +JSCC.prototype.showProgress = function(wname, on) { + if(this[wname]) this[wname].showProgress(on); +} + +JSCC.prototype.settingsWindow = function(wname, atDiv, html) { + var s = this; + if(s[wname]) { + if(!s.sWHideable) return; + s[wname].parentNode.removeChild(s[wname]); + delete s[wname]; + return; + } + var nohide = function() { + s.sWHideable = false; + if(s.swsHidt) clearTimeout(s.swsHidt); + s.swsHidt = setTimeout(function(){s.sWHideable=true}, 100); + } + var div = this.cr("div"); + div.className = "js-SettingsWindow"; + if (s.config.nolc) JSKitLib.addClass(div, "js-SettingsWindowNolc"); + div.style.background = '#FFFFFF url('+this.uriDomain + +'/images/bg-header-gray.png) bottom repeat-x'; + div.onclick = nohide; + div.onselectstart = function() { return false; } + if(typeof(html) == 'string') { + div.innerHTML = html; + } else { + if(!html.dropWidth) div.style.width = '20em'; + div.appendChild(html); + } + + if (wname == 'ctWnd' && s.TC['js-WelcomePanel']) { + var aoh = s.cr('div'); + aoh.className = 'js-SettingsWindowHeader'; + JSKitLib.text($JCL('administratorOptions'), aoh); + div.appendChild(aoh); + var wp = s.TC['js-WelcomePanel']; + var links = JSKitLib.html('' + + '' + + '' + + '' + + '
        '); + var tc = JSKitLib.mapClass2Object({}, links); + div.appendChild(links); + tc['js-WelcomeOpenPanel'].onclick = function() { + JSKitLib.toggle(wp); + JSKitLib.text($JCL(JSKitLib.visible(wp) ? 'closeWelcome' : 'openWelcome'), this.lastChild.lastChild); + }; + tc['js-WelcomeContact'].onclick = function(){location.href = s.uriDomain + '/comments/qa.html';}; + } + + var pgr = this.cr('div'); + pgr.className = "js-Progress"; + var url = this.uriDomain + '/images/progress-wg.png'; + if(document.body.filters) { + pgr.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + url + ", sizingMethod=crop)"; + } else pgr.style.backgroundImage = 'url(' + url + ')'; + div.appendChild(pgr); + div.showProgress = function(on) { + if(!on) { + if(div.pIntvl) clearInterval(div.pIntvl); + div.pIntvl = null; + pgr.style.visibility = 'hidden'; + return; + } else if(div.pIntvl) return; + var f = function() { + pgr.vison = !pgr.vison; + pgr.style.visibility = pgr.vison + ? 'visible' : 'hidden'; + } + f(); + div.pIntvl = setInterval(f, 500); + } + + s[wname] = div; + var swh = this.cr("div"); + swh.className = "js-SettingsWindowHeader"; + JSKitLib.text($JCL(wname == 'ctWnd' ? "viewOptions" : "moderation"), swh); + div.insertBefore(swh, div.firstChild); + div.style.position = "absolute"; + + var jsd = new JSDL(div, [swh]); + document.body.appendChild(div); + div.style.left = jsd.getElmAbsPos(atDiv, false).x + "px"; + div.style.top = jsd.getElmAbsPos(atDiv, false).y + atDiv.offsetHeight + "px"; + + try { + if (document.body.clientWidth < jsd.getElmAbsPos(atDiv, false).x + div.offsetWidth) + div.style.left = document.body.clientWidth - div.offsetWidth - + (parseInt(div.style.marginLeft) || 0) - + (parseInt(div.style.marginRight) || 0) + "px"; + } catch(e) {;} + + var ifrWr; + if(JSKitLib.getBrowser() == 'gecko' && !atDiv.notShowIfr) { + ifrWr = this.cr("div"); + ifrWr.id = "jsk-yIfr"; + var yIfr = this.cr("iframe"); + yIfr.style.position = "absolute"; + yIfr.style.top = 0; + yIfr.style.left = 0; + yIfr.style.zIndex = -1; + yIfr.style.display = "block"; + yIfr.style.height = div.offsetHeight + "px"; + yIfr.style.width = div.offsetWidth + "px"; + yIfr.scrolling = "no"; + yIfr.frameBorder = "0"; + ifrWr.appendChild(yIfr); + div.appendChild(ifrWr); + } + div.jsk$on_start_drag = function(){if(ifrWr) ifrWr.style.display = "none"}; + div.jsk$on_stop_drag = function(){if(ifrWr) ifrWr.style.display = ""}; + nohide(); +} + +JSCC.prototype.getImages = function(id) { + var arg = {rnd: id, jx: this.jcaIndex}; + this.server(this.uriDomain + '/api/images/pick-attachments.js', arg); +} + +JSCC.prototype.prepareImgData = function(msg) { + if(this.images){ + JSKitLib.removeChildren(this.imgArea); + JSKitLib.map(function(elem, i){ + JSKitLib.fmap(['img','orig','width','height','descr','mime'], + function(E) { msg.push({'Name': 'js-CmtattachFile_'+i+'_'+E, 'Value': elem[E]})} + ); + },this.images); + } +} + +JSCC.prototype.parseImgData = function(obj) { + var re = /attachFile_(\d+)_(\w+)/; + var imgs = []; + for (var i in obj){ + var keys = re.exec(i); + if (keys) { + if (!imgs[keys[1]]) imgs[keys[1]] = {}; + imgs[keys[1]][keys[2]] = obj[i]; + } + } + return imgs; +} + +JSCC.prototype.createImages = function(imgs, isPreview){ + var s = this; + var d=function(){return s.div.apply(s,arguments);} + + var content = isPreview ? d() : + d("js-all-previewImages",d("js-previewImageTitle jsk-ItemAttachmentsTitle jsk-SecondaryBackgroundColor", $JCL('picTitle')), + JSKitLib.html('
        ')); + + var bloburl = function(name) { + return name.match(/^[^\/]+$/)?(s.uriDomain+"/blob/"+name):""; + } + + var crImg = function(elem, i){ + var img = d("js-previewImage jsk-ItemAttachmentWrapper"); + var thumb = s.cr("img"); + elem.descr = elem.descr || ''; + thumb.src = bloburl(elem.img); + JSKitLib.setStyle(thumb, " width: "+elem.width+"px; height: "+elem.height+"px; cursor: pointer;"); + JSKitLib.addClass(thumb, "jsk-ItemAttachmentIcon"); + var wrap = d("js-imageWrap jsk-ItemAttachmentIconWrapper"); + JSKitLib.setStyle(wrap, "margin-top: " + ((96-elem.height)/2) + "px; margin-bottom: " + ((96-elem.height)/2) + "px;"); + thumb.onclick = function() { window.open(bloburl(elem.orig)); } + var text = d("js-previewImageDescr jsk-ItemAttachmentLabel"); + s.addChild(wrap, thumb); + s.addChild(img, wrap); + if (isPreview) { + var wasEdited = function(){ + if(elem.descr != "" ) JSKitLib.removeClass(text,"js-uploadGreyDescr"); + else JSKitLib.addClass(text,"js-uploadGreyDescr"); + } + var jsipe = new JSIPE2({obj: elem, + property: 'descr', + title: 'Description', + defaultText: 'Add caption', + width: '90px', + maxLength: 80, + hideApplyBtn: true, + jsk$wasEdited: wasEdited + }); + text.appendChild(jsipe.div); + var onEditBtnClick = function(e){ + if(jsipe.editMode) jsipe.editMode(e); + JSKitLib.stopEventPropagation(e || window.event); + } + var onDeleteBtnClick = function(e){ + img.parentNode.removeChild(img); + if(imgs && imgs[i]) imgs.splice(i, 1); + JSKitLib.stopEventPropagation(e || window.event); + } + var editBtn = s.crImgCtrl("edit", {top: "60px", left: "15px"}, onEditBtnClick); + var deleteBtn = s.crImgCtrl("delete", {top: "60px", left: "57px"}, onDeleteBtnClick); + var displayMode = function(mode){ + editBtn.style.display = mode; + deleteBtn.style.display = mode; + } + img.onmouseover = function(e) { displayMode("inline"); } + img.onmouseout = function(e) { displayMode("none"); } + s.addChild(img, editBtn); + s.addChild(img, deleteBtn); + if(elem.descr == "") JSKitLib.addClass(text,"js-uploadGreyDescr"); + } else { + text.innerHTML = elem.descr.replace(//g,">"); + } + thumb.title = JSKitLib.htmlUnquote(elem.descr); + s.addChild(img, text); + s.addChild(content, img); + } + JSKitLib.map(crImg,imgs); + s.addChild(content, JSKitLib.html('
        ')); + + return content; +} + +JSCC.prototype.crImgCtrl = function(type, position, onClick) { + var btn = this.cr("div"); + var ctrlBtn = { width : "30px", height : "30px", imgWidth : "30px", imgHeight : "30px" }; + JSKitLib.setStyle(btn, "display:none; background:transparent; position:absolute; float:left; padding:0; margin:0; " + + "width:" + ctrlBtn.width + "; height:" + ctrlBtn.height + "; cursor: pointer;" + + "top:" + position.top + "; left:" + position.left); + btn.title = $JCL(type + "Image"); + btn.onclick = onClick; + imgUrl = this.uriDomain + "/images/" + "avatar-" + type + ".png"; + JSKitLib.addPNG(btn, imgUrl); + + return btn; +} + + +JSCC.prototype.addImage = function(img) { + if(this.lbliChange) this.lbliChange(0); + if (typeof(img) == "object"){ + if (img.error) { + switch (img.error) { + case 'big_image': + alert($JCL('imgUploadErrorBigImage')); + break; + case 'wrong_format': + alert($JCL('imgUploadErrorWrongFormat')); + break; + case 'internal_error': + default: + alert($JCL('imgUploadErrorInternal')); + } + return; + } + if (this.images) this.images.push(img) + else this.images = [img]; + if (!this.imgArea) return; + JSKitLib.removeChildren(this.imgArea); + var content = this.createImages(this.images, true); + this.addChild(this.imgArea, content); + } +} + +JSCC.prototype.viewControl = function(sel) { + var s = this; + var ap = { "usr": "yes" }; + switch(sel.name) { + case "jss-srt": + var newSortBy = sel.options[sel.selectedIndex].value; + if(newSortBy == s.config.sort) return true; + s.config.sort = newSortBy; + s.showProgress('ctWnd', true); + break; + case "jss-rev": + var backwardsNewStatus = sel.selectedIndex?'yes':'no'; + if(s.config.backwards == backwardsNewStatus) return true; + s.config.backwards = backwardsNewStatus; + s.showProgress('ctWnd', true); + break; + case "jss-prs": + var newThr = sel.options[sel.selectedIndex].value == 'flat' ? 'no' : 'yes'; + if(newThr == s.config.thread) return true; + s.config.thread = newThr; + s.showProgress('ctWnd', true); + break; + case "search": + ap.srch = s.searchString; + break; + case "del-line": + break; + default: return false; + } + s.dataLoader = function() { + this.showProgress('ctWnd', false); + this.curPage = 0; + this.displayPage(1); } + if(this.curPage) { + var p = this.jspg.getPage(this.curPage - 1); + if(p && p.target && p.target.parentNode) + p.target.parentNode.removeChild(p.target); + } + s.ctag = null; + ap.opts = s.config.sort+'|'+(s.config.backwards == "yes" ? "desc" : "asc")+'|'+(s.config.thread == "yes" ? "thr" : "flat"); + s.getpages(0, ap); + return true; +} + +JSCC.prototype.placeAvatar = function(obj, div) { + div = div || obj.avatarPlace; + if(!div) return; + + if(this.getSkin() != 'echo' && !obj.avatar && !obj.GravatarID) { + obj.avatarPlace = div; + return; + } + var container = { + "instance": div, + "width": obj.avatarPlaceWidth, + "height": obj.avatarPlaceWidth + }; + this.appendAvatarImage(container, obj); + this.appendProfileHandler(div, obj); + return div; +} + +JSCC.prototype.appendAvatarImage = function(container, obj) { + var self = this; + obj = obj || {}; + var avtCtrl = this.avatarsManager; + var data = obj.avatar ? + {"name": obj.avatar, "width": obj.avatarWidth, "height": obj.avatarHeight} : + avtCtrl.anonymousAvatarData(); + + var avatar = avtCtrl.calcAvatarDim(container, data); + avatar.name = obj.GravatarID ? + avtCtrl.getGravatarURL(obj.GravatarID, this.maxAvatarDims) : + avtCtrl.avatarURL(avatar.name); + avatar.onerror = function() { + this.onerror = null; + self.appendAvatarImage(container); + } + avtCtrl.assembleAvatar(container, avatar); +} + +JSCC.prototype.placeProcessAvatar = function(div) { + if(!div) return; + JSKitLib.removeChildren(div); + JSKitLib.addPNG(div, '//cdn.js-kit.com/images/progress-wg.png'); + JSKitLib.addStyle(div, "width: 15px; height: 15px;"); +} + +JSCC.prototype.refreshComments = function(params) { + var s = this; + params = params || {}; + s.deleteWelcomePanel(); + s.hideExpirationBanner(); + s.invalidateJSPG(); + s.objById = {}; + if (s.curPage == 1) s.curPage = 0; + s.displayPage(1, function() { + if (!s.isSourceAvailable("Comments")) return; + s.preventAnonymousComments(); + s.makeWelcomePanel(); + s.ShowCommentDialog(s.replyForId, params); + }); +} + +JSCC.prototype.preventAnonymousComments = function() { + var anonymCond = this.anonymousCmt && !this.jskauth.isLogged(); + this.setControlsStateLCF(anonymCond ? "disable" : "enable"); +} + +JSCC.prototype.setControlsStateLCF = function(state, extraControls) { + var s = this; + var disable = state == "disable"; + var disableCtrls = JSKitLib.merge([s.TC['js-CmtText'], s.TC['js-CmtTextEdit'], s.TC['js-Cmtsubmit'], s.TC['js-CmtsubmitEdit'], s.TC['js-CmtcancelEdit'], s.TC['js-CmtName'], s.TC['js-CmtEmail'], s.imgUpload], extraControls || []); + var lockCtrls = [s.TC['js-Cmtsubmit']]; + var imgArea = s.TC['js-commentImageArea']; + + JSKitLib.fmap(disableCtrls, function(V){ if (V) V.disabled = disable; }); + JSKitLib.fmap(lockCtrls, function(V){ if (V) V.btnLocked = (disable) ? "true" : null; }); + if (imgArea) imgArea.disableUpload = disable; +} + +JSCC.prototype.setThirdPartyShare = function() { + var s = this; + var po = s.TC["js-commentPubOptions"]; + if(!po) return; + JSKitLib.removeChildren(po); + var appendSharingControl = function(type, extraElement) { + var identity = s.jskauth.getAuthIdentity(type); + var publish = identity && identity.publish; + var control = JSKitLib.html(''); + control.defaultChecked = !!publish; + control.checked = !!publish; + control.value = control.checked ? "on" : "off"; + control.onchange = function() { + this.value = this.checked ? "on" : "off"; + }; + var label = JSKitLib.html('
        ' + $JCL('shareVia_' + type) + '
        '); + po.appendChild(control); + po.appendChild(label); + if (extraElement) po.appendChild(extraElement); + }; + JSKitLib.fmap(s.jskauth.getIdentities("auth"), function(identity) { + if (identity.can_publish && identity.user) { + var extraElement = (identity.type == "yahoo") ? JSKitLib.html('') : undefined; + appendSharingControl(identity.type, extraElement); + } + }); +} + +JSCC.prototype.wrapJSKAuth = function() { + var s = this; + var tc = s.TC; + var appendAuthSelector = !tc["js-kit-lcf-userInfoWrapper"]; + + if (s.config.nolc) return; + if (!tc['js-AuthAreaWrap']) { + var items = ['js-commentOpenID', 'js-commentInputOpenID', 'js-CmtOpenID', 'js-OpenIDError']; + JSKitLib.fmap(items, function(item) { + if (tc[item]) tc[item].parentNode.removeChild(tc[item]); + }); + if (appendAuthSelector) return; + } + + var authAreaTmpl = + '
        ' + + '
        {Label:leaveCommentAs}
        ' + + '
        ' + + '
        ' + + '[{Label:logout}]' + + '
        ' + + '
        '; + + if (tc['js-commentInputOpenID']) JSKitLib.hide(tc['js-commentInputOpenID']); + + if (appendAuthSelector) { + var authAreaContainer = JSKitLib.html(s.gtmpl(authAreaTmpl)); + tc['js-AuthAreaWrap'].appendChild(authAreaContainer); + JSKitLib.mapClass2Object(tc, authAreaContainer); + } +} + +JSCC.prototype.initAvatarsManager = function(size) { + var s = this; + var so = s.serverOptions; + if (s.avatarsManager) s.avatarsManager.deActivateEvents(); + var identities = JSKitLib.foldl({}, s.jskauth.identities.auth, function(identity, acc) { + if (identity.group != "third_party") return; + acc[identity.type] = { + "title": s.jskauth.getIdentityLabel(identity.type, true), + "action": identity.user ? null : function() { + s.jskauth.show(identity.type); + }, + "authenticated": !!identity.user + }; + }); + var avatars = so.avatars || []; + var addEPBAvatar = function(identity) { + if (JSKitEPB.isExists() && identity) { + var type = 'http://' + s.config.domain; + var index = -1; + JSKitLib.fmap(avatars, function(av, i) { + if (av.type == type) { + index = i; + } + }); + var avatar = JSKitEPB.getValue('Avatar'); + if (avatar) { + if (index < 0) { + JSKitLib.fmap(avatars, function(av) { delete av.chosen; }); + avatars.push({name: avatar, width: 64, height: 64, type: type, params: identity.params, chosen: true}); + } else { + avatars[index].name = avatar; + } + } else if (index >= 0) { + avatars.splice(index, 1); + } + } + } + addEPBAvatar(s.jskauth.getAuthIdentity('epb')); + + var config = { + "id": "comments-" + s.jcaIndex, + "ref": JSKitLib.getRef(s), + "size": size, + "yours": !s.config.nolc, + "layer": s.getSkin() == "smoothgray" ? this.target : undefined, + "target": this.target, + "labels": $JCL, + "avatars": avatars, + "autoSave": false, + "controls": [s.TC["js-Cmtsubmit"]], + "uriAvatar": s.uriAvatar, + "identities": identities, + "gravatarEmail": so.gravatarEmail + }; + return new JSKAvatars(config); +} + +JSCC.prototype.setFormFields = function(fields) { + var s = this; + var tc = s.TC; + var emptyLabels = { + 'Url': $JCL('urlIsOptional'), + 'Email': $JCL('emailIsOptional') + } + + JSKitLib.fmap(fields, function(v, name) { + var o = tc['js-Cmt'+name]; + if(o) { + o.jsk$setdfl = function(val) { + o.style.color = ''; + o.jsk$setdfl = false; + o.jsk$not_specified = false; + o.value = val || ''; + } + if (v) { + o.jsk$setdfl(v); + } else { + o.style.color = '#808080'; + o.value = emptyLabels[name]; + o.jsk$not_specified = true; + } + o.onfocus = function() { if (o.jsk$setdfl) o.jsk$setdfl(); } + } + }); +} + +JSCC.prototype.getThreadHeader = function() { + var s = this; + var header; + if (s.config.skin == 'echo') { + var replacements = { + "Title": s.config["thread-title"], + "CountLabel": $JCL("commentsCountLabel", {"Count": s.serverOptions.pages.tc}) + }; + var template = s.dtHeaderEcho; + JSKitLib.fmap(replacements, function(replacement, pattern) { + template = template.replace(new RegExp("{" + pattern + "}", "g"), replacement); + }); + header = JSKitLib.html(s.gtmpl(template)); + JSKitLib.mapClass2Object(s.TC, header); + if (s.TC["jsk-HeaderInfoBoxImg"]) JSKitLib.addPNG(s.TC["jsk-HeaderInfoBoxImg"], "//cdn.js-kit.com/images/echo.png"); + s.renderPauseIndicator(); + s.renderPauseCounter(); + } else { + header = s.div(); + } + return header; +} + +JSCC.prototype.assembleImagesUploadForm = function(uInp, imgArea) { + var s = this; + var tc = s.TC; + s.imgArea = imgArea; + var handler = function(e){ + e = e || window.event; + if(e.keyCode == 27 || e.which == 27) JSKitLib.preventDefaultEvent(e); + }; + if (uInp && !uInp.ifri){ + var frmi = s.cr('form'); + JSKitLib.setStyle(frmi, "clear: both;"); + JSKitLib.addClass(frmi, "js-uploadImageForm"); + frmi.method = 'post'; + frmi.acceptCharset = 'UTF-8'; + frmi.encoding = 'multipart/form-data'; + frmi.style.margin = "0px"; + var lbli = s.cr('div'); + JSKitLib.addClass(lbli, "js-uploadImageInputLabel"); + s.lbliChange = function(mode) { + JSKitLib.removeChildren(lbli); + lbli.appendChild(JSKitLib.html("" + $JCL(mode ? "loading" : "uploadImage") + "")); + } + s.lbliChange(0); + + params = JSKitEPB.getAsHash({ref: JSKitLib.getRef(s)}); + JSKitLib.fmap(params, function(v, k) { + var item = s.cr('input'); + item.type = 'hidden'; + item.name = k; + item.value = encodeURIComponent(v); + frmi.appendChild(item); + }); + + var upfi = s.cr('input'); + s.imgUpload = upfi; + upfi.disabled = ( s.imgArea && s.imgArea.disableUpload ) ? true : false ; + upfi.type = 'file'; + upfi.name = 'image'; + var formitems = JSKitLib.mapClass2Object({}, frmi); + var val; + var fi = function() { + if(val) { + var subi = s.TC["js-Cmtsubmit"]; + subi.disabled = false; + upfi.disabled = false; + frmi.reset(); + JSKitLib.fmap(params, function(v, k) { + formitems[k].value = encodeURIComponent(v); + }); + JSKitLib.removeEventHandler(document, ["keydown"], handler); + s.getImages(val); + val = undefined; + } + } + var tgti = 'js-ifrm-'+s.jcaIndex + Math.random(); + var ifri = JSKitLib.createHiddenIframe(tgti, uInp, fi, false); + frmi.target = tgti; + upfi.onchange = function() { + val = (new Date()).getUTCMilliseconds() + "-" + Math.random( ); + frmi.action = s.uriImage+'add?rnd='+val; + s.lbliChange(1); + frmi.submit(); + var subi = s.TC["js-Cmtsubmit"]; + subi.disabled = true; + upfi.disabled = true; + JSKitLib.addEventHandler(document, ["keydown"], handler); + }; + uInp.appendChild(lbli) + frmi.appendChild(upfi); + uInp.appendChild(frmi); + uInp.ifri = ifri; + } + s.preventAnonymousComments(); +} + +JSCC.prototype.assembleEchoBrand = function() { + var template = + '
        ' + + '' + + '
        ' + + '
        '; + return JSKitLib.toDOM(template, "js-poweredBy-", {}).content; +} + +JSCC.prototype.isSourceAvailable = function(source) { + var filter = this.sourceFilter; + if (!filter || !this.useEcho()) return true; + source = filter.normalize(source); + var sourceInList = filter.sources.hash.hasOwnProperty(source); + return sourceInList ? filter.sources.hash[source] : filter.type == "exclude"; +} + +JSCC.prototype.avatarsManagerWrapper = function(element) { + this.avatarsManager.assembleAvatarArea(element); +} + +JSCC.prototype.dataLoader = function(so, nc) { + var s = this; + var so = s.serverOptions; + var tc = s.TC; + var d = function(){return s.div.apply(s,arguments);} + + if (this.config.disabled != 'no') return; + + var cc = JSKitLib.html(s.gtmpl(s.utmpl['js-CreateComment'] || (s.config.nolc ? s.dtProfileCreate : s.dtCreate))); + JSKitLib.mapClass2Object(tc, cc); + JSKitLib.attachDescriptors2Elements(tc, "js-kit-lcf-", this); + if (JSKitEPB.isExists()) { + JSKitLib.fmap(['Name', 'Email'], function(field) { + if (tc['js-Cmt' + field]) { + tc['js-Cmt' + field].disabled = true; + } + }); + } + var ec = JSKitLib.html(s.gtmpl(s.dtEditComment)); + JSKitLib.mapClass2Object(tc, ec); + if(s.config.profileLC) { + var cin = tc['js-commentInputName']; + if(cin) cin.style.display = 'none'; + var cie = tc['js-commentInputEmail']; + if(cie) cie.style.display = 'none'; + } + if(so.extraFieldURL) { + var ciu = tc['js-commentInputUrl']; + if (ciu) ciu.style.display = 'block'; + } + var ac = function(name, cb) { + var o = tc['js-'+name]; + if(!o) return; + if(o.tagName == 'A') o.href="javascript:void(0);"; + o.style.cursor = 'pointer'; + o.onselectstart = function() { return false; } + o.onclick = cb; + } + + var uInp = tc['js-uploadImageInput']; + var uInpW = tc['js-uploadImageInputWrapper1']; + + s.clearImgs = function(){ + JSKitLib.removeChildren(s.imgArea); + if(uInpW) uInpW.style.paddingTop = '0px'; + if(uInp && uInp.ifri) { + JSKitLib.removeChildren(uInp); + JSKitLib.hide(uInp); + uInp.ifri = undefined; + } + if(s.images) delete(s.images); + } + + JSKitLib.fmap(['', 'Edit'], function(el, i) { + ac('Cmtsubmit' + el, function() { + s.pause.forced = false; + s.CommentSubmitted(); + return false; + }); + ac('Cmtcancel' + el, function() { + s.clearImgs(); + if(s.onCancel) s.onCancel(); + s.CommentCancelled(); + if (s.useReplyThreadsCollapsing() && s.replyForId) { + var pageNo = s.curPage; + var comment = s.objById[s.replyForId]; + delete s.replyForId; + if (comment) s.markCollapsedReplies(comment); + s.pause.forced = false; + s.curPage = 0; + s.displayPage(pageNo); + } + return false; + }); + }); + if (JSKitLib.isIE()) { + var op = tc['js-commentOptions']; + var sub = tc['js-commentSubmit']; + if (op) op.style.paddingLeft = "3px"; + if (sub) sub.style.paddingLeft = "3px"; + } + + s.anonymousCmt = so.anonymousCmt; + + if (tc["js-commentAvatar"]) s.avatarsManager.assembleAvatarArea(tc["js-commentAvatar"]); + + if (s.getSkin() != 'echo') { + s.setFormFields({'Email': '', 'Url': ''}); + s.wrapJSKAuth(); + } + s.preventAnonymousComments(); + + ac('commentOpenIDLogout', function() { + setTimeout(function(){ + var gfc = s.jskauth.getAuthIdentity("gfc"); + if(gfc && gfc.params.site && gfc.user) { + new JSKitGFC( + JSKitLib.getRef(s), + s.target, + gfc.params.site, + function(){ + this.processLogout(); + }); + } + s.server(s.uriDomain + '/api/session/logout.js', {}); + }, 0); + return false; + }); + if(!tc['js-commentMore']) { + var m = tc['js-CCMore']; + if(m) m.style.display = 'none'; + } + + s.onAddImgButton = function(isShow) { + if(s.commentPostingProcess) { + alert($JCL('messagePostingInProgress')); + return; + } + if(s.config.uploadImages) { + s.imgArea = tc['js-commentImageArea']; + if(uInp && s.imgArea) { + uInp.style.display = isShow ? 'block' : 'none'; + if(uInpW) uInpW.style.paddingTop = isShow ? '15px' : '0px'; + s.imgShow = isShow; + } + } + s.assembleImagesUploadForm(uInp, s.imgArea); + }; + + var uImg = tc['js-uploadImageButton']; + if (uInp) JSKitLib.hide(uInp); + if(uInp && uImg && !s.config.uploadImages) { + JSKitLib.hide(uImg); + JSKitLib.hide(uInp); + } + ac('uploadImageButton', function(){ + s.onAddImgButton(!JSKitLib.visible(uInp)); + }); + + var toggleAvatarArea = function(isVisible) { + JSKitLib.fmap(["Avatar", "AvatarLabel"], function(key) { + var element = tc["js-comment" + key]; + if (!element) return; + JSKitLib[isVisible ? "show" : "hide"](element); + }); + }; + if (s.getSkin() == "") { + toggleAvatarArea(false); + } + var onCommentMore = function(obj, label) { + obj.ashown = !obj.ashown; + JSKitLib.text(obj.ashown ? label.less : label.more, obj, true); + s.onAddImgButton(obj.ashown); + toggleAvatarArea(obj.ashown); + return false; + }; + + ac('commentAddAvatar', function() { + var label = {'less': '-', 'more': '+'}; + return onCommentMore(this, label); + }); + ac('commentMore', function() { + var label = {'less': this.getAttribute("less") || $JCL('less'), + 'more': this.getAttribute("more") || $JCL('more') }; + return onCommentMore(this, label); + }); + + if (!tc["js-commentAvatar"] && (!s.config.uploadImages || tc['js-uploadImageButton'] || !tc['js-uploadImageInput'])) { + JSKitLib.fmap(['js-commentMore', 'js-CCMore'], function(element) { if (tc[element]) JSKitLib.hide(tc[element]); }); + } + + if(so.mmode == "pause" || !s.isSourceAvailable("Comments")) { + var lca = null; + } else { + var lca = d('js-commentControl', s.a(s.JCL('leaveComment'))); + lca.onclick = function() { return s.ShowCommentDialog(); }; + } + + var jmg = d('js-commentControl js-commentTool', JSKitLib.html('@ '), s.a($JCL("controls"))); + jmg.onclick = function() { + var srt = ["date", "name"]; + if(!s.config.moderate && s.scoringEnabled()) srt.push("karma"); + if(s.adminMode) srt.push("status"); + /* s.submitRating check is not good for all the cases */ + if ( $JSKitGlobal.isRatingsAppAvailable() ) srt.push("rating"); + var srtOpts = []; + for(var i = 0; i < srt.length; i++) { + srtOpts.push(''); + } + var bkw = ["ascending", "descending"]; + var bkwOpts = []; + for(var i = 0; i < bkw.length; i++) { + bkwOpts.push(''); + } + var prs = ["on (threaded)", "off (flat)"]; + var prsMap = {'on (threaded)':'yes','off (flat)':'no'} + var prsOpts = []; + for(var i = 0; i < prs.length; i++) { + prsOpts.push(''); + } + var div = s.cr("div"); + div.innerHTML = + "" + + "" + + "" + + "" + + "' + + (s.adminMode && !s.config.moderate?(''):'') + + "
        " + $JCL("sortBy") + '
        " + $JCL("order") + '
        " + $JCL("threading") + '
        " + $JCL("search") + '
        Moderate whole site
        " + this.notShowIfr = true; + s.settingsWindow('ctWnd', this, div); + var obj={'mode': 'form', 'inpSize': '121px', type: 'Search'}; + var form = new JSIPE(obj); + obj.jsk$on_submit_exit = function(){ + s.searchString = form.input.value; + s.viewControl({name: "search"}); + s.hideSettingsWindow('ctWnd'); + } + form.input.value = s.searchString || ""; + if (s.searchString) form.cleaner.style.visibility = "visible"; + var sCell = document.getElementById("js-SearchCell-"+s.jcaIndex); + if (sCell) s.addChild(sCell, form.main); + + return false; + } + s.controls = jmg; + if(nc || s.config.moderate) { + s.controls.reveal = function(){}; + } else { + s.controls.style.display = 'none'; + s.controls.reveal = function(){s.controls.style.display=''} + } + + var pb; + if(so.subs || so.noJunk || so.whitelabel) { + pb = ""; + } else { + if (s.getSkin() != "echo") { + var propLink = JSKitLib.html('Powered by JS-Kit'); + var prop = d('', "(", propLink, ")"); + prop.style.position = 'relative'; + pb = d("js-commentControl js-poweredBy", prop); + } + } + + var ca = d("js-CommentsArea", + (s.config.nolc && !s.IM)?null:d("js-LeaveComment", s.config.moderate || s.IM=='own' ?null:lca, s.IM ? null : jmg, !s.config.nolc ? pb : null, + JSKitLib.html('
        ')), + tc["js-CreateComment"], tc["js-EditComment"]); + this.makeWelcomePanel(); + + if (!so.wysiwyg && so.smiley) { + JSKitLib.fmap(['Text', 'TextEdit'], function(v) { + var sd = s.cr('div'); + sd.style.margin = '3px 0px 0px 3px'; + var text = tc['js-Cmt' + v]; + var processed = {}; + var index = 0; + JSKitLib.fmap(s.smiles, function(el, i) { + if (!processed[el.file]) { + processed[el.file] = 1; + var smile = JSKitLib.html(s.smileTag(el)); + smile.style.display = 'inline'; + smile.style.cursor = 'pointer'; + smile.style.marginRight = '5px'; + smile.onclick = function() { + if (s.getSkin() == "echo" && JHI2.isEmpty(text)) { + JHI2.set(text, i); + } else text.value += ' ' + i; + text.focus(); + if (JSKitLib.isSafari()) { + text.setSelectionRange(text.value.length, text.value.length); + } + }; + sd.appendChild(smile); + } + }); + var element = (s.getSkin() == "echo") ? s.TC[v == "Text" ? "jsk-CommentFormBody" : "jsk-CommentEditFormBody"] : text; + element.parentNode.insertBefore(sd, element.nextSibling); + }); + } + + var pageNavTop = s.config.skin == 'echo' ? null : d('js-PageNavTop'); + var pageNavBottom = d('js-PageNavBottom'); + var header = s.getThreadHeader(); + var thread = d("jsk-ThreadWrapper jsk-PrimaryFont jsk-PrimaryBackgroundColor", pageNavTop, d("js-OldCommentsWrap jsk-StreamWrapper", d("js-OldComments")), pageNavBottom); + s.TC["jsk-ThreadWrapper"] = thread; + if(s.config.backwards == 'yes') { + s.addChild(ca, header); + s.addChild(ca, thread); + } else { + s.addChild(ca, thread, true); + s.addChild(ca, header, true); + } + if (s.getSkin() == "echo" && !so.whitelabel) s.addChild(thread, s.assembleEchoBrand()); + if(s.useEcho()) { + JSKitLib.setMouseEvent(thread, "over", function() { s.setStreamState(true); }); + JSKitLib.setMouseEvent(thread, "out", function() { s.setStreamState(false); }); + } + var pageToDisplay = so.pages.sp; + var dpCB; + if(s.comment_location) { + var obj = s.jspg.getItemById(s.comment_location); + if(obj) { + pageToDisplay = s.jspg.getPageByItemId(s.comment_location) + 1; + dpCB = function() { + if(obj.div) s.flash(obj.div); + }; + } + delete s.comment_location; + } + s.displayPage(pageToDisplay, dpCB); + + var closeControlsPopup = function() { + s.hideSettingsWindow('ctWnd'); + s.hideSettingsWindow('ctBlock'); + } + JSKW$Events.registerEventCallback(undefined, closeControlsPopup, "comments_closeControlsPopup"); + + ca.onclick = function() { + closeControlsPopup(); + JSKW$Events.syncBroadcast("miniProfile_collapseAll"); + } + s.addChild(s.target, ca); + if (lca && !s.config.moderate && (s.config.nolc && s.IM == 'foreign' || (so.expandLeaveCmt && !s.config.noautoexpand)) && !s.config.userProfileComments) { + s.ShowCommentDialog(undefined, {nofocus: true}); + } +} + +JSCC.prototype.objRerender = function(obj, cmt) { + cmt.ctls['js-singleCommentText'].innerHTML = + this.tmpl("{Text}", obj, true); +} + +JSCC.prototype.getLastReply = function(pobjId) { + var pobj = this.jspg.getItemById(pobjId); + var lreplyObj = null; + for(var i=pobj.obj.thread.length-1; i>=0; i--){ + if(pobj.obj.thread[i].status!='D') { + var c = this.jspg.getItemById(pobj.obj.thread[i].ID); + if(c) { + lreplyObj = this.getLastReply(c.obj.ID); + break; + } + } + } + return lreplyObj || pobj; +} + +JSCC.prototype.reCalcPages = function() { + if(this.curPage>this.jspg.pageCount) this.displayPage(this.jspg.pageCount); + this.rePageNavigator(this.jspg.pageCount>0 ? this.jspg.pageCount-1 : undefined); +} + +JSCC.prototype.appendConversation = function (cmt, conversation) { + var cnvsObj = {}; + var cnvs = this.conversations[conversation]; + if(!cnvs) return; + JSKitLib.fmap(["Name","avatar","avatarHeight","avatarWidth"], + function(V){ cnvsObj[V] = cnvs.direction=="in" ? cnvs[V] : cnvs["dest"+V] }); + cnvsObj.Label = "Conversation with "; + var dtc = JSKitLib.html(this.tmpl(this.dtConversation, cnvsObj)); + var ctls = JSKitLib.mapClass2Object({}, dtc); + var nm = ctls['js-ConversationName']; + if(nm && this.serverOptions.showProfile) { + nm.style.textDecoration = 'underline'; + this.appendProfileHandler(nm, {profile: cnvs.profile}); + } + cmt.insertBefore(dtc, cmt.firstChild); + JSKitLib.addClass(cmt, "js-singleCommentConversationHead"); +} + +JSCC.prototype.removeConversation = function (cmt) { + JSKitLib.removeClass(cmt, "js-singleCommentConversationHead"); + cmt.removeChild(cmt.firstChild); +} + +JSCC.prototype.appendConversationChild = function (cmt) { + JSKitLib.addClass(cmt, "js-singleCommentConversationChild"); +} + +JSCC.prototype.removeConversationChild = function (cmt) { + JSKitLib.removeClass(cmt, "js-singleCommentConversationChild"); +} + +JSCC.prototype.getSkin = function() { + return this.config.skin==="wireframe" ? "" : (this.config.skin || ""); +} + +JSCC.prototype.generateEventParams = function(extra_params) { + extra_params = extra_params || {}; + var s = this; + var params = { + jcaIndex: s.jcaIndex, + uniq: s.config.path.replace(/^\//, ''), + domain: s.config.domain + }; + JSKitLib.fmap(extra_params, function(v, k) { + params[k] = v; + }); + return params; +} + +JSCC.prototype.publishEvent = function(event_name, params) { + JSKitAPI.publish(event_name, + this.generateEventParams(params)); +} + +JSCC.prototype.eventsHandler = function(eventName, eventParams) { + var self = this; + var so = self.serverOptions; + eventParams = eventParams || {}; + switch (eventName) { + case "comment-deleting": + var item = self.jspg.getItemById(eventParams.cmtId); + if(!item || !item.div) return; + var div = item.div; + if(div.domCtls) div.domCtls.style.visibility = "hidden"; + var av = div.ctls['js-singleCommentAvatar']; + self.placeProcessAvatar(av); + item.obj.origstatus = item.obj.status; + item.obj.status = 'DP'; + item.obj.dTimer = setTimeout(function(){ + item.obj.status = 'A'; + if(div.domCtls) div.domCtls.style.visibility = ""; + if(av) self.placeAvatar(item.obj, av); + delete item.obj.dTimer; + }, 30000); + break; + + case "comment-deleted": + var item = self.jspg.getItemById(eventParams.cmtId); + if(!item || !item.div) return; + var div = item.div; + if(item.obj.dTimer) clearTimeout(item.obj.dTimer); + if(item.obj.ParentID) { + var parentCmt = self.objById[item.obj.ParentID]; + if (parentCmt) { + parentCmt.thread = JSKitLib.filter(function(obj) { + return obj.ID != eventParams.cmtId; + }, parentCmt.thread); + } + self.markCollapsedReplies(self.objById[eventParams.cmtId]); + } else { + if (self.useReplyThreadsCollapsing()) { + self.removeRepliesExpandMarker(item.obj); + } + } + so.pages.tc -= self.removeComment(div, true); + self.publishEvent("comments-count-updated", {'count': so.pages.tc}); + break; + + case "comment-added": + so.pages.tc++; + self.publishEvent("comments-count-updated", {'count': so.pages.tc}); + break; + + case "comments-data-loaded": + self.publishEvent("comments-count-updated", {'count': so.pages.tc}); + break; + + case "comments-count-updated": + self.refreshThreadHeader(); + if(self.popupInstance) { + var title = self.replaceCountTemplate(self.config['popup-title'], + eventParams.count); + self.popupInstance.updateTitle(title); + } + if(self.parentWidget && self.parentWidget.popupLink) { + self.drawCommentLink.call(self.parentWidget, eventParams.count); + } + break; + case "user-login": + if (self.config['display-mode'] == "inline") { + var nofocus = typeof(eventParams.nofocus) == "undefined" + || eventParams.nofocus; + self.refreshComments({"nofocus": nofocus}); + } + break; + case "user-logout": + if (self.config['display-mode'] == "inline") { + var nofocus = typeof(eventParams.nofocus) == "undefined" + || eventParams.nofocus; + JSKW$Events.invalidateContext(self.miniProfileCtx); + setTimeout(function(){ + self.refreshComments({"nofocus": nofocus}); + }, 0); + } + break; + } +} + +JSCC.prototype.refreshThreadHeader = function() { + var hdr = this.TC['jsk-HeaderWrapper']; + if(hdr && hdr.parentNode) { + hdr.parentNode.replaceChild(this.getThreadHeader(), hdr); + this.addAdminMenu(this.TC['jsk-MenuAdmin']); + } +} + +JSCC.prototype.makeWelcomePanel = function() { + var s = this; + if (s.jcaIndex) return; + if (!s.adminMode) { + s.deleteWelcomePanel(); + return; + } + if (s.TC['js-WelcomePanel'] || s.config.moderate || s.config.nolc) return; + + var wp_html = '' + + ''; + var wp = JSKitLib.html(s.gtmpl(wp_html)); + JSKitLib.mapClass2Object(s.TC, wp); + s.TC['js-WelcomePanelClose'].onclick = function() { + s.TC['js-WelcomePanel'].style.display = 'none'; + if (s.serverOptions.welcome && s.serverOptions.welcome.ts) { + s.server('s-welcome-close', {'ts': + s.serverOptions.welcome.ts}); + } + } + s.appendProfileHandler(s.TC['js-WelcomeProfileLink'], {profile: s.serverOptions.profile}); + JSKitLib.addPNG(s.TC['js-WelcomePanelArrow'], s.uriDomain + "/images/welcome/triangle.png"); + var lc = s.TC['js-LeaveComment']; + if (lc) lc.parentNode.insertBefore(wp, lc); +} + +JSCC.prototype.deleteWelcomePanel = function() { + if (this.TC['js-WelcomePanel']) { + this.TC['js-WelcomePanel'].parentNode.removeChild(this.TC['js-WelcomePanel']); + delete this.TC['js-WelcomePanel']; + } +} + +JSCC.prototype.addMenu = function(cmt, obj) { + var self = this; + var showOffensive = this.serverOptions.commod && !obj.yours && !this.config.nolc && (!obj.msgtype || !obj.msgtype.match(/T|P/) || this.serverOptions.trackbackreply); + var showProfile = obj.profile && self.serverOptions.showProfile && !(obj.msgtype && obj.msgtype.match(/T|P/)) && !this.config.nolc; + var cmtURL = ((obj.permalink || this.config.permalink).replace(/#jsid-*/, "") + "#") + obj.ID; + var data = [ + {title: $JCL("showUserProfile"), action: function() {self.showProfile(cmt.firstChild, obj);}, hidden: !showProfile, icon: this.uriDomain + "/images/menu/show-user-profile.png"}, + {title: $JCL("markAsOffensive"), icon: this.uriDomain + "/images/menu/mark-comment-as-offensive.png", action: function(){self.markOffensive(obj.ID)}, hidden: !showOffensive}, + {title: $JCL("getPermalinkURL"), icon: this.uriDomain + "/images/menu/comment-permalink.png", inputValue: cmtURL, type: "DTI"} + ]; + if (!this.serverOptions.whitelabel) { + data.push({type: "Delimeter"}); + data.push({title: $JCL("getWidgetLikeThis"), action: function() { window.open("http://js-kit.com/comments?menu", "_blank");}, statusText: "http://js-kit.com/comments?menu"}); + } + var mtgt = this.config.nolc ? self.target.parentNode.parentNode : undefined; + return JSMenu($JCL("options"), data); +} + +JSCC.prototype.addAdminMenu = function(container) { + if (!container) return; + var s = this; + var so = s.serverOptions; + var isEPB = JSKitEPB.isExists(); + var isLogged = s.jskauth.isLogged(); + var isCmtAvailable = s.isSourceAvailable("Comments"); + var showProfile = function() { + s.showProfile(container, {"profile": so.profile}, {"activeSection": "editProfile"}); + }; + var mkItem = function(label, icon, action, guard, extra) { + return guard ? JSKitLib.foldl({ + "icon": icon ? '//cdn.js-kit.com/images/menu/' + icon : undefined, + "title": $JCL("menu" + label), + "action": action + }, extra || {}, function(value, acc, key) { acc[key] = value; }) : []; + }; + var mkLink = function(label, icon, url, guard, disabled) { + return mkItem(label, icon, function() { window.open(url, '_blank'); }, guard, { + "disabled": disabled, + "statusText": url + }); + }; + var mkDelimeter = function(guard) { + return guard ? {"type": "Delimeter"} : []; + }; + var items = JSKitLib.merge( + mkItem("Logout", "key.png", function() { s.jskauth.logout(); }, + !isEPB && isLogged && isCmtAvailable), + mkItem("Login", "key.png", function() { s.jskauth.show(); }, + !isEPB && !isLogged && isCmtAvailable), + mkItem("EditProfile", "user-edit.png", function() { showProfile(); }, + so.showProfile && isCmtAvailable && !so.isNullSession), + mkItem("Follow", "follow.png", function() { s.openFollowPopup(); }, + !isEPB && isCmtAvailable, {"disabled" : so.anonymousCmt && !isLogged}), + mkDelimeter(isCmtAvailable), + mkLink("Moderation", "comment-edit.png", s.uriDomain + "/moderate/", + isCmtAvailable, !so.adminMode), + mkLink("Settings", "wrench.png", s.uriDomain + "/settings/", + isCmtAvailable, !so.adminMode), + mkLink("AdminNotices", null, "http://blog.js-kit.com/tag/admin/", + isCmtAvailable, !so.adminMode), + mkDelimeter(isCmtAvailable && !so.whitelabel), + mkLink("GetThis", "script-code.png", s.uriDomain + "/comments?menu", + !so.whitelabel), + mkLink("JSKBlog", "newspaper.png", "http://blog.js-kit.com/", + !so.whitelabel), + mkLink("JSKTwitter", "twitter-favicon.png", "http://twitter.com/echoenabled", + !so.whitelabel), + mkLink("Help", "information.png", s.uriDomain + '/support/', + !so.whitelabel) + ); + if (!items.length) { + JSKitLib.removeChildren(container); + return; + } + JSKitLib.replaceChildren(container, JSMenu($JCL("menuAdmin"), items, "", s.target)); +} + +JSCC.prototype.getSelectedIdentities = function() { + var self = this; + var format = function(type, prefix, filter) { + return JSKitLib.fmap(self.jskauth.getIdentities(type), function(identity) { + if (!filter || filter(identity)) { + var flag = identity.use_as_from ? "checked" : "unchecked"; + return [prefix + identity.type, identity.url || '', flag, false]; + } + }); + } + var identities = JSKitLib.merge( + format("auth", "login-", function(identity) { return !!identity.user; }), + format("web", "")); + return JSKitLib.Object2JSON(identities); +} + +JSCC.prototype.constructFromToButtons = function(type) { + var template = + '
        ' + + '
        ' + + '
        ' + $JCL(type) + '
        ' + + '
        ' + + '
        '; + var descriptors = { + "BarExpandMarker" : function(element){ JSKitLib.addPNG(element, "//cdn.js-kit.com/images/common/arrow-down-10x10.png") } + }; + return JSKitLib.toDOM(template, "jskit-GoogleLikeMenu", descriptors).content; +} + +JSCC.prototype.fromMenuAnonymous = function() { + var self = this; + var template = + '
        ' + + '
        ' + + '
        ' + + '
        ' + + '
        '; + var updateAnonymousURL = function(url) { + if (typeof url == "object") url = url[1]; + self.extraFormFields["Url"] = url; + }; + var identities = JSKitLib.fmap(self.jskauth.getIdentities("auth"), function(identity) { + return { + "icon": JSKAuth.prototype.getIdentityParam('favicon', identity, "//cdn.js-kit.com/images/favicons/" + identity.type + ".png"), + "type": "Checkbox", + "state": "disabled", + "title": JSKAuth.prototype.getIdentityParam('long_label', identity, JSKAuth.prototype.getIdentityLabel(identity.type, true)), + "action": function() { self.jskauth.show(identity.type); } + }; + }); + var items = JSKitLib.merge( + {"type": "HTML", "title": JSKitLib.html('
        ' + $JCL("Iam") + '
        ')}, + identities, + self.serverOptions.extraFieldURL ? [ + { + "type": "HTML", + "title": JSKitLib.html('
        ' + $JCL("myWebsites") + '
        '), + "hidden": self.serverOptions.anonymousCmt + }, + { + "type": "SRCheckbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "title": self.extraFormFields["Url"] || $JCL("myURL"), + "oncreate": updateAnonymousURL, + "onupdate": updateAnonymousURL, + "deletable": false, + "unclonable": true, + "hideCheckbox": true, + "hidden": self.serverOptions.anonymousCmt + } + ] : [], + {"type": "HTML", "title": JSKitLib.html('')} + ); + var menu = JSMenu(self.constructFromToButtons("from"), items, "HTML"); + var descriptors = { + "control": function() { + return menu; + }, + "field": function(element) { + self.renderNameField(element, "js-kit-from-name"); + if (self.serverOptions.anonymousCmt) { + JSKitLib.preventSelect(element); + JSKitLib.addEventHandler(element, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + JSKW$Events.syncBroadcast('JSMenu-Opened', menu); + }); + } + } + }; + return JSKitLib.toDOM(template, "js-kit-from-", descriptors).content; +} + +JSCC.prototype.setNameFieldValue = function() { + var input = this.TC["js-CmtName"]; + if (!input) return; + JHI2.remove(input); + input.value = (!JHI2.isEmpty(input) && input.value) || this.extraFormFields["Name"] || ""; + JHI2.create(this.serverOptions.requireUsername ? $JCL("yourNameRequired") : $JCL("yourNameHere"), input); +} + +JSCC.prototype.renderNameField = function(container, className, readonly) { + var element; + var anonymousCondition = this.serverOptions.anonymousCmt && !this.jskauth.isLogged(); + if (readonly || anonymousCondition) { + var text = this.extraFormFields["Name"] || ""; + if (anonymousCondition) { + text = $JCL("loginRequiredNotice"); + JSKitLib.addClass(container, "js-kit-disabledNameField"); + } + element = JSKitLib.html("
        " + text + "
        "); + } else { + element = JSKitLib.html(""); + if(this.TC) this.TC["js-CmtName"] = element; + JSKitLib.addEventHandler(container, ["click"], function(e) { + JSKitLib.stopEventPropagation(e); + element.focus(); + }); + element.title = $JCL("clickToEdit"); + this.setNameFieldValue(); + } + JSKitLib.replaceChildren(container, element); +} + +JSCC.prototype.fromMenuActionsHandler = function(identity, action, data) { + var self = this; + var rerenderUserInfo = function() { + self.userInfoWrapper(self.TC["js-kit-lcf-userInfoWrapper"]); + } + var rerenderLinksIcon = function() { + self.miniProfile.render("siteLinksIcons", {"identities": self.jskauth.getIdentities()}); + } + switch (action) { + case "delete": if (identity.group == "web") { + self.jskauth.identityServerAction("unbind", identity, {}, rerenderLinksIcon); + break; + }; + case "delete": + var loggedCount = JSKitLib.foldl(0, self.jskauth.getIdentities("auth"), function(identity, acc) { + return acc += identity.user ? 1 : 0; + }); + var firstConfirmed; + if ( + (firstConfirmed = confirm($JCL("confirmMessage_unbindAccount"))) && loggedCount > 1 + || firstConfirmed && loggedCount == 1 && confirm($JCL("confirmMessage_unbindLastAccount")) + ) { + self.jskauth.identityServerAction("unbind", identity, {}, rerenderUserInfo); + } + break; + case "create": + self.jskauth.identityServerAction("bind", identity, {}, rerenderLinksIcon); + break; + case "update": + self.jskauth.identityServerAction("update", identity, {url: data[1]}, rerenderLinksIcon); + break; + case "check": + identity.use_as_from = true; + rerenderLinksIcon(); + break; + case "uncheck": + identity.use_as_from = false; + rerenderLinksIcon(); + break; + } +} + +JSCC.prototype.fromMenuLoggedIn = function() { + var self = this; + var identities = {"auth": {}, "web": {}}; + var applyCallbacks = function(item) { + JSKitLib.fmap(["check", "uncheck", "delete", "update", "create"], function(action) { + item["on" + action] = function(data) { + if (!this.identity) + this.identity = self.jskauth.assembleIdentity(data, "home", "web"); + self.fromMenuActionsHandler(this.identity, action, data); + } + }); + return item; + } + var validateURLs = function(url) { + if(!url) { + alert($JCL("urlIsEmpty")); + return false; + } + for(var i = 0; i < this.parent.items.length; i++) { + if(this.parent.items[i].title == url && this.parent.items[i] != this) { + alert($JCL("urlAlreadyExists")); + return false; + } + } + return true; + } + identities.auth = JSKitLib.fmap(this.jskauth.getIdentities("auth"), function(identity) { + var state; + if (!identity.user) { + state = "disabled"; + } else if (identity.use_as_from) { + state = "checked"; + } else { + state = "unchecked"; + } + return applyCallbacks({ + "type": "Checkbox", + "icon": JSKAuth.prototype.getIdentityParam('favicon', identity, "//cdn.js-kit.com/images/favicons/" + identity.type + ".png"), + "state": state, + "title": identity.url, + "action": state == "disabled" ? function() { self.jskauth.show(identity.type); } : null, + "identity": identity, + "displayTitle": (function(){ + if(identity.user) { + var Name; + if(identity.group == "epb" && JSKitEPB.isExists()) + Name = JSKitEPB.getValue("Name"); + Name = Name || identity.name || identity.user; + return Name + " @ " + JSKAuth.prototype.getIdentityParam('short_label', identity, JSKAuth.prototype.getIdentityLabel(identity.type)); + } else { + return JSKAuth.prototype.getIdentityParam('long_label', identity, JSKAuth.prototype.getIdentityLabel(identity.type, true)); + } + }()), + "deletable": identity.user && identity.group != 'epb', + "deleteLabel": $JCL("menuUnbindIdentity") + }); + }); + identities.web = JSKitLib.fmap(this.jskauth.getIdentities("web"), function(identity) { + return applyCallbacks({ + "type": "SRCheckbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "state": identity.use_as_from ? "checked" : "unchecked", + "title": identity.url, + "identity": identity, + "alreadyEdited": true + }); + }); + var items = JSKitLib.merge( + {"type": "HTML", "title": JSKitLib.html('
        ' + $JCL("Iam") + '
        ')}, + identities.auth, + self.serverOptions.extraFieldURL ? JSKitLib.merge( + { + "type": "HTML", + "title": JSKitLib.html('
        ' + $JCL("myWebsites") + '
        ') + }, + identities.web, + applyCallbacks({ + "type": "SRCheckbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "title": $JCL("myURL"), + "hideCheckbox": true + }) + ) : [], + {"type": "HTML", "title": JSKitLib.html('')} + ); + return JSMenu($JCL("addAnotherSite"), items); +} + +JSCC.prototype.toMenu = function() { + var self = this; + var share = function(identity, publish) { + identity.publish = publish; + self.extraFormFields["Share-" + identity.type] = publish ? "on" : "off"; + } + var sharingServices = JSKitLib.fmap(this.jskauth.getIdentities("auth"), function(identity) { + if (!identity.can_publish) return; + self.extraFormFields["Share-" + identity.type] = "off"; + var sharing_available = identity.user && !identity.expired; + return { + "type": "Checkbox", + "icon": "//cdn.js-kit.com/images/favicons/" + identity.type + ".png", + "title": $JCL("shareWith_" + identity.type), + "state": sharing_available ? (identity.publish || self.$temp_publish == identity.type ? "checked" : "unchecked") : "disabled", + "action": sharing_available ? null : function() { + self.$temp_publish = identity.type; + self.jskauth.show(identity.type); + }, + "oninit": function() { + if (sharing_available && (identity.publish || self.$temp_publish == identity.type)) this.oncheck(this.title); + }, + "oncheck": function(title) { + var item = this; + share(identity, true); + item.dt = cnt.insertBefore( + JSDogtag({ + "text": title, + "icon": "//cdn.js-kit.com/images/favicons/" + identity.type + ".png", + "onclose": function() { + item.setState("unchecked"); + cnt.removeChild(item.dt); + share(identity, false); + } + }), + cnt.lastChild); + }, + "onuncheck": function(title) { + share(identity, false); + if (this.dt) cnt.removeChild(this.dt); + } + }; + }); + var items = JSKitLib.merge( + {"type": "HTML", "title": JSKitLib.html('
        ' + $JCL("shareWith") + '
        ')}, + { + "type": "Checkbox", + "icon": "//cdn.js-kit.com/images/favicons/default.png", + "title": $JCL("thisPage"), + "state": "checked-disabled" + }, + sharingServices, + {"type": "HTML", "title": JSKitLib.html('')}); + + var cnt = JSKitLib.cr({className: "js-kit-lcf-toField"}); + cnt.appendChild(new JSDogtag({"text": $JCL("thisPage"), "icon": "//cdn.js-kit.com/images/favicons/default.png"}, cnt)); + cnt.appendChild(JSKitLib.html('
        ')); + var menu = JSMenu(self.constructFromToButtons("to"), items, "HTML"); + cnt.insertBefore(menu, cnt.firstChild); + JSKitLib.addEventHandler(cnt, ['click'], function(e) { + JSKitLib.stopEventPropagation(e); + JSKW$Events.syncBroadcast('JSMenu-Opened', menu); + }); + delete this.$temp_publish; + return cnt; +} + +JSCC.prototype.miniProfileWrapper = function(target) { + var self = this; + var so = this.serverOptions; + var avatar = this.avatarsManager.getActiveAvatar() || this.avatarsManager.anonymousAvatarData(); + this.miniProfileCtx = JSKW$Events.registerEventCallback(undefined, function(name, newSites) { + if (!self.serverOptions.extraFieldURL) return; + self.jskauth.setWebIdentities(JSKitLib.fmap(newSites, function(site) { + return self.jskauth.assembleIdentity(site.data[1], site.data[0], 'web'); + })); + self.miniProfile.render("addAnotherSite"); + self.miniProfile.render("siteLinksIcons", {"identities": self.jskauth.getIdentities()}); + }, "profile_socialSitesUpdated"); + var descriptors = { + "name": function(element) { + self.renderNameField(element, "js-kit-miniProfile-name-ipe", JSKitEPB.isExists()); + }, + "avatar": function(element) { + self.avatarsManager.assembleAvatarArea(element); + }, + "logout": function(element) { + element.onclick = function() { + if (element.busy) return; + element.busy = true; + JSKitLib.text($JCL("loggingOut"), element, true); + self.jskauth.logout(); + }; + }, + "logoutLink": function(element) { JSKitLib.text($JCL("menuLogout"), element); }, + "logoutIcon": function(element) { JSKitLib.addPNG(element, "//cdn.js-kit.com/images/cross.png"); }, + "addAnotherSite": function(element) { + return self.fromMenuLoggedIn(); + } + }; + var gfc = this.jskauth.getAuthIdentity("gfc"); + if (gfc && gfc.params.site) gfc.params.domain = this.config.domain; + var data = { + "Name": this.getUserProperty("Name", $JCL("guest")), + "profile": so.profile, + "avatarData": avatar, + "identities": this.jskauth.getIdentities() + }; + var config = { + "mode": "embedded", + "labels": $JCL, + "template": this.dtMiniProfileLeaveComment, + "uriDomain": this.uriDomain, + "uriAvatar": this.uriAvatar, + "cssPrefix": "js-kit-lcf-miniProfile", + "avatarSize": {"width": "64", "height": "64"}, + "descriptors": descriptors, + "openFullProfile": function() { self.showProfile(target, data); }, + "isNativeProfileDisabled": !self.serverOptions.showProfile + }; + this.miniProfile = new JSKitMiniProfile(target, data, config); +} + +JSCC.prototype.renderLeaveCommentForm = function() { + var s = this; + if (s.getSkin() != 'echo') { + if (s.TC["js-commentAvatar"]) { + JSKitLib.removeChildren(s.TC["js-commentAvatar"]); + s.avatarsManager.assembleAvatarArea(s.TC["js-commentAvatar"]); + } + return; + } + JSKitLib.fmap(["userInfoWrapper", "extraControlsMenuWrapper"], function(name) { + var element = s.TC["js-kit-lcf-" + name]; + if (element && typeof(s[name]) == "function") s[name](element); + }); +} + +JSCC.prototype.userInfoWrapper = function(target) { + var template = this["dtCreateUserInfo" + (this.jskauth.isLogged() ? "" : "Non") + "Logged"]; + JSKitLib.replaceChildren(target, JSKitLib.toDOM(template, "js-kit-lcf-", this).content); +} + +JSCC.prototype.getRSSUrl = function() { + var config = this.config; + return this.serverOptions.customRSSLink + ? window.location.protocol + "//rss." + config.domain + "/comments" + config.path + : window.location.protocol + "//js-kit.com/rss/" + config.domain + config.path; +} + +JSCC.prototype.openFollowPopup = function() { + var self = this; + var dialog, eventCtx; + if (window.JSKW$currentProfile) { + window.JSKW$currentProfile.hideProfile(); + } + var notifyMode = self.serverOptions.notifyMode; + var followPanel = this.followPanelPopup = this.assembleFollowPanel("popup"); + followPanel.get("rssThreadInput").value = this.getRSSUrl(); + var closeDialog = function() { + dialog.close(); + JSKW$Events.invalidateContext(eventCtx); + delete self.followPanelPopup; + }; + var template = this.gtmpl(this.dtFollowPanelPopup); + var descriptors = { + "content": function() { + return followPanel.content; + }, + "doneButton": function(element, dom) { + element.onclick = function() { + new JSRVC({ + "uri": self.uriDomain + "/manage-email-subscription", + "ref": JSKitLib.getRef(self), + "target": self.target, + "request": { + "p": self.pathOverride, + "mode": self.serverOptions.notifyMode + } + }); + element.value = $JCL("follow_subscriptionInProgress"); + JSKitLib.fmap([ + element, + dom.get("cancelButton") + ], function(control) { + if (control) control.disabled = true; + }); + } + }, + "cancelButton": function(element) { + element.onclick = function() { + closeDialog(); + self.serverOptions.notifyMode = notifyMode; + }; + }, + "editNotifications": function(element) { + element.onclick = function() { + window.open(self.uriDomain + "/settings/pctl.cgi?site=" + self.config.domain); + } + } + }; + var dom = JSKitLib.toDOM(template, "js-kit-follow-popup-", descriptors); + var config = { + "width": 450, + "height": 230, + "cssClass": "js-kit-follow-popup" + }; + dialog = new JSKitModalDialog(dom.content, config); + dialog.open(); + var handleServerResponse = function(eventName, data) { + self.serverOptions.profile = data.profile; + if (data.hasOwnProperty("mode")) { + self.serverOptions.notifyMode = data.mode; + } + self.updateFollowPanel(self.followPanel); + closeDialog(); + } + eventCtx = JSKW$Events.registerEventCallback(undefined, + handleServerResponse, "JSKit_emailSubscription"); +} + +JSCC.prototype.updateFollowPanel = function(dom) { + var self = this; + JSKitLib.fmap(["noemail", "email", "anymails"], function(notifyMode) { + self.setInputState("radio", + dom.get("notifyOptionRadio-" + notifyMode), + self.serverOptions.notifyMode == notifyMode ? "checked" : "unchecked"); + }); +} + +JSCC.prototype.assembleFollowPanel = function(postfix) { + var self = this; + var rssUrl = this.getRSSUrl(); + var template = this.gtmpl(this.dtFollowPanel); + var getEmail = function(emptyEmailLabel) { + return self.extraFormFields["Email"] || emptyEmailLabel; + }; + var descriptors = { + "rssIcon": function(element) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/rss.png"); + }, + "rssThreadInput": function(element) { + element.title = rssUrl; + }, + "rssThreadButton": function(element) { + element.onclick = function() { window.open(rssUrl); }; + }, + "emailAddress": function(element) { + JSKitLib.text(getEmail($JCL("follow_emptyEmail")), element, true); + }, + "editProfileLink": function(element) { + element.onclick = function() { + var profile = window.JSKW$currentProfile; + if (profile && profile.isYours()) return; + setTimeout(function() { + self.showProfile(self.target, + {"profile": self.serverOptions.profile}, + {"activeSection": "editProfile"}); + }, 0); + JSKitLib.text($JCL("follow_openingProfile"), element, true); + JSKitLib.addClass(element, "js-kit-follow-openingProfile"); + }; + }, + "emailIcon": function(element) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/email.png"); + } + }; + JSKitLib.fmap(["noemail", "email", "anymails"], function(mode) { + var notifyOptionHandler = function(element, dom) { + var updateNotifyControlsLayout = function(previousMode) { + if (!getEmail()) { + var link = dom.get("emailAddress"); + var getClass = function(notifyMode) { + return "js-kit-follow-activeNotifyMode-" + notifyMode; + }; + if (previousMode) { + JSKitLib.removeClass(link, getClass(previousMode)); + } + JSKitLib.addClass(link, getClass(mode)); + } + self.updateFollowPanel(dom); + }; + if (self.serverOptions.notifyMode == mode) { + updateNotifyControlsLayout(); + } + element.onclick = function() { + var previousMode = self.serverOptions.notifyMode; + self.serverOptions.notifyMode = mode; + updateNotifyControlsLayout(previousMode); + }; + }; + descriptors["notifyOptionRadio-" + mode] = notifyOptionHandler; + descriptors["notifyOptionLabel-" + mode] = notifyOptionHandler; + }); + return JSKitLib.toDOM(template, "js-kit-follow-", descriptors); +} + +JSCC.prototype.extraControlsMenuWrapper = function(target) { + var self = this; + var container = this.TC["js-kit-lcf-extraControlsMenuContent"]; + if (!container) return; + var tabs = []; + if (this.config.uploadImages) tabs.push({ + "name": "images", + "icon": "//cdn.js-kit.com/images/picture_add.png", + "title": $JCL("addImgText"), + "content": function() { + var template = + '
        ' + + '
        {Label:addImagesSectionNotice}
        ' + + '
        ' + + '
        ' + + '
        '; + var dom = JSKitLib.toDOM(self.gtmpl(template), "js-kit-images-", {}); + self.assembleImagesUploadForm(dom.get("form"), dom.get("list")); + return dom.content; + } + }); + var panel = this.followPanel = this.assembleFollowPanel(); + tabs.push({ + "name": "follow", + "icon": "//cdn.js-kit.com/images/follow.png", + "title": $JCL("follow"), + "callbacks" : { + "onTabOpened": function() { + self.updateFollowPanel(panel); + setTimeout(function() { + panel.get("rssThreadInput").value = self.getRSSUrl(); + }, 0); + }, + "onTabClosed": function() { + panel.get("rssThreadInput").value = ""; + } + }, + "content": function() { + return panel.content; + } + }); + var template = + '
        ' + + '
        ' + + '
        ' + + '
        ' + + '
        ' + + '
        '; + var marker = function(element) { + JSKitLib.addPNG(element, "//cdn.js-kit.com/images/menu/vertical-menu-expand-marker.png"); + }; + this.extraControlsMenu = new JSTabsManager(tabs, { + "titles": target, + "content": container + }, { + "mode": "toggle", + "template": template, + "descriptors": {"expandMarker": marker} + }); +} + +JSCC.prototype.renderSubscribeEvents = function(subscribeEvents) { + var s = this; + if(subscribeEvents.error) { + alert(subscribeEvents.errorDescription); + return; + } + var appliedEvents = 0; + JSKitLib.fmap(subscribeEvents, function(subscribeEvent){ + var item = s.jspg.getItemById(subscribeEvent.ID); + var f; + f = function(operation) { + if(operation=='add') { + if(!item) { + var cmtobj = subscribeEvent.content; + if(cmtobj.ParentID && !s.jspg.getItemById(cmtobj.ParentID)) return; + s.pause.visible = true; + s.renderPauseIndicator(); + if(!s.pause.state) { + cmtobj.ID = subscribeEvent.ID; + if (s.serverOptions.clustering) + cmtobj.ParentID = JSFSearch.search(s.jspg.getItemsToDisplay(), cmtobj); + cmtobj.echoItem = true; + cmtobj.echoItemFirstTime = true; + cmtobj.imgs = s.parseImgData(cmtobj); + s.cmtInPlace(s.prepareCommentObj(cmtobj)); + s.publishEvent('comment-added', {'cmtId': cmtobj.ID}); + appliedEvents++; + } + } else { + f('edit'); + } + } + if(s.pause.state) { + s.pause.queue.push(subscribeEvent); + if(operation=='add') { + s.renderPauseCounter(); + } + return; + } + if(operation=='edit') { + if(item) { + var msgId = subscribeEvent.ID; + var cobj = s.objById[msgId]; + JSKitLib.fmap(subscribeEvent.content, + function(v,k){ + cobj[k] = v; + }); + JSKW$Events.syncBroadcast("smileys-newCommentInDiv", cobj); + s.jspg.invalidateItemView(msgId); + if(s.jspg.getPageByItemId(msgId)==s.curPage-1){ + var pageNo = s.curPage; + s.curPage = 0; + s.displayPage(pageNo); + } + JSKW$Events.syncBroadcast("comment-edited", s.jcaIndex, msgId); + appliedEvents++; + } + } + if(operation=='delete') { + if(item) { + s.postHandlerDelete(item.div); + appliedEvents++; + } + } + if(operation=='like_vote') { + if(item) { + var cobj = s.objById[subscribeEvent.ID]; + cobj.likeInstance.vote(subscribeEvent.content.action, subscribeEvent.content); + } + } + } + f(subscribeEvent.operation); + }); + if(appliedEvents > 0) { + s.reCalcPages(); + s.controls.reveal(); + } +} + +JSCC.prototype.useEcho = function() { + return (this.getSkin() == 'echo') && this.serverOptions.echoLiveUpdates && !this.IM && !this.config.nolc && !this.config.moderate; +} + +JSCC.prototype.useReplyThreadsCollapsing = function() { + return this.useEcho() && this.serverOptions.collapseReplyThreads; +} + +JSCC.prototype.replaceCountTemplate = function(template, count) { + return template.replace(/{Count}/, count); +} + +JSCC.prototype.constructPopupLink = function(count) { + var s = this; + var so = s.serverOptions; + var tmpl = s.utmpl['js-CommentsPopupLink'] || s.dtCommentsPopupLink; + var link = tmpl.replace(/{LinkLabel}/, s.constructCommentsLabel(count, so.countLabels)); + link = s.replaceCountTemplate(link, count); + popupLink = JSKitLib.html(s.gtmpl(link)); + JSKitLib.addEventHandler(popupLink, ['click'], + function(e) { + s.popComments(); + JSKitLib.preventDefaultEvent(e); + }); + return popupLink; +} + +JSCC.prototype.drawCommentLink = function(count) { + var s = this; + if (s.popupLink) { + var oldPopupLink = s.popupLink; + s.popupLink = s.constructPopupLink(count); + s.target.parentNode.replaceChild(s.popupLink, oldPopupLink); + } else { + s.popupLink = s.constructPopupLink(count); + s.target.parentNode.insertBefore(s.popupLink, s.target); + JSKitLib.hide(s.target); + } +} + +JSCC.prototype.constructCommentsLabel = function(c, labels) { + if (typeof window.JSKitCommentsCountFilter == 'function') + return JSKitCommentsCountFilter(c); + labels = labels || ["Comments", "Comments (1)", "Comments ({Count})"]; + switch (c) { + case 0: return labels[0]; + case 1: return labels[1]; + default: return this.replaceCountTemplate(labels[2], c); + } +} + +JSCC.prototype.popComments = function() { + var self = this; + var config = this.config; + switch (config['display-mode']) { + case 'ext-popup': + var wl = window.location; + var url = this.uriDomain + "/api/static/pop_comments?ref=" + + encodeURIComponent(JSKitLib.getRef(self)) + + "&title=" + encodeURIComponent(config['page-title']); + + url += '&' + JSKitLib.fmap(config, function(v, k) { + if (v && !k.match(/^(domain|popup-width|popup-height|display-mode|disabled|noDataRequest)$/)) + return k + "=" + encodeURIComponent(v); + }).join('&'); + + var params = 'width=' + config['popup-width'] + ", height=" + config['popup-height'] + ", status=yes, resizable=yes, scrollbars=yes"; + var w = window.open(url, "js_kit_popup_" + self.jcaIndex, params); + w.focus(); + break; + case 'int-popup': + var divc = this.target.cloneNode(false); + divc.jsk$initialized = false; + var title = this.config['popup-title']; + var popupWidget = new JSCC(divc, {'config': {'display-mode': 'inline'}}); + var popupInstance = new JSKitUniversalContainer(divc, + { + 'mode': 'popup', 'title': self.replaceCountTemplate(title, '0'), + 'backdrop': 'yes', 'opacity': 0.4, + 'size': {'width': config['popup-width'], 'height': config['popup-height']}, + 'cssPrefix': 'js-kit-popupComments', + 'whiteLabel': self.serverOptions.whitelabel + }, + { + 'onContainerBeforeClose': function() { + if (window.JSKW$currentProfile) window.JSKW$currentProfile.hideProfile(); + JSKW$Events.syncBroadcast("comments_closeControlsPopup"); + popupWidget.CommentCancelled(); + } + } + ); + popupWidget.parentWidget = this; + popupWidget.popupInstance = popupInstance; + break; + } +} + +JSCC.prototype.initAuth = function() { + var s = this; + + var old_facebook = s.jskauth && s.jskauth.getAuthIdentity("facebook"); + + if (s.jskauth) s.jskauth.destroy(); + s.jskauth = new JSKAuth({ + ref: JSKitLib.getRef(s), + mode: "popup", + target: s.target, + identities: s.serverOptions.identities, + withBackdrop: "true" + }); + + var facebook = s.jskauth.getAuthIdentity("facebook"); + if (facebook) { + JSKitFBSDK.prototype.detectXD(s.target); + } + if (old_facebook && old_facebook.user + && (!facebook || facebook.user != old_facebook.user)) { + new JSKitFBSDK( + JSKitLib.getRef(s), + old_facebook.params.app_id, + old_facebook.params.xd_receiver, + function() { + this.logout(); + } + ); + } +} + +JSCC.prototype.updateConfigFromServer = function(so) { + var s = this; + JSKitLib.fmap({ + 'display-mode': 'displayMode', + 'popup-title': 'popupTitle', + 'popup-width': 'popupWidth', + 'popup-height': 'popupHeight' + }, function(v, k) { s.config[k] = s.config[k] || so[v]; }); + s.config.skin = s.hasOwnProperty("dtComment") ? s.config.skin : (s.config.skin || so.skin); + s.config['display-mode'] = s.config['display-mode'] || "inline"; +} + +JSCC.prototype.findRootParent = function(comment) { + return (comment && comment.ParentID) ? + this.findRootParent(this.objById[comment.ParentID]) : comment; +} + +JSCC.prototype.assembleExpandRepliesMarker = function(comment) { + var self = this; + var template = + '
        ' + + '
        ' + + '
        ' + + '
        ' + + '
        '; + var descriptors = { + "label": function() { + return JSKitLib.text($JCL("expandXMoreReplies", {"count": comment.extra.collapsedCmtsCount})); + }, + "container": function(element) { + JSKitLib.addStyle(element, "margin-left: " + self.level4margin(1) + ";"); + JSKitLib.setEventHandler(element, ["click"], function() { + var pageNo = self.curPage; + self.markCollapsedReplies(comment, false); + self.curPage = 0; + self.displayPage(pageNo); + }); + } + }; + return JSKitLib.toDOM(template, "js-kit-replies-expand-", descriptors).content; +} + +JSCC.prototype.removeRepliesExpandMarker = function(comment) { + if (!comment.extra.expandMarker) return; + var marker = comment.extra.expandMarker; + if (JSKitLib.hasParentNode(marker)) { + marker.parentNode.removeChild(marker); + delete comment.extra.expandMarker; + } + +} + +JSCC.prototype.markCollapsedReplies = function(comment, collapse) { + if (!this.useReplyThreadsCollapsing()) return; + var self = this; + if (comment.ParentID) { + comment = this.findRootParent(comment); + } + if (!comment) return; + if (typeof(collapse) == "undefined") { + collapse = typeof(comment.extra.areRepliesCollapsed) == "undefined" || + comment.extra.areRepliesCollapsed; + } + var threadWalk = function(cmt, callback, idx) { + if (!idx) idx = 0; + JSKitLib.fmap(cmt.thread, function(reply) { + idx++; + if (callback) callback(reply, idx); + idx = threadWalk(reply, callback, idx); + }); + return idx; + }; + var limits = {"chunk": 2, "full": 5}; + var totalRepliesCount = threadWalk(comment); + threadWalk(comment, function(cmt, idx) { + cmt.extra.collapsed = collapse && + totalRepliesCount > limits.full && + idx - limits.chunk > 0 && + idx + limits.chunk <= totalRepliesCount; + cmt.extra.cssClass = (collapse && totalRepliesCount - idx == limits.chunk - 1) ? + "jsk-ItemWrapper-borderless" : undefined; + + if (cmt.extra.collapsed && cmt.ID == self.replyForId) { + cmt.extra.cssClass = "jsk-ItemWrapper-borderless"; + cmt.extra.collapsed = false; + } + + if (self.jspg) { + self.jspg.invalidateItemView(cmt.ID); + } + }); + var collapsedCmtsCount = totalRepliesCount - limits.chunk*2; + comment.extra.collapsedCmtsCount = collapsedCmtsCount > 0 ? collapsedCmtsCount : 0; + comment.extra.areRepliesCollapsed = collapse; + this.removeRepliesExpandMarker(comment); +} + +JSCC.prototype.newCount = function(count, so) { + var s = this; + s.serverOptions = so; + s.updateConfigFromServer(so); + s.drawCommentLink(count); + s.publishEvent('comments-count-updated', {'count': count}); +} + +/* Must be last to support Opera */ +JSCC.prototype.newData = function(arr, so) { + var s = this; + + s.updateConfigFromServer(so); + + if (s.config['display-mode'] == "inline") { + s.target.style.display = "block"; + s.target.style.visibility = "visible"; + } + JSKitLib.fmap(arr, function(obj) { + obj.Name = obj.Name || $JCL("guest"); + }); + s.serverOptions = so; + s.account = so.account || {}; + s.searchString = so.srch; + s.adminMode = !!so.adminMode; + s.ownerMode = !!so.ownerMode; + s.inlineModeration = (s.adminMode && !s.config.moderate); + + s.initAuth(); + + so.smiley = so.smiley || s.config.smiles == "yes"; + s.config.uploadImages = so.uploadImages; + if (s.useEcho()) { + s.config.backwards = 'yes'; + if (s.extraFormFields["Url"]) { + var identity = s.jskauth.assembleIdentity(s.extraFormFields["Url"], "home", "web"); + s.jskauth.appendIdentity(identity); + } + } + + if(so.TS) + this.serverDiffTS = so.TS - Math.round((new Date()).valueOf() / 1000); + + var dims = { + "form": (s.getSkin() == 'echo') ? '64x64' : '96x96', + "thread": (s.config.nolc || s.getSkin() == 'echo') ? '48x48' : so.avatardim + }; + s.avatarsManager = s.initAvatarsManager(dims.form); + s.maxAvatarDims = s.avatarsManager.splitAvatarDim(dims.thread); + + JSKitLib.addClass(s.target, "js-CommentsSkin-" + (s.getSkin() || "wireframe")); + + switch (s.config.skin) { + case "smoothgray": + s.navSym = JSKitLib.isIE() ? { "prev": '←', "next": '→'} : { "prev": '◀', "next": '▶' }; + if(!s.hasOwnProperty("dtComment")) s.dtComment = JSCC.prototype.dtComment2; + s.dtCreate = JSCC.prototype.dtCreate2; + s.dtEditComment = JSCC.prototype.dtEditComment2; + break; + case "haloscan": + s.dtComment = JSCC.prototype.dtComment3; + s.dtCreate = JSCC.prototype.dtCreate3; + s.dtEditComment = JSCC.prototype.dtEditComment; + if (window.JK$HS$haloscan_style) + JSKitLib.addCss(window.JK$HS$haloscan_style, "comments-skin-haloscan-custom"); + break; + case "echo": + s.dtComment = JSCC.prototype.dtCommentEcho; + s.dtCreate = JSCC.prototype.dtCreateEcho; + s.dtEditComment = JSCC.prototype.dtEditComment; + break; + } + + if (so.smiley) { + s.smiles = { + "O:-)" : {file: 'innocent.gif', title: 'Innocent'}, + ">:o": {file: 'yell.gif', title: 'Yell'}, + ":)" : {file: 'smile.gif', title: 'Smile'}, + ":-)" : {file: 'smile.gif', title: 'Smile'}, + ";)" : {file: 'wink.gif', title: 'Wink'}, + ";-)" : {file: 'wink.gif', title: 'Wink'}, + ":'(" : {file: 'cry.gif', title: 'Cry'}, + "8-)" : {file: 'cool.gif', title: 'Cool'}, + ":(" : {file: 'frown.gif', title: 'Frown'}, + ":-(" : {file: 'frown.gif', title: 'Frown'}, + ":*" : {file: 'kiss.gif', title: 'Kiss'}, + ":-*" : {file: 'kiss.gif', title: 'Kiss'}, + ":-D" : {file: 'laughing.gif', title: 'Laughing'}, + "=-O" : {file: 'surprised.gif', title: 'Surprised'}, + "=-X" : {file: 'sealed.gif', title: 'Sealed'}, + ":-[" : {file: 'embarassed.gif', title: 'Embarassed'}, + ":-$" : {file: 'money-mouth.gif', title: 'Money mouth'}, + ":-P" : {file: 'tongue-out.gif', title: 'Tongue out'}, + ":-E" : {file: 'foot-in-mouth.gif', title: 'Foot in mouth'}, + "*DONT_KNOW*" : {file: 'undecided.gif', title: 'Undecided'} + }; + var f = function(v) { return v.replace(/([\W])/g,"\\$1"); }; + JSKitLib.fmap(s.smiles, function(el, i) { + /* fix for case ">)" */ + s.smiles[i].regexpText = new RegExp('(>|<)?' + f(i), 'g'); + s.smiles[i].regexpTag = new RegExp(' ?' + f(s.smileTag(el)) + ' ?', 'g'); + }); + } + var cb = function(name, obj, jcaIndex) { + switch(name) { + case "smileys-onchangeCommentText": + if(so.smiley && obj && obj.Text) obj.Text = s.textSmiles2Graphical(obj.Text.replace(/&/g, "&")); + break; + case "smileys-beforePostNewComment": + if(so.smiley && obj && obj.value) obj.value = s.textSmiles2Graphical(obj.value, 1); + break; + case "smileys-loadCommentsWidget": + if (s.jcaIndex != jcaIndex) return; + /* no break needed !!! */ + case "smileys-newCommentInDiv": + var needAutolink = (so.htmlMode || s.config.nolc); + if ((so.smiley || needAutolink) && obj && obj.Text) { + obj.Text = obj.Text.split('').join(''); + if (needAutolink) { + var tags; + var tags2meta = function(t){tags = []; t = t.replace(/]*>.*?<\/a>|<.*?>/ig, function(m){tags.push(m); return ' %#HTML_TAG#% ';}); return t;}; + var meta2tags = function(t){JSKitLib.map(function(v){t = t.replace(' %#HTML_TAG#% ', v);}, tags); return t;}; + obj.Text = tags2meta(obj.Text); + obj.Text = obj.Text.replace(/((?:http|ftp|https):\/\/(?:[a-z0-9#:\/\;\?\-\.\+,@&=%!\*\'(){}\[\]$_|^~`](?!gt;|lt;))+)/ig, '$1'); + obj.Text = tags2meta(meta2tags(obj.Text)); + } + obj.Text = obj.Text.replace(/&/g, '&'); + if (so.smiley) obj.Text = s.textSmiles2Graphical(obj.Text); + if (needAutolink) { + obj.Text = meta2tags(obj.Text); + } + obj.Text = obj.Text.replace(/(]*)?([^&<>\s\/\-]{12})([^&<>\s\/\-]{12})/ig, function($0, $1, $2, $3){if($1)return $0; return $2+''+$3;}); + } + break; + } + } + var ctx = JSKW$Events.registerEventCallback(undefined, cb, "smileys-newCommentInDiv"); + JSKW$Events.registerEventCallback(ctx, cb, "smileys-loadCommentsWidget"); + JSKW$Events.registerEventCallback(ctx, cb, "smileys-beforePostNewComment"); + JSKW$Events.registerEventCallback(ctx, cb, "smileys-onchangeCommentText"); + + if(so.req) { + s.config.sort = so.req.srt; + s.config.backwards = so.req.ord == 'desc' ? 'yes' : 'no'; + s.config.thread = ((so.req.prs == 'flat') ? 'no' : 'yes'); + } + + s.gen++; + s.loading = false; + + if(s.ctag != so.tag) { + s.objById = {}; + if(s.jspg) s.invalidateJSPG(); + } + + var flat = (s.searchString) ? true : s.config.thread != 'yes'; + + var ttt = []; // top level thread + var newChildren = {}; + var nc = 0; + JSKitLib.fmap(arr, function(obj) { + if(!obj.ID) return; + if(s.IM && obj.yours) obj.Name = 'Me'; + if(flat) { + delete(obj.ParentID); + delete(obj.depth); + } + s.objById[obj.ID] = obj; + obj.extra = {}; + obj.thread = []; + JSKW$Events.syncBroadcast("smileys-loadCommentsWidget", obj, s.jcaIndex); + obj.karma = new JSCCKarma(obj, s); + if(obj.status != 'D') nc++; + var prn = s.objById[obj.ParentID]; + if(prn) { + if(!newChildren[obj.ParentID]) { + ttt.push(obj); + } + prn.thread.push(obj); + } else { + ttt.push(obj); + } + newChildren[obj.ID] = 1; + obj.imgs = s.parseImgData(obj); + }); + if (s.useReplyThreadsCollapsing()) { + JSKitLib.fmap(ttt, function(cmt) { + s.markCollapsedReplies(cmt, true); + }); + } + s.divPages(so, s.htmlPaginate(ttt)); + + if(this.IM) this.conversations = so.conversations; + + s.ctag = so.tag; + + if (so.wysiwyg) { + if (so.smiley) { + so.allowedHTMLTags.push('img/src', 'img/title', 'img/border', 'img/alt'); + } + var attrsByTag = {}; + JSKitLib.fmap(so.allowedHTMLTags, function(v) { + var p = v.split('/'); + var tag = p[0] || p; + var attr = p[1]; + if (!attrsByTag[tag]) { + attrsByTag[tag] = ["style"]; + } + if (attr) { + attrsByTag[tag].push(attr); + } + }); + var allowedTags = JSKitLib.fmap(attrsByTag, function(attrs, tag) { + return tag + (attrs.length ? '[' + attrs.join('|') + ']' : ''); + }).join(','); + s.tmce = { foreign: true, cfg: { + document_base_url: '//cdn.js-kit.com', + convert_newlines_to_brs: true, + relative_urls: 0, + remove_script_host: 0, + uri_domain: '//cdn.js-kit.com', + width: '100%', + closePopups: function() { + var cns = document.body.childNodes; + var i = 0; + while(i < cns.length) { + if(cns[i].id && cns[i].id.match(/^mce_\d+$/) && cns[i].className.match(/clearlooks2/)) document.body.removeChild(cns[i]); + else i++; + } + }, + bookMark: function() { + tinyMCE.settings.curBM = tinyMCE.activeEditor.selection.getBookmark(); + }, + mode: "none", + plugins: "inlinepopups" + (so.smiley?",emotions":"") + (so.media?",youtube":""), + theme: "advanced", + theme_advanced_buttons1: + "bold,italic,underline,|,undo,redo,link,unlink" + + (so.media?",youtube":"") + (so.smiley?",emotions":""), + theme_advanced_buttons2: "", + theme_advanced_buttons3: "", + theme_advanced_toolbar_location: "top", + theme_advanced_toolbar_align: "left", + valid_elements: allowedTags, + setup: function(ed) { + var setContent = function(ed, value, extra) { + if(JSKitLib.isIE()) { + ed.setContent(value, extra); + tinyMCE.execInstanceCommand(ed.id, 'selectall'); + ed.selection.collapse(0); + } else { + ed.setContent('', extra); + ed.execCommand('mceInsertContent', false, value, extra); + } + }; + JSKitLib.fmap(["onClick","onKeyUp"], function(ev) { + ed[ev].add(function(ed, e){ + tinyMCE.settings.bookMark(); + if (ev == 'onClick') { + JSKW$Events.syncBroadcast('JSMenu-CollapseAll'); + JSKW$Events.syncBroadcast('miniProfile_collapseAll'); + } + }); + }); + if (ed.getElement().smoothWysiwygLoading) { + ed.onBeforeRenderUI.add(function(ed, e) { + var el = ed.getElement(); + el.jsk$cover.parentNode.replaceChild(el.jsk$wrapper, el.jsk$cover); + }); + ed[JSKitLib.getBrowser() == 'gecko' ? 'onInit' : 'onPostRender'].add(function(ed, e) { + var el = ed.getElement(); + JSKitLib.show(el.jsk$wrapper); + if (!el.jsk$nofocus && el.jsk$widget.config.backwards != 'yes') + el.jsk$widget.TC["js-Cmtsubmit"].scrollIntoView(false); + }); + } + if(JSKitLib.getBrowser() == 'gecko') { + ed.onInit.add(function(ed, e) { + var d = ed.getDoc(); + try { + d.designMode = 'on'; + } catch(e) { ; } + }); + } + if (ed.getElement().jsk$hasDefaultValue && (s.jskauth.loginStatus || !s.anonymousCmt)) { + ed.onInit.add(function(ed, e) { + var d = (JSKitLib.getBrowser() == 'gecko' ? ed.getDoc() : ed.getWin()); + tinymce.dom.Event.add(d, 'focus', function(e) { + var el = ed.getElement(); + if (!el.defaultRemoved) { + setContent(ed, '', {format: 'raw', skip_undo: true}); + el.defaultRemoved = true; + } + tinyMCE.settings.auto_focus = el.id; + }); + }); + } + if (!so.smiley) return; + ed.onKeyUp.add(function(ed, e) { + var content = {Text: ed.getContent({format: 'raw'})}; + JSKW$Events.syncBroadcast("smileys-onchangeCommentText", content); + if(tinyMCE.settings.smiley) { + setContent(ed, content.Text, {format: 'raw'}); + } + }); + } + }}; + } + + s.dataLoader(so, nc); + + var showCD = function() { + if(so.ShowSavedCommentDialog) + so.ShowSavedCommentDialog(s); + } + + if(so.wysiwyg && !window.tinyMCE) { + JSKitLib.preloadImg('//cdn.js-kit.com/images/loading.gif'); + var inittmce = function() { + s.tmce.foreign = false; + s.tmce.cfg.plugins = "inlinepopups"+(so.smiley?",emotions":"")+(so.media?",youtube":""); // !inl-pop + s.tmce.cfg.strict_loading_mode = true; + tinyMCE.init(s.tmce.cfg); + showCD(); + } + var oldcb = window.jsk$tmcecb; + if(oldcb) { + window.jsk$tmcecb = function() { if(oldcb) oldcb(); showCD(); }; + } else { + window.jsk$tmcecb = inittmce; + JSKitLib.addScript('//cdn.js-kit.com/extra/tiny_mce/tmce.js', this.target); + } + } else { + showCD(); + } + + var f = s.onDataLoad; + if(f) { s.onDataLoad = null; setTimeout(f, 0); } + s.publishEvent('comments-data-loaded', {'count': so.pages.tc}); + + if(this.useEcho() && (!s.echoSubscribed)) { + var jsk$echo = jskEchoInit(JSKitLib.getRef(s), s.target); + var voidRenderer = function(rendererIdx) { + if(!jsk$echo.getRendererById(rendererIdx)) { + jsk$echo.existingRenderers.push({ + id: rendererIdx, + content: function() {} + }); + } + } + voidRenderer(0); + voidRenderer(1); + var request = { + p: s.config.path, + permalink: s.config.permalink + }; + if (s.sourceFilter) request[s.sourceFilter.type] = s.sourceFilter.sources.list; + jsk$echo.subscribe([{ + request: request, + callback: function() { + s.renderSubscribeEvents.apply(s, arguments) + } + }]); + s.echoSubscribed = true; + } +} diff --git a/performance/hbga.html b/performance/hbga.html new file mode 100644 index 0000000..5734535 --- /dev/null +++ b/performance/hbga.html @@ -0,0 +1,41 @@ + + + + + + +Human Based GA + + + + + + +

        Şebnem Er

        +

        Useful Links

        +
        + + + + \ No newline at end of file diff --git a/spatial/data/EU2.dbf b/spatial/data/EU2.dbf new file mode 100644 index 0000000..b95c4fd Binary files /dev/null and b/spatial/data/EU2.dbf differ diff --git a/spatial/data/EU2.rar b/spatial/data/EU2.rar new file mode 100644 index 0000000..ad0f534 Binary files /dev/null and b/spatial/data/EU2.rar differ diff --git a/spatial/data/EU2.shp b/spatial/data/EU2.shp new file mode 100644 index 0000000..195261b Binary files /dev/null and b/spatial/data/EU2.shp differ diff --git a/spatial/data/EU2.shx b/spatial/data/EU2.shx new file mode 100644 index 0000000..ca69874 Binary files /dev/null and b/spatial/data/EU2.shx differ diff --git a/spatial/data/EU_updated.txt b/spatial/data/EU_updated.txt new file mode 100644 index 0000000..e2498f1 --- /dev/null +++ b/spatial/data/EU_updated.txt @@ -0,0 +1,191 @@ +Codes Pop1990 Pop1991 Pop1992 Pop1993 Pop1994 Pop1995 Pop1996 Pop1997 Pop1998 Pop1999 Pop2000 Pop2001 Pop2002 Pop2003 Pop2004 Pop2005 Pop2006 Pop2007 Pop2008 Pop2009 Pop2010 Pop2011 GDP1995 GDP1996 GDP1997 GDP1998 GDP1999 GDP2000 GDP2001 GDP2002 GDP2003 GDP2004 GDP2005 GDP2006 GDP2007 GDP2008 GDP2009 +AT11 270670 271604 274259 275633 276300 277529 277843 277566 277210 276732 276226 275956 276673 276542 276793 278033 279128 280062 281185 283118 283965 284897 : : : : : : : : : : : : 21900 22400 22200 +AT12 1455968 1471624 1486756 1504072 1512388 1518489 1522804 1524239 1526848 1530745 1535083 1539416 1544667 1549269 1557291 1568949 1580501 1588567 1596538 1605122 1607976 1611981 : : : : : : : : : : : : 27100 28000 27000 +AT13 1492636 1502772 1522449 1537523 1549436 1542667 1539002 1542191 1540875 1542252 1548537 1553956 1571123 1592846 1610409 1632568 1652448 1661246 1674909 1687271 1698822 1714142 : : : : : : : : : : : : 42800 43800 42600 +AT21 544983 547752 552345 558114 559735 560708 561845 561549 561012 560938 560696 559571 559933 558623 558026 558926 559277 559393 560322 560605 559315 558271 : : : : : : : : : : : : 28100 28800 27400 +AT22 1169578 1171663 1177385 1184813 1186112 1186136 1185538 1184587 1184039 1183374 1182930 1182441 1188117 1189315 1192168 1196780 1200854 1202483 1204947 1207479 1208372 1210614 : : : : : : : : : : : : 29000 29500 28500 +AT31 1296826 1311277 1329858 1346059 1355548 1360051 1361888 1363368 1364332 1366578 1370035 1373134 1377803 1382532 1387488 1394726 1400287 1403663 1406664 1410403 1411238 1412640 : : : : : : : : : : : : 32500 33900 32800 +AT32 471835 480766 488833 498611 503848 506626 508253 510023 510973 511233 512854 514851 517050 517084 519691 522369 524920 526048 527452 529217 529861 531721 : : : : : : : : : : : : 38200 38800 37500 +AT33 618459 624114 632471 639956 645858 649875 653369 657694 660864 664067 667459 671492 675700 679457 683639 688954 694253 697253 700707 704472 706873 710048 : : : : : : : : : : : : 34500 35100 34600 +AT34 323863 329310 334543 337738 339521 341408 342525 343749 344963 346542 348366 350129 352574 354605 357068 360054 362630 364269 365868 367573 368868 369938 : : : : : : : : : : : : 34700 35900 34600 +BE10 964385 960324 951217 950339 949070 951580 948122 950597 953175 954460 959318 964405 978384 992041 999899 1006749 1018804 1031215 1048491 1068532 1089538 1119088 43700 43900 43600 45300 47500 50000 51400 53000 53400 55300 57300 58400 60100 60600 59800 +BE21 1597310 1604566 1610695 1619613 1625069 1628710 1631243 1635640 1637857 1640966 1643972 1645652 1652450 1661119 1668812 1676858 1688493 1700570 1715707 1731174 1744862 1764773 25200 25200 25800 25800 27200 28900 29200 30200 30700 32600 34200 35400 37000 37800 36100 +BE22 745034 750082 755593 761565 766833 771613 775302 779969 783927 787491 791178 794785 798583 802528 805786 809942 814658 820272 826690 833160 838505 844621 18300 17700 18100 19000 19600 20700 21200 21800 22300 23000 23300 24800 26300 27000 25400 +BE23 1331608 1335694 1340056 1344263 1346783 1349382 1351777 1354737 1357576 1359702 1361623 1363672 1366652 1370136 1373720 1380072 1389450 1398253 1408484 1420415 1432326 1445831 18600 18600 19000 19600 20200 21300 21900 22900 23600 24900 25700 26900 28500 29000 28500 +BE24 963283 970985 976956 982943 989252 995266 999186 1004692 1007882 1011588 1014704 1018403 1022821 1027839 1031904 1037786 1044133 1052467 1060232 1068838 1076924 1086446 21000 21000 21500 22800 24200 25300 26600 26600 27500 29200 30200 31800 33400 33900 33900 +BE25 1102501 1106529 1111557 1116244 1119085 1121135 1122849 1123786 1125140 1127091 1128774 1130040 1132275 1133931 1135802 1138503 1141866 1145878 1150487 1155290 1159366 1164967 19900 19700 20000 20900 22000 23100 23700 24200 25000 26200 27000 28600 30200 30600 29600 +BE31 315358 321304 325621 329614 332966 336505 339062 341565 344508 347423 349884 352018 355207 358012 360717 363776 366481 370460 373492 375645 379515 382866 18400 18200 18700 19700 20800 22600 23500 24500 24900 26900 28100 29400 30400 32800 32000 +BE32 1278039 1280336 1283252 1285934 1286639 1286649 1284761 1284347 1282783 1280427 1279467 1279823 1281042 1281706 1283200 1286275 1290079 1294844 1300097 1304436 1309880 1317284 14600 14500 14300 14900 15500 16200 16600 16900 17600 18400 19000 19800 20600 21400 20600 +BE33 998213 1000696 1006081 1011368 1014689 1015007 1013729 1014941 1016762 1018259 1019442 1020042 1024130 1025842 1029605 1034024 1040297 1047414 1053722 1060035 1067685 1077203 16800 16700 16900 17500 17700 18500 18900 19200 19600 20600 21200 22300 23300 24100 23700 +BE34 230827 232740 234664 236850 238142 240281 241339 242526 243790 245140 246820 248750 250406 252295 254120 256004 258547 261178 264084 266950 269023 271352 15500 15400 15500 16000 16500 17200 17200 17900 18200 19000 19800 21000 21400 21500 21400 +BE35 421224 423719 426305 429586 432103 434446 435677 437426 438864 441205 443903 445824 447775 450395 452856 455863 458574 461983 465380 468605 472281 476835 14600 14800 14900 15500 16100 16900 17300 17900 18500 19300 20000 21100 21800 22600 22400 +DE11 3609977 3683101 3751156 3807445 3832123 3841565 3862311 3881961 3888668 3898171 3917305 3935352 3964162 3985000 3994612 4003172 4007373 4005380 4007095 4006313 4000848 4002571 28600 28300 28400 29000 29900 30300 31700 31500 31800 32000 31700 34000 36100 35700 33100 +DE12 2484034 2532481 2577284 2612810 2636944 2645136 2644430 2656721 2660608 2666127 2676257 2684425 2701376 2716682 2722550 2727733 2732455 2734260 2739274 2740164 2740503 2744226 27200 27400 26500 27200 28100 28600 29500 29800 29800 30300 30800 32400 33700 34500 32800 +DE13 1934781 1977860 2012896 2041044 2058645 2071050 2087042 2099757 2106615 2114486 2125364 2137625 2156851 2170481 2178813 2185027 2190727 2193178 2196410 2195681 2196018 2199125 23300 23200 22700 23500 24200 25200 25800 25800 25800 26200 26400 27800 29100 29600 27900 +DE14 1589914 1628607 1660507 1687410 1706321 1714318 1725584 1736066 1740719 1747256 1757006 1767013 1778517 1789157 1796581 1801487 1805146 1805935 1806976 1807348 1807552 1807958 24500 24300 24000 24600 25500 26200 27000 27200 27200 27900 28300 29700 31500 32200 30000 +DE21 3721332 3801482 3848132 3919109 3948153 3959400 3978123 3991576 3991937 3996043 4033643 4083077 4138402 4169657 4195673 4211118 4238195 4279112 4313446 4335137 4346465 4382325 31600 31800 31900 33200 34600 36400 37100 37500 37600 38400 39100 40300 42200 41500 40200 +DE22 1057436 1078128 1092944 1109216 1120898 1131529 1143387 1151960 1158310 1162972 1170170 1176206 1185467 1191476 1194472 1196178 1196923 1193820 1194138 1191910 1189194 1189384 22800 22600 21900 22500 22700 23700 24800 25300 25200 26300 26500 27700 29400 29800 28800 +DE23 991309 1009017 1020423 1032218 1040561 1047267 1054474 1060014 1064702 1069121 1074338 1079217 1085609 1088929 1089826 1090289 1089543 1087939 1086684 1083780 1081417 1081120 23200 23100 23000 23700 25000 25600 25700 26600 26700 27300 28100 29200 31300 32200 30600 +DE24 1055822 1074866 1083982 1094271 1100241 1104494 1110477 1113612 1113674 1113790 1114155 1113251 1113788 1112655 1109674 1106541 1101390 1094525 1088845 1082516 1076400 1071306 23700 23300 23000 23500 24000 24300 25300 25300 25100 25800 26000 27600 28800 29200 28200 +DE25 1566070 1598857 1621514 1641331 1652252 1660294 1667254 1674282 1677515 1678535 1683282 1689066 1698343 1703869 1706615 1708972 1712275 1712622 1714123 1712405 1710145 1711566 26500 26300 26100 26900 28000 29100 29000 29900 30000 31200 31100 32100 33500 34500 33100 +DE26 1234906 1259010 1273415 1289657 1299951 1308151 1317652 1323132 1327318 1329399 1333803 1335991 1340912 1344300 1344740 1344629 1341481 1337876 1334767 1327497 1321957 1318076 22900 22800 22600 23300 23900 24600 25600 26000 26200 26700 27400 28500 29900 29900 28700 +DE27 1593863 1627539 1655561 1684485 1701297 1710809 1722117 1729293 1732919 1736688 1745576 1753447 1767193 1776465 1782386 1786166 1788919 1786764 1788329 1786483 1784753 1784919 24500 24200 23700 24700 25500 25600 26400 27300 27100 27500 28100 29600 30600 31300 29800 +DE50 673680 681648 683694 685840 683097 680029 679757 677770 673883 667965 663065 660225 659651 662098 663129 663213 663467 663979 663082 661866 661716 660706 31100 30700 30900 31400 31900 33200 34300 35100 35600 36300 37200 38700 40300 41100 40100 +DE60 1626222 1652360 1668758 1688789 1702889 1705872 1707901 1707986 1704731 1700089 1704735 1715392 1726363 1728806 1734083 1734830 1743627 1754182 1770629 1772100 1774224 1786448 39700 39700 39800 40700 41300 42100 44200 44700 44700 45400 46000 46500 47500 48600 47100 +DE71 3491419 3547188 3596111 3649645 3671031 3669956 3684624 3694537 3697606 3703089 3719354 3737589 3746852 3761749 3762995 3775025 3778124 3772906 3780232 3784767 3792941 3805503 32300 32500 31900 32100 33800 34200 35400 35500 36200 36800 37300 38400 39700 40500 39600 +DE72 981501 1003269 1016070 1032082 1042537 1049136 1055882 1060367 1060847 1060951 1063503 1063538 1065028 1065909 1065467 1064228 1061323 1057553 1053259 1048683 1044269 1041271 21300 21200 21000 21300 21800 22600 23100 23500 23600 24500 25100 25900 27300 28200 26900 +DE73 1187700 1212836 1225158 1240951 1253761 1261601 1269407 1272380 1273252 1271097 1269109 1267002 1265946 1263960 1260966 1258512 1252907 1244900 1239064 1231503 1224741 1220247 22700 22500 22300 23000 23600 24000 24700 25300 26000 26300 26700 27900 29100 29500 28500 +DE91 1614203 1639872 1655379 1670253 1674726 1678659 1679640 1677842 1673828 1669708 1669634 1668603 1666864 1665368 1662595 1658918 1650435 1641776 1633318 1623649 1616720 1609369 22100 21400 21300 23000 24300 24000 24900 24200 24600 25300 25800 26700 28500 28600 26900 +DE92 2032401 2060670 2081705 2108598 2120525 2130480 2138965 2146742 2150450 2148713 2152759 2158307 2163904 2167876 2167157 2166626 2163919 2160253 2156841 2149181 2142440 2138711 24400 23900 23400 23900 24100 24500 24300 24600 24900 25200 26600 27800 28200 29500 28700 +DE93 1467422 1491276 1512421 1535496 1560496 1581074 1602126 1616321 1630776 1645896 1660653 1672467 1683438 1692192 1698434 1702971 1704133 1702938 1701132 1696643 1693654 1692238 19000 18800 18300 18200 18600 19000 18900 19000 19000 19100 19500 20200 21200 21800 21200 +DE94 2169774 2195439 2226304 2263184 2292247 2325150 2359691 2374243 2390344 2401523 2415714 2426816 2442210 2455036 2465229 2472394 2475459 2477718 2480393 2477771 2476001 2477975 21000 20800 20600 21100 21000 22300 22600 22500 22400 23000 23300 24300 25600 26400 25300 +DEA1 5167713 5220445 5253128 5293259 5289018 5287352 5290584 5290935 5284861 5269171 5264468 5254317 5255328 5249280 5245132 5237855 5226648 5217129 5208288 5191042 5172839 5161782 26600 26100 25900 26600 27100 27600 28500 28800 29000 29800 30000 30900 33100 35100 33400 +DEA2 3963108 4025321 4068166 4113462 4141571 4162040 4188583 4216305 4235903 4249413 4263675 4281548 4309953 4331419 4350368 4363797 4378622 4384669 4391062 4386271 4383044 4392747 26500 26200 25900 26300 26300 26500 26700 27300 27100 27700 27600 28600 30100 30200 29200 +DEA3 2437782 2476464 2504851 2531918 2546965 2558277 2573490 2586577 2595115 2600471 2608779 2612301 2620240 2625637 2625745 2624489 2622623 2619372 2614361 2605365 2597636 2594291 20500 19800 19700 19800 20300 20800 21300 21400 21500 22400 22700 23700 25000 25800 24700 +DEA4 1849741 1895396 1924838 1953995 1975129 1991074 2012908 2026660 2035907 2041343 2048620 2055795 2063244 2069290 2071803 2072488 2069758 2065413 2059198 2050638 2043212 2038323 23800 23600 23200 23600 24100 24500 24700 24800 24700 25100 25600 26400 28300 28600 27200 +DEA5 3685240 3731987 3758890 3786540 3806630 3817336 3827480 3827238 3822701 3815118 3814258 3805904 3803327 3800729 3786638 3776723 3760454 3742162 3723712 3699748 3676032 3658011 22300 21700 21700 22300 22700 23100 23300 23600 23800 24500 25000 25900 27300 28100 26300 +DEB1 1377003 1402068 1422594 1445016 1463553 1476996 1489931 1499680 1507807 1512283 1516237 1519561 1524695 1527611 1527919 1527507 1521494 1513939 1507919 1499457 1490711 1483598 20700 20400 19900 20200 20800 21200 21200 21800 21800 22500 22600 23600 24500 24900 24200 +DEB2 477962 484041 489051 494291 498972 502475 505375 507667 509134 510507 511548 511754 512990 513702 513755 513861 513363 515819 515972 515322 513794 513254 20000 19800 19600 19500 20200 20500 20700 21400 21800 22400 22400 23100 24000 24400 23900 +DEB3 1846692 1877425 1909613 1941644 1963333 1972102 1982613 1993220 2000887 2002179 2002988 2003242 2011381 2016414 2017008 2019737 2023986 2023102 2021752 2013572 2008170 2006893 23200 22500 22500 22700 23300 23800 23800 24100 24200 24900 24800 25700 27100 27400 26200 +DEC0 1064907 1072960 1076882 1084015 1084517 1084201 1084370 1084184 1080790 1074223 1071501 1068703 1066470 1064988 1061376 1056417 1050293 1043167 1036598 1030324 1022585 1017567 22500 21500 21300 21800 22200 22900 23400 23600 23800 25000 26300 27500 28900 29500 27500 +DEF0 2594608 2626140 2648540 2679572 2694888 2708392 2725461 2742293 2756473 2766057 2777275 2789761 2804249 2816507 2823171 2828760 2832950 2834254 2837373 2834260 2832027 2834259 22800 22600 22200 22400 22700 23100 23600 23200 23400 23700 23800 24600 25300 26000 25700 +DK00 2683877 2611326 2572046 2545787 2532763 2517776 2503785 2491119 2478148 2462836 2449082 2431255 2411387 2392040 2373157 2355280 2334575 2311140 2289219 2267763 2249882 2235025 26400 27300 28100 28900 30200 31500 32500 33400 34000 35400 36800 38500 40000 41100 39500 +ES11 2744800 2733854 2730372 2727995 2725377 2719536 2711516 2702667 2694580 2689042 2684551 2697288 2693733 2699955 2706126 2712162 2718490 2723915 2735078 2738930 2738602 2736637 9400 10000 10200 10700 11400 12100 13000 13800 14800 15800 17100 18500 19800 21100 20500 +ES12 1101087 1094958 1093460 1091396 1088687 1084286 1079808 1075969 1071754 1067081 1063156 1063195 1061942 1060177 1060065 1059133 1058330 1058059 1059136 1058923 1058114 1055558 10200 10800 10800 11500 11900 13100 14100 15000 15900 17000 18500 20200 21700 22400 21200 +ES13 527538 527558 527828 528055 528357 528851 528893 528549 528714 529568 531072 532958 534915 539601 545125 551085 557226 563611 570613 576418 577997 578637 10800 11400 11700 12400 13400 14600 15900 17000 18000 19200 20600 22100 23500 23100 22100 +ES21 2114894 2104629 2101091 2096229 2091482 2084996 2078931 2075028 2072017 2069723 2070279 2076441 2082258 2087972 2094909 2103441 2113052 2124235 2138739 2136061 2138588 2140346 13800 14700 15200 16400 17800 19200 20500 21700 23000 24600 26600 28700 30600 31000 29700 +ES22 519106 519394 522183 524949 527710 530913 533961 536594 539234 542559 546692 551417 555879 564608 573038 580616 588306 596236 606234 614526 619011 622121 14600 15800 16300 17100 18300 19900 21000 22200 23400 24700 26400 28000 29500 29900 28700 +ES23 262941 263475 263698 263382 263056 263237 263331 263620 264106 265274 267911 270991 276679 282074 288384 294347 300821 306254 311773 315718 314005 313146 13300 14100 14600 15500 16500 17800 18700 19400 20600 21400 22500 23900 25100 26400 25000 +ES24 1192383 1189497 1191288 1193251 1194609 1195870 1196298 1195793 1195794 1195496 1196027 1198318 1203660 1216127 1228886 1243464 1258847 1275904 1297581 1313735 1313017 1314904 12500 13400 13800 14400 15100 16300 17400 18800 19900 21000 22400 24000 25600 26500 25100 +ES30 4931541 4946904 4973115 5002151 5024251 5039452 5055266 5075186 5095698 5128470 5185931 5274180 5426248 5573313 5705620 5821054 5938391 6052583 6189297 6295011 6335807 6369162 15100 16300 16800 18200 19700 21300 22500 23500 24600 25800 27300 29200 30500 30900 30000 +ES41 2561818 2547139 2539982 2531131 2523329 2516144 2506764 2496989 2486500 2475112 2464303 2458661 2454546 2458637 2462169 2469303 2477128 2486166 2501860 2510545 2499155 2491409 11100 11800 11900 12400 13200 14100 15100 16200 17300 18500 19800 21300 22700 22500 21900 +ES42 1659033 1658573 1665607 1674229 1682857 1692678 1701751 1706562 1712976 1719480 1728782 1740501 1760162 1790436 1823013 1856787 1892657 1929947 1977596 2022647 2035516 2046712 9500 10200 10400 11000 11500 12300 13100 13800 14700 15400 16400 17400 18300 19500 18500 +ES43 1066274 1061970 1061732 1061945 1063081 1063977 1063101 1062166 1060657 1058687 1057277 1059901 1058148 1061367 1066149 1068799 1071339 1074419 1078908 1080439 1082792 1083267 7400 7900 8000 8500 9200 9900 10700 11400 12200 13100 14200 15200 16200 16300 15900 +ES51 6054382 6060217 6074028 6088795 6099271 6106376 6117984 6135406 6153660 6182921 6216683 6285640 6343786 6492936 6637355 6784145 6936148 7085308 7238051 7290292 7301132 7333532 14100 15300 15700 16400 17700 19000 20400 21400 22400 23600 24800 26400 27500 27600 26500 +ES52 3839122 3857243 3869562 3881803 3893638 3905099 3916778 3927802 3942551 3966639 4009994 4073263 4163094 4283217 4400459 4518126 4641240 4759263 4892475 4991789 4994322 5004474 11000 11800 12300 13100 14000 15100 16100 16900 17600 18400 19300 20500 21200 21700 20200 +ES53 705700 709200 718686 727724 733919 742436 753620 764629 777893 798961 822337 849986 872836 906266 931831 957953 985620 1014405 1045008 1070066 1079094 1088513 14000 15000 15800 16600 18000 19300 20300 20900 21300 22200 23300 24600 25400 25600 24200 +ES61 6896678 6937884 6982531 7023489 7064993 7099540 7125599 7149272 7175845 7202974 7241668 7303603 7360469 7452598 7552978 7670365 7794121 7917397 8046131 8150467 8206057 8256303 8600 9200 9500 9900 10600 11500 12300 13200 14200 15200 16300 17300 18100 18400 17500 +ES62 1038380 1045048 1056416 1067842 1079007 1089176 1098386 1109020 1120122 1132821 1148150 1169047 1198606 1232986 1265983 1300083 1335347 1370802 1411623 1443383 1460664 1468130 9600 10200 10700 11300 12000 13100 14000 14800 15800 16500 17700 18700 19500 20400 19100 +FI13 706071 706663 707895 709044 708721 707476 704946 701416 696942 691317 686194 680870 676579 672345 669354 667056 664196 660859 657257 654344 652346 650550 15200 14900 15900 16400 17100 18300 19300 19800 20500 21400 22300 23400 25400 26400 24100 +FI18 2336461 2351937 2371723 2388400 2405597 2423000 2440914 2457904 2477120 2495947 2513801 2528610 2544709 2557685 2569358 2580801 2595823 2613925 2632744 2653778 2672190 2689904 22500 22800 24400 26400 27900 30000 31500 32200 32100 33600 34500 36300 39000 39800 37200 +FI19 1295857 1300085 1304793 1308650 1311353 1313881 1314791 1316084 1316784 1317263 1317215 1317441 1319440 1321583 1325241 1330371 1334293 1338973 1344565 1349600 1355168 1360041 17500 17800 19000 20000 21000 22400 24100 24500 25000 25700 26800 27800 30500 31400 29000 +FI1A 611763 615189 619744 623895 627139 629239 630973 631659 631111 629494 628386 628418 628165 628425 629432 631853 634502 636275 638765 641136 643989 646774 17400 16800 18000 18700 19300 21700 21500 23400 24500 25600 26100 27400 29400 30600 26700 +FI20 24231 24604 24847 24993 25102 25158 25202 25257 25392 25625 25706 25776 26008 26257 26347 26530 26766 26923 27153 27456 27734 28007 24700 25800 27200 29500 32900 32300 37500 38200 38400 39600 39100 40400 41400 43000 46200 +FR10 10644665 10695556 10753276 10793414 10833223 10858975 10883848 10895427 10912622 10946012 11019991 11102824 11185563 11270074 11350290 11442143 11532398 11598866 11659260 11728240 11797021 11866900 30700 31800 32100 33200 35300 37100 38000 39200 40100 40900 42300 43600 48200 49000 47800 +FR21 1346963 1348133 1347817 1348898 1349476 1350114 1349022 1347927 1346318 1343266 1342007 1341878 1341635 1340851 1339597 1339400 1338850 1339487 1338004 1337953 1336242 1334998 18800 19400 19500 21000 21500 22400 22500 22900 22800 24700 25000 25800 26500 26900 25100 +FR22 1808968 1817666 1826282 1834923 1840447 1846150 1851969 1855412 1856335 1857981 1862938 1868759 1874316 1879079 1883409 1889028 1894355 1900354 1906601 1911157 1914844 1919367 17400 17700 17700 18600 19000 19400 19900 20300 20600 21200 21700 22300 22900 23300 22400 +FR23 1735969 1744497 1753445 1760144 1765765 1771034 1774450 1776332 1779392 1780502 1784575 1789406 1794099 1797924 1801791 1806677 1811055 1816716 1825667 1832942 1837388 1843118 18900 19200 19200 20100 20800 21900 22300 22600 22900 24000 24700 25400 26000 26300 25200 +FR24 2369808 2381407 2393043 2403487 2410394 2418315 2424326 2432034 2438205 2440295 2450121 2461778 2472978 2484288 2494279 2507246 2519567 2526919 2531588 2538590 2544791 2551372 18800 19100 19100 19900 20500 21200 21900 22400 23000 23700 24100 25000 25000 25500 24900 +FR25 1390890 1394761 1397801 1402650 1405337 1408316 1411452 1416140 1418774 1421947 1426928 1432400 1437801 1442916 1447429 1452425 1456793 1461429 1467425 1470880 1473946 1476937 17300 17500 17700 18200 18900 19600 19900 20600 21000 22100 22400 23200 23200 23700 22800 +FR26 1609399 1611236 1613265 1614605 1615153 1615509 1614875 1614401 1613233 1610833 1612818 1615651 1618437 1620757 1622456 1626190 1628837 1633891 1638588 1642440 1644756 1647708 18000 18500 18800 19700 20200 21000 21400 21800 22100 23200 23600 24500 25400 25900 24900 +FR30 3961703 3965393 3971196 3977782 3981783 3986346 3991531 3994535 3995437 3997467 3997864 4001142 4005577 4008628 4010548 4015613 4018644 4021676 4024490 4033197 4035269 4038280 16100 16600 16600 17500 17900 18500 19100 19700 20300 21100 21700 22900 24000 24600 23900 +FR41 2304291 2304714 2307592 2311514 2313867 2315488 2315782 2316244 2312566 2311655 2314909 2318791 2323026 2326019 2328136 2332468 2335749 2339881 2346361 2350112 2352324 2354876 17600 17700 17700 18600 18700 19600 20200 20700 21000 22100 22500 23200 23200 23800 23000 +FR42 1622810 1635430 1647964 1662967 1675733 1687475 1699339 1710779 1719985 1732588 1743955 1756078 1768054 1779575 1791145 1803402 1815493 1827248 1837087 1843053 1851443 1860243 21100 21600 21400 22300 22800 23600 24100 24400 24500 25400 25500 26400 27800 28300 27500 +FR43 1096427 1099304 1102326 1105411 1107794 1111540 1113796 1114719 1115914 1117253 1121512 1126695 1131455 1135982 1140478 1145744 1150624 1158671 1163931 1168208 1172549 1177295 17900 18200 18200 19100 19700 21000 21800 22200 22200 23100 23300 23800 23800 24300 23300 +FR51 3055197 3071600 3090225 3110784 3128438 3145757 3164039 3182305 3200459 3219960 3248994 3281679 3314649 3347675 3379784 3415391 3450413 3482594 3510170 3539048 3566686 3594865 18000 18600 18600 19600 20300 21400 22300 22800 23200 24000 24700 25500 26700 27100 26100 +FR52 2794317 2803483 2811473 2822722 2830583 2840680 2853664 2870354 2888237 2904075 2927612 2954324 2981765 3009249 3037077 3066585 3094534 3120288 3149701 3175064 3197975 3221451 17000 17500 17900 18700 19300 20400 21100 21500 22100 23300 24100 25100 24900 25400 24500 +FR53 1595217 1600538 1605587 1609907 1613361 1619284 1623721 1628078 1635088 1639735 1650378 1662133 1674460 1686472 1698020 1711307 1724123 1739780 1752708 1760575 1770149 1780379 16900 17300 17600 18300 18700 19600 20200 20900 21400 22400 22800 23500 23600 24100 23400 +FR61 2795610 2810508 2824048 2837490 2845808 2855720 2864475 2876822 2888793 2906748 2933223 2962914 2993132 3023922 3054587 3088196 3119778 3150890 3177625 3206137 3231860 3258176 18200 18800 19200 20200 20100 21100 22300 23000 23100 23800 24600 25800 25900 26300 26100 +FR62 2431081 2445108 2461633 2476375 2483633 2494806 2506942 2520325 2533766 2550275 2578254 2609222 2641980 2674559 2707583 2743073 2776822 2810247 2838228 2862707 2889236 2916076 18000 18300 18700 19300 20000 20700 21900 22500 23100 23600 24600 26200 26100 26500 26200 +FR63 723460 721882 720921 719702 718530 716942 715315 714047 712602 711471 713249 715796 718716 721351 723906 727487 730920 737001 740743 741785 744187 746691 16600 17000 17100 17900 18500 19300 20000 20800 21000 21500 22400 23200 22700 23300 22700 +FR71 5346407 5389048 5433044 5474915 5498280 5525090 5551758 5580618 5608783 5640234 5688524 5741877 5796144 5850513 5904729 5963736 6021346 6065959 6117229 6174040 6222045 6272467 20400 21100 21600 22500 23000 24100 24700 25000 25700 26800 27400 28800 30100 30600 29400 +FR72 1321761 1319717 1317402 1315977 1314015 1312232 1310888 1310231 1309619 1309374 1312227 1315944 1319800 1323406 1327104 1331779 1335938 1339247 1341863 1343964 1345712 1347794 16800 17300 17700 18800 19300 19900 20300 20900 21400 22300 22900 23700 23900 24400 23600 +FR81 2115168 2135522 2153832 2175024 2192819 2209034 2229405 2249187 2273724 2292405 2322072 2353629 2388723 2424518 2459969 2497718 2534144 2560870 2581718 2610890 2636321 2661449 15800 16200 16400 17000 17700 18300 19100 19500 20000 20900 21400 22400 23200 23700 23300 +FR82 4257244 4293499 4326663 4356875 4383592 4405312 4426194 4451004 4479644 4502385 4541508 4584379 4629496 4675056 4719132 4768564 4815232 4864015 4882913 4889053 4916930 4944390 18800 19200 19100 19900 20500 21800 22700 23200 23800 24900 25900 27000 27200 27800 27300 +FR83 249645 251659 251698 253595 256977 258416 259168 259097 259466 260152 264539 269273 274093 279027 283972 289092 294118 299209 302966 305674 309339 312936 14800 14900 15500 16300 17200 17700 18500 18700 19100 20000 21000 22000 23500 23900 24400 +GR11 556773 568309 576447 581769 586218 590059 593580 596979 600023 602746 605077 607035 606633 606319 605565 607847 607460 607205 606684 606622 606721 606004 7700 8300 8800 8900 9600 9400 10200 10400 11500 12200 12800 13400 14600 15100 15300 +GR12 1684046 1703299 1737169 1761310 1781446 1799383 1815600 1830288 1843793 1855757 1866287 1875258 1888631 1901930 1909297 1911508 1919401 1927823 1935660 1944793 1954582 1956233 9200 10500 11500 11500 12400 11700 12000 12500 13800 15100 13900 15000 16200 16900 16600 +GR13 288309 288451 289520 290435 291300 292024 292831 293220 293722 293936 294277 294331 294580 294830 294470 294508 294155 293864 293519 293172 293061 292540 9500 10200 11800 12000 12600 11500 11900 13200 14100 14900 15700 17100 18800 19100 18800 +GR14 728689 729086 732480 735639 738231 740158 741480 742328 742681 742410 741771 740454 739082 738256 737340 737583 737144 737034 736079 735885 736083 735410 8400 9100 9900 10300 10900 10700 11400 12100 13600 14800 13700 14800 15300 16000 15800 +GR21 328802 326850 328676 330096 331455 332671 333879 334729 335604 336164 336508 336445 337265 338028 340854 341851 345100 348520 351786 355175 359096 357203 6900 7400 8600 8800 9800 10700 11200 11700 13100 14200 12700 13200 14100 14400 14200 +GR22 187019 188359 192865 196315 199232 201536 203606 205080 206506 207573 208690 209545 213077 216255 218594 220398 223149 225879 228572 231514 234440 234332 8000 8800 10300 10200 11000 12300 13200 14000 15600 16400 17300 17600 19000 19400 17700 +GR23 697671 693742 700602 705875 710257 713816 716813 718992 720593 721621 722003 721749 724647 728083 730238 732292 734505 736899 738955 742038 745397 745786 7900 8500 9000 9000 9400 9900 10500 11100 12400 13100 13300 14100 14600 14900 14300 +GR24 556404 547784 549933 552174 554630 556874 558844 560396 561323 561389 560751 558694 559797 560768 559351 558503 557364 556441 555069 554426 554359 554609 14100 15700 16600 16500 16800 15200 15400 15700 16700 17700 17000 17900 18600 19300 19000 +GR25 586196 573854 577167 580649 584217 587738 590808 593895 596166 597736 598474 597927 599637 601307 599199 598156 596621 595092 593378 592017 591230 589790 8500 9200 10500 10900 11700 12500 12400 12900 13900 14900 14300 15600 16500 16700 16600 +GR30 3533023 3584554 3627477 3664438 3700218 3735432 3769742 3802175 3831830 3857562 3878199 3892519 3904292 3915912 3940099 3973326 4001911 4032456 4061326 4088447 4109748 4113979 10200 10600 11400 11600 12600 14300 15500 16900 18600 19800 22300 24300 25800 26900 27000 +GR41 191923 201318 201523 201843 202297 202778 203402 203710 204248 204629 205031 205158 204586 204071 203169 202402 201731 201083 200517 200275 199968 199603 7900 8600 9900 10000 11200 10200 11900 11900 13900 14000 13900 14900 16200 17200 16600 +GR42 249156 252991 261701 267973 273289 278031 282397 286354 289918 293128 295864 298133 299995 301722 302549 303114 303980 304975 305966 307228 308647 310805 10200 11600 13100 13000 14400 15400 15900 16900 18500 19300 21300 22300 24000 25700 24800 +GR43 532881 534314 544112 551543 558206 564574 570714 576503 581951 586751 590825 593958 596486 598896 599925 601263 602658 604469 606274 608810 611786 613591 9300 10400 11100 11100 12100 12500 13100 14300 15300 16200 16200 17000 18000 18800 18400 +IE01 : : : : : : : 969402 975844 983495 996085 1010467 1032218 1052684 1073820 1098144 1126474 1153796 1179280 1199297 1204423 1210268 10500 12000 13800 15100 17000 19700 21600 22500 24100 26400 27800 29500 30300 29000 25000 +IE02 : : : : : : : 2685553 2717738 2748706 2781678 2822506 2867658 2910981 2953912 3011029 3082545 3158730 3222055 3250733 3263431 3270590 15800 17800 21900 23700 27000 30700 33800 37300 39300 40900 43500 46300 48300 44700 40000 +ITC1 4324173 4307852 4298870 4288065 4274380 4261168 4250494 4245330 4238764 4232495 4225083 4219509 4213294 4231334 4270215 4330172 4341733 4352828 4401266 4432571 4446230 4457335 : : : : : : : : : : : : 28900 28700 27100 +ITC2 114409 115275 115896 116244 116389 116653 117063 117588 118071 118615 118861 119248 119546 120909 122040 122868 123978 124812 125979 127065 127866 128230 : : : : : : : : : : : : 32300 33500 32300 +ITC3 1694410 1684514 1674120 1662053 1652196 1641159 1629143 1618812 1608299 1597964 1587787 1579106 1570004 1572197 1577474 1592309 1610134 1607878 1609822 1615064 1615986 1616788 : : : : : : : : : : : : 27600 28200 27100 +ITC4 8837150 8849595 8860344 8874313 8875372 8875974 8881327 8901539 8922361 8944601 8971148 9004085 9033602 9108645 9246796 9393092 9475202 9545441 9642406 9742676 9826141 9917714 : : : : : : : : : : : : 33300 34200 32500 +ITD1 437426 438916 440635 442450 444327 446195 448361 450683 453549 455859 458553 461111 463207 467338 471635 477067 482650 487673 493910 498857 503434 507657 : : : : : : : : : : : : 35900 36400 36100 +ITD2 445997 448280 449805 451606 453863 455982 458159 460984 463899 467025 470505 474305 477359 483157 490829 497546 502478 507030 513357 519800 524826 529457 : : : : : : : : : : : : 31000 31100 30400 +ITD3 4364265 4372865 4381173 4388825 4394897 4400073 4409243 4426481 4444340 4464206 4485059 4508549 4529823 4577408 4642899 4699950 4738313 4773554 4832340 4885548 4912438 4937854 : : : : : : : : : : : : 30800 30500 29200 +ITD4 1200155 1198178 1196164 1191952 1186719 1183131 1180292 1177870 1177178 1177047 1178264 1181210 1183603 1191588 1198187 1204718 1208278 1212602 1222061 1230936 1234079 1235808 : : : : : : : : : : : : 30400 29900 28200 +ITD5 3901389 3905465 3908466 3901533 3899076 3895014 3897117 3906070 3915305 3927160 3945470 3966338 3984526 4030220 4080479 4151369 4187557 4223264 4275802 4337979 4377435 4414293 : : : : : : : : : : : : 32800 32700 31000 +ITE1 3533095 3531357 3526897 3521712 3515048 3505309 3498181 3494793 3492712 3490565 3491580 3495077 3497042 3516296 3566071 3598269 3619872 3638211 3677048 3707818 3730130 3749813 : : : : : : : : : : : : 28200 28200 27800 +ITE2 809605 810623 811504 810885 812455 813664 814173 816105 817638 818737 820844 824194 826196 834210 848022 858938 867878 872967 884450 894222 900790 906486 : : : : : : : : : : : : 24900 24800 23400 +ITE3 1422531 1426238 1428737 1430147 1432573 1435302 1438376 1442466 1446909 1452150 1457539 1463951 1471123 1484601 1504827 1518780 1528809 1536098 1553063 1569578 1577676 1583460 : : : : : : : : : : : : 26900 26400 25600 +ITE4 5115628 5130191 5142908 5159157 5157006 5154261 5148923 5143465 5135769 5125728 5119323 5119189 5117075 5145805 5205139 5269972 5304778 5493308 5561017 5626710 5681868 5728688 : : : : : : : : : : : : 30600 30300 29500 +ITF1 1243014 1245844 1249558 1252191 1252332 1254352 1255514 1257426 1259153 1260492 1261117 1261287 1262379 1273284 1285896 1299272 1305307 1309797 1323987 1334675 1338898 1342366 : : : : : : : : : : : : 21700 22000 21000 +ITF2 330382 330557 330605 329889 329523 329214 328100 327041 325621 324125 322772 321467 320467 321047 321697 321953 320907 320074 320838 320795 320229 319780 : : : : : : : : : : : : 21200 20800 20500 +ITF3 5607965 5621030 5631686 5655559 5674718 5691818 5703781 5715238 5723749 5722729 5717694 5708759 5701389 5725098 5760353 5788986 5790929 5790187 5811390 5812962 5824662 5834056 : : : : : : : : : : : : 16700 16700 16400 +ITF4 4013227 4025392 4031540 4039668 4049795 4055934 4057268 4054098 4051043 4042633 4034887 4026945 4019500 4023957 4040990 4068167 4071518 4069869 4076546 4079702 4084035 4091259 : : : : : : : : : : : : 17200 17100 16800 +ITF5 611029 610970 610394 610191 610022 609799 608902 607150 605768 603507 601399 599350 597468 596821 597000 596546 594086 591338 591001 590601 588879 587517 : : : : : : : : : : : : 18700 18700 18300 +ITF6 2080660 2075886 2069008 2065139 2067242 2064883 2062112 2056715 2050493 2041446 2028592 2019405 2009623 2007392 2011338 2009268 2004415 1998052 2007707 2008709 2009330 2011395 : : : : : : : : : : : : 16600 16900 16500 +ITG1 4969910 4970805 4966884 4981012 4994781 5004913 5009331 5010307 5011170 5004493 4994427 4979647 4965669 4972124 5003262 5013081 5017212 5016861 5029683 5037799 5042992 5051075 : : : : : : : : : : : : 17000 17200 16700 +ITG2 1637940 1644286 1648005 1649493 1650731 1651147 1650440 1649117 1646474 1642057 1638573 1635003 1630847 1637639 1643096 1650052 1655677 1659443 1665617 1671001 1672404 1675411 : : : : : : : : : : : : 19600 20100 19500 +NL12 599151 600013 601839 603998 607016 609579 612028 615045 618115 621222 624500 630539 636184 639787 642066 642977 642230 642209 643189 644811 646305 647282 17300 17500 17900 18900 19700 21400 23000 23100 23800 23900 25200 26400 28000 28800 28200 +NL13 441028 443510 445596 448256 451409 454864 457316 460817 464672 467093 469806 474506 478799 481254 482415 483369 484481 486197 488135 489918 490981 491411 17900 18000 18300 18600 19400 20900 22300 22800 23100 23200 24500 25400 27200 27900 26500 +NL21 1020424 1026325 1032418 1039083 1044648 1050389 1053966 1057944 1063527 1070444 1077625 1086280 1094032 1100677 1105512 1109432 1113529 1116374 1119994 1125435 1130345 1134465 18100 18400 18800 19700 21200 22800 24200 24800 25400 25900 26800 28000 29800 31200 30000 +NL22 1804209 1816935 1828808 1839883 1851402 1864732 1876299 1886109 1895656 1906778 1919158 1934314 1949233 1960422 1966929 1972010 1975704 1979059 1983869 1991062 1998936 2004671 17700 18000 18700 19600 20800 22200 23700 24300 24800 25200 26000 27700 29400 30300 29600 +NL31 1015515 1026841 1037294 1047035 1056033 1063460 1070585 1079428 1088621 1098722 1107849 1117997 1139925 1152218 1162258 1171291 1180039 1190604 1201350 1210869 1220910 1228794 24400 25400 26000 28100 30800 32600 35100 35500 35600 36300 37500 38800 40900 41600 41200 +NL32 2376015 2397088 2421665 2440165 2457329 2463611 2468432 2474754 2486105 2503158 2518354 2534599 2559477 2573120 2587265 2599103 2606584 2613070 2626163 2646445 2669084 2691477 23600 24100 25100 26500 28300 30000 31400 33700 34300 35300 36600 37800 39500 40400 39500 +NL33 3221475 3247282 3273460 3297241 3314577 3325064 3332860 3344695 3359047 3378770 3397744 3420700 3423780 3439982 3451942 3458381 3458875 3455097 3461435 3481558 3505611 3528324 20900 21400 22000 23300 24700 26600 28300 29100 29800 30600 32200 33600 35800 36500 34400 +NL34 355947 357454 359205 361195 363867 365846 367354 368426 369949 370571 371866 374920 377235 378348 379028 379978 380186 380497 380585 380984 381409 381530 19900 19700 19400 20100 21000 22600 23700 25600 26700 27200 27800 29000 31900 33700 31900 +NL41 2189481 2209047 2225331 2243546 2259779 2276207 2290424 2304094 2319262 2337709 2356004 2375116 2391123 2400198 2406994 2411359 2415946 2419042 2424827 2434560 2444158 2454215 20500 21100 21800 22700 24600 26600 28000 28600 29100 30000 31300 33000 34600 35700 34700 +NL42 1103960 1109841 1115485 1119942 1125187 1130050 1133669 1136199 1137935 1139302 1141192 1142679 1143296 1141889 1139335 1136695 1131938 1127805 1123705 1122604 1122701 1122627 18200 18400 19200 20400 22000 23300 24700 25800 26100 27100 27700 29100 31200 31900 30000 +PT11 : 3518950 3511771 3516484 3527789 3541805 3555975 3570785 3586258 3603618 3621210 3643795 3667529 3691922 3711797 3727310 3737791 3744341 3745236 3745439 3745575 3741092 7500 8000 8400 8900 9500 10000 10600 10900 10800 11100 11500 11900 12700 12900 12600 +PT15 : 344830 341075 343336 345970 349658 353309 357472 363387 369298 375841 383399 390933 398370 405380 411468 416847 421528 426386 430084 434023 437643 9800 10200 10900 11600 12600 13500 14500 15000 15500 15800 16300 16900 17800 17800 16800 +PT16 : : 2272111 2270518 2271336 2276261 2281286 2286788 2294537 2302787 2312390 2325161 2339559 2354550 2366691 2376609 2382448 2385891 2385911 2383284 2381068 2375902 7600 8100 8500 9100 9900 10600 11000 11300 11700 12000 12300 12700 13300 13300 13200 +PT17 : : 2574265 2581419 2585705 2593283 2599990 2608986 2619382 2629432 2643253 2661748 2686872 2714614 2740237 2760697 2779097 2794226 2808414 2819433 2830867 2839908 12400 13100 14200 15300 16500 17500 18300 19100 19300 20100 20700 21300 22400 22700 22300 +PT18 : : 772760 770509 768468 767593 766356 764975 764810 764468 764653 765742 766529 767983 767549 767679 765971 764285 760933 757069 753407 749055 8300 8800 9500 9900 10300 11400 11900 12200 12700 13200 13500 14300 14800 14800 14300 +SE01 1629631 1641669 1654512 1669840 1686230 1708502 1725756 1744330 1762924 1783440 1803377 1823210 1838882 1850467 1860872 1872900 1889945 1918104 1949516 1981263 2019182 2054343 28800 33200 35100 36200 38400 42000 38900 40900 42300 44600 45900 47700 50500 49400 45200 +SE02 1445640 1458482 1469882 1479157 1489881 1500619 1501136 1498037 1495407 1492338 1490348 1492078 1497304 1503423 1509841 1514549 1518077 1524509 1534529 1545587 1558292 1569248 19300 21600 21600 22000 23300 25900 24500 25900 26700 27700 28200 30100 31700 30900 26600 +SE04 1207975 1219151 1229393 1237955 1245220 1259002 1264468 1266340 1268295 1271840 1274411 1279816 1286588 1294965 1302586 1311254 1320160 1335936 1351257 1367017 1383653 1396556 20200 22700 23600 23400 25000 27600 25700 27100 27900 28900 29400 31000 33600 31500 26800 +SE06 857268 861471 863914 864126 865347 866355 862476 857107 850046 843437 837892 832524 829114 827067 826949 826188 825037 824853 825000 825149 825931 826820 20200 22000 22200 22300 23900 26200 24400 25800 26900 28100 28700 30400 31600 31200 26300 +SE07 395277 396881 397289 396739 396640 396596 393874 391148 387497 383650 380004 376469 373664 372266 371750 371619 370764 370998 370386 370269 369708 369316 21800 23300 23500 24000 25000 27700 27500 27900 28500 29800 30600 31700 32400 33400 28800 +SE08 512972 515703 518669 522076 525263 527423 526483 524215 521480 518276 514804 511878 509551 508862 508830 509460 509392 509467 508195 507489 507567 507895 20500 22300 22500 22400 23600 25900 25000 26300 27600 29400 30500 33500 33800 34800 27700 +SE09 796058 801255 804531 805303 807848 812447 811464 808248 805040 801884 798344 797172 796515 796957 798528 799739 800054 802247 805353 807871 810066 811611 20100 22900 22900 23400 24100 27200 25500 26900 27900 29000 28300 30900 33100 32600 26900 +SE0A 1682218 1696018 1705930 1716817 1728680 1745437 1751839 1755074 1756936 1759457 1762246 1769645 1777510 1786781 1796314 1805683 1814323 1827143 1838691 1851702 1866283 1879781 20900 23100 23600 23800 26200 28900 27700 28600 30400 31200 31700 33900 35300 34600 29300 +UKC1 1159687 1163422 1157900 1157800 1157600 1156600 1154600 1152200 1150300 1148500 1147177 1146454 1145586 1145501 1146354 1148530 1151783 1155938 1161012 1165237 1170984 : 12400 13100 16000 16500 17600 19800 19500 19400 19300 21200 20800 22100 23300 20300 17700 +UKC2 1436201 1436787 1431200 1434800 1433700 1429000 1425000 1420100 1414200 1407100 1399690 1395301 1394683 1394921 1394326 1395900 1398535 1400640 1404534 1412218 1424460 : 12400 13200 16300 18000 19100 21200 22300 23800 22500 23900 25400 26500 27200 23400 20200 +UKD1 489474 489411 486800 487200 487100 486900 486800 487500 488600 488600 487874 487699 488319 490102 493136 495780 496696 496754 496329 495466 494697 : 13700 14400 17100 18300 18600 20800 20400 21600 21400 22200 22300 24800 26800 23100 20000 +UKD2 959838 963198 963500 967000 971200 974200 976500 978600 980900 981200 981252 983061 984614 987062 990249 993525 996868 999594 1001915 1004283 1007486 : 16600 17700 22800 24800 26500 28900 31000 31200 29200 30600 31800 33500 34900 30700 25900 +UKD3 2558112 2565659 2552400 2551100 2548300 2542900 2535800 2526600 2521900 2518700 2515913 2516217 2517039 2523138 2531852 2539638 2549003 2559796 2572725 2590437 2615144 : 13800 15000 18700 20100 22100 24900 25500 26000 25000 27200 27500 28700 29700 25300 21900 +UKD4 1402805 1407845 1403900 1408500 1412800 1414300 1413400 1411900 1412200 1411800 1412499 1415703 1419139 1425272 1433392 1440798 1445700 1447343 1446401 1445422 1447496 : 13400 14200 16800 18000 19500 21600 21800 22500 21400 22800 23400 24100 25300 21900 19100 +UKD5 1451562 1449808 1435500 1430100 1423400 1415100 1406300 1397400 1389700 1382400 1376131 1370925 1365849 1362314 1360183 1359066 1357175 1354354 1351546 1350404 1351998 : 10800 11300 14100 15800 16500 19600 19500 21200 20000 20900 21500 22700 23800 20700 18100 +UKE1 870198 874911 873600 876800 880600 882900 881500 879200 877400 875800 874433 874791 878271 884562 892191 899216 904502 908488 912563 916242 919438 : 13800 15100 18200 19000 19000 21600 21900 23300 21900 23800 23900 24700 25900 21800 19300 +UKE2 713271 716863 715900 717100 718400 722600 726500 729300 732400 736800 741936 748051 753835 758794 764293 769504 773926 778922 785045 792416 799304 : 13800 15000 19000 19800 21000 24600 24900 26000 25400 26500 26200 27500 29200 24900 21200 +UKE3 1299610 1301230 1288500 1287700 1285400 1282000 1279400 1277400 1274900 1271800 1268131 1266406 1268270 1271957 1276915 1284068 1290744 1296829 1303766 1312256 1322813 : 11200 12000 14900 16900 17400 20200 20700 21700 20600 22500 23100 24500 25700 21600 18800 +UKE4 2072546 2079616 2064600 2070000 2072600 2072800 2073500 2073500 2072900 2072700 2072967 2078378 2089033 2100386 2114655 2136037 2159433 2179858 2198228 2216876 2238127 : 14300 15300 19200 20700 23100 25500 26200 26700 25500 26900 27400 28600 29100 25700 21900 +UKF1 1952909 1959749 1954500 1960300 1963800 1966400 1968900 1970900 1973300 1976300 1978406 1981104 1989303 2001609 2015028 2029043 2041575 2052460 2064468 2076448 2089452 : 13700 14700 17900 19200 21000 23400 24200 25400 23800 25500 26500 27700 28600 24500 21300 +UKF2 1466702 1476169 1477600 1487900 1496900 1506300 1516100 1524100 1529600 1536900 1545417 1553843 1564441 1576095 1588552 1603268 1620689 1638830 1655137 1667110 1676416 : 14800 16000 20300 22300 23300 26800 26700 27200 26700 29000 29400 30600 32200 27900 24100 +UKF3 584495 588733 592000 598100 603100 609000 614900 619200 623600 629400 636436 643901 651858 660193 669269 676972 682591 688531 693583 696764 700466 : 12800 13800 17000 17100 17300 19400 20900 21800 21400 21500 21000 22700 23800 20500 18000 +UKG1 1167642 1171674 1163800 1170900 1177800 1184000 1188300 1194000 1201700 1207200 1211678 1218862 1226456 1232993 1238716 1244408 1250561 1257082 1264200 1269159 1271724 : 13400 14700 17500 19400 21500 23800 24300 24500 23000 25100 25800 27900 28200 24700 21400 +UKG2 1452300 1458150 1452500 1455300 1459300 1464400 1466900 1469900 1476100 1480100 1482312 1486606 1490862 1494722 1499469 1503834 1507519 1510856 1515528 1520116 1524515 : 12200 13300 16400 18200 18500 20600 20600 21900 20900 22400 22500 24200 25200 21600 18800 +UKG3 2625542 2627840 2617200 2615400 2610500 2604700 2604800 2598700 2589000 2584400 2576802 2569707 2569987 2574112 2578649 2587313 2596626 2602343 2613665 2630480 2646889 : 14900 15800 20300 21400 23100 25900 26600 27200 26000 27200 27600 28100 29600 25100 21400 +UKH1 2051184 2069984 2070500 2074300 2079900 2091300 2106100 2121700 2137800 2151800 2165948 2177336 2187310 2205526 2226918 2249877 2272258 2292620 2316063 2336947 2358545 : 14400 15400 18800 19700 21100 24400 25400 26400 25200 27500 28000 30400 31200 26300 22600 +UKH2 1510025 1516673 1518400 1525400 1531700 1538800 1545000 1553100 1564000 1576500 1588427 1598495 1607509 1615272 1620707 1628233 1639929 1653870 1672604 1691975 1711506 : 15800 17100 21600 24500 26500 30600 31100 32100 29900 32400 34500 34500 35900 31300 26500 +UKH3 1541122 1544745 1543000 1548800 1554500 1561700 1568100 1575000 1582700 1592100 1602472 1611887 1620302 1628280 1636766 1647665 1660011 1674480 1694348 1713070 1729185 : 12500 13400 17000 18200 19300 22300 22500 23400 23800 25300 25100 26600 28200 24000 20400 +UKI1 : : 2598700 2599900 2607000 2620500 2642500 2664400 2685800 2725000 2777832 2832162 2874029 2891578 2903040 2929668 2961715 2989558 3016740 3045580 3072182 : 37100 40700 51800 56300 61800 69600 71800 75700 73700 78900 82300 88800 93900 85100 75900 +UKI2 : : 4230700 4237100 4252000 4272800 4301300 4330300 4354400 4384700 4417479 4447395 4471626 4482716 4493346 4519340 4554034 4584846 4618548 4665362 4717185 : 14100 15200 19000 21200 23000 25400 25100 25900 24800 26800 27300 28400 30100 25500 22000 +UKJ1 1954545 1969026 1969900 1981800 1992900 2012400 2032500 2048700 2062500 2075400 2088952 2098583 2103322 2108852 2117761 2131442 2148738 2167656 2190256 2213732 2239547 : 18600 19900 24900 29000 32300 36100 36100 37700 36700 40000 40500 41900 44300 38000 32500 +UKJ2 2442830 2454007 2445100 2449500 2455800 2466800 2477700 2491900 2507500 2527500 2545994 2553979 2560171 2566656 2575492 2587164 2602798 2622408 2643994 2664364 2687897 : 15400 16600 21600 22700 25000 28900 29800 30600 29300 30600 31100 33400 34800 30100 25900 +UKJ3 1697581 1703752 1699300 1704900 1713100 1724200 1734400 1743900 1752200 1761400 1769787 1777436 1785116 1792884 1800780 1810739 1821917 1833776 1849182 1863510 1876967 : 13600 15700 19400 21400 22500 24900 26600 27900 25900 28000 29000 31000 32800 28600 25200 +UKJ4 1529638 1533647 1528600 1528700 1530600 1533900 1537100 1542200 1548700 1557600 1568128 1577025 1584611 1593050 1603227 1614419 1625128 1636050 1648570 1660504 1674986 : 12700 13200 16200 17600 19300 21600 22500 23500 22900 24500 25700 26400 27600 24200 20600 +UKK1 2057601 2068527 2068000 2078200 2087800 2096900 2104900 2116800 2130300 2143700 2157968 2168292 2177935 2190684 2207772 2229492 2250583 2273243 2297109 2316751 2339669 : 15800 17700 22500 25000 26400 29100 30000 31500 30500 32300 32500 33600 35400 30300 26100 +UKK2 1120995 1126364 1126200 1132600 1139300 1147700 1153800 1160400 1167900 1173300 1180185 1188368 1195728 1201511 1205588 1210699 1217045 1225550 1233089 1234465 1236950 : 12500 13100 16200 17600 19700 23300 22900 23000 22300 24000 25600 26900 27800 24200 21400 +UKK3 : : 472300 473900 476100 478900 480600 483000 486600 490300 495030 499775 504890 510103 514233 517999 521941 526235 530037 532376 535365 : 9100 9800 11900 12800 13500 15900 16500 18500 17900 18700 18600 20900 21500 19200 16500 +UKK4 : : 1034600 1039100 1042200 1046000 1048200 1050000 1053600 1057900 1065833 1073784 1079364 1085364 1093655 1104299 1115002 1126126 1134198 1137222 1140502 : 12700 13600 16500 16400 18200 20200 21600 22300 20800 23400 23600 25600 26200 22900 19800 +UKL1 : : 1857400 1859400 1861000 1860700 1858000 1855700 1854400 1852900 1852710 1853860 1856794 1862445 1869992 1874798 1878273 1884553 1890981 1894551 1895856 : 11000 11800 14100 14600 15200 17300 17300 18200 17200 18400 19500 20300 21000 18100 15700 +UKL2 : : 1017900 1021200 1024500 1027300 1031900 1037400 1042800 1047100 1051024 1054692 1057442 1061092 1066155 1071998 1077754 1084483 1092132 1100148 1107019 : 15200 15800 19800 21700 23600 25700 26900 27200 26500 28300 28000 29700 31000 26600 22700 +UKM1 : : 1017900 1021200 1024500 1027300 1031900 1037400 1042800 1047100 1051024 1054692 1057442 1061092 1066155 1071998 1077754 1084483 1092132 1100148 1107019 : 15200 15800 19800 21700 23600 25700 26900 27200 26500 28300 28000 29700 31000 26600 22700 +UKM2 : : : 1943554 1950684 1957633 1956650 1959488 1959268 1964270 1898002 1902374 1904354 1905787 1914347 1927570 1941100 1956616 1972075 1986637 2002483 : 15200 16700 20600 21700 22900 25800 26100 27800 26600 28700 29400 31800 33400 28600 25100 +UKM3 : : : 2364348 2364863 2360979 2354711 2349706 2351916 2345903 2293410 2287840 2284726 2281041 2281482 2282744 2283400 2285828 2289224 2293376 2297793 : 13600 14300 17800 19300 20700 23600 24300 24900 24400 26100 27400 28700 29900 26400 22900 +UKM4 : : : 2364348 2364863 2360979 2354711 2349706 2351916 2345903 2293410 2287840 2284726 2281041 2281482 2282744 2283400 2285828 2289224 2293376 2297793 : 13600 14300 17800 19300 20700 23600 24300 24900 24400 26100 27400 28700 29900 26400 22900 +UKN0 1586162 1595371 1609897 1625117 1636811 1645336 1663305 1680291 1684471 1691824 1681179 1686348 1693190 1699841 1706687 1717584 1733000 1750597 1767300 1782163 1794362 : 11800 12800 15900 17200 18600 21500 21900 22500 21600 23300 24000 25300 26300 22300 19000 \ No newline at end of file diff --git a/spatial/data/bostondata.csv b/spatial/data/bostondata.csv new file mode 100644 index 0000000..0b96591 --- /dev/null +++ b/spatial/data/bostondata.csv @@ -0,0 +1,507 @@ +"","TOWN","TOWNNO","TRACT","LON","LAT","MEDV","CMEDV","CRIM","ZN","INDUS","CHAS","NOX","RM","AGE","DIS","RAD","TAX","PTRATIO","B","LSTAT" +"1","Nahant",0,2011,-70.955,42.255,24,24,0.00632,18,2.31,"0",0.538,6.575,65.2,4.09,1,296,15.3,396.9,4.98 +"2","Swampscott",1,2021,-70.95,42.2875,21.6,21.6,0.02731,0,7.07,"0",0.469,6.421,78.9,4.9671,2,242,17.8,396.9,9.14 +"3","Swampscott",1,2022,-70.936,42.283,34.7,34.7,0.02729,0,7.07,"0",0.469,7.185,61.1,4.9671,2,242,17.8,392.83,4.03 +"4","Marblehead",2,2031,-70.928,42.293,33.4,33.4,0.03237,0,2.18,"0",0.458,6.998,45.8,6.0622,3,222,18.7,394.63,2.94 +"5","Marblehead",2,2032,-70.922,42.298,36.2,36.2,0.06905,0,2.18,"0",0.458,7.147,54.2,6.0622,3,222,18.7,396.9,5.33 +"6","Marblehead",2,2033,-70.9165,42.304,28.7,28.7,0.02985,0,2.18,"0",0.458,6.43,58.7,6.0622,3,222,18.7,394.12,5.21 +"7","Salem",3,2041,-70.936,42.297,22.9,22.9,0.08829,12.5,7.87,"0",0.524,6.012,66.6,5.5605,5,311,15.2,395.6,12.43 +"8","Salem",3,2042,-70.9375,42.31,27.1,22.1,0.14455,12.5,7.87,"0",0.524,6.172,96.1,5.9505,5,311,15.2,396.9,19.15 +"9","Salem",3,2043,-70.933,42.312,16.5,16.5,0.21124,12.5,7.87,"0",0.524,5.631,100,6.0821,5,311,15.2,386.63,29.93 +"10","Salem",3,2044,-70.929,42.316,18.9,18.9,0.17004,12.5,7.87,"0",0.524,6.004,85.9,6.5921,5,311,15.2,386.71,17.1 +"11","Salem",3,2045,-70.935,42.316,15,15,0.22489,12.5,7.87,"0",0.524,6.377,94.3,6.3467,5,311,15.2,392.52,20.45 +"12","Salem",3,2046,-70.944,42.317,18.9,18.9,0.11747,12.5,7.87,"0",0.524,6.009,82.9,6.2267,5,311,15.2,396.9,13.27 +"13","Salem",3,2047,-70.951,42.306,21.7,21.7,0.09378,12.5,7.87,"0",0.524,5.889,39,5.4509,5,311,15.2,390.5,15.71 +"14","Lynn",4,2051,-70.9645,42.292,20.4,20.4,0.62976,0,8.14,"0",0.538,5.949,61.8,4.7075,4,307,21,396.9,8.26 +"15","Lynn",4,2052,-70.972,42.287,18.2,18.2,0.63796,0,8.14,"0",0.538,6.096,84.5,4.4619,4,307,21,380.02,10.26 +"16","Lynn",4,2053,-70.9765,42.294,19.9,19.9,0.62739,0,8.14,"0",0.538,5.834,56.5,4.4986,4,307,21,395.62,8.47 +"17","Lynn",4,2054,-70.987,42.2985,23.1,23.1,1.05393,0,8.14,"0",0.538,5.935,29.3,4.4986,4,307,21,386.85,6.58 +"18","Lynn",4,2055,-70.978,42.285,17.5,17.5,0.7842,0,8.14,"0",0.538,5.99,81.7,4.2579,4,307,21,386.75,14.67 +"19","Lynn",4,2056,-70.9925,42.2825,20.2,20.2,0.80271,0,8.14,"0",0.538,5.456,36.6,3.7965,4,307,21,288.99,11.69 +"20","Lynn",4,2057,-70.988,42.2776,18.2,18.2,0.7258,0,8.14,"0",0.538,5.727,69.5,3.7965,4,307,21,390.95,11.28 +"21","Lynn",4,2058,-70.9835,42.277,13.6,13.6,1.25179,0,8.14,"0",0.538,5.57,98.1,3.7979,4,307,21,376.57,21.02 +"22","Lynn",4,2059,-70.982,42.281,19.6,19.6,0.85204,0,8.14,"0",0.538,5.965,89.2,4.0123,4,307,21,392.53,13.83 +"23","Lynn",4,2060,-70.9775,42.279,15.2,15.2,1.23247,0,8.14,"0",0.538,6.142,91.7,3.9769,4,307,21,396.9,18.72 +"24","Lynn",4,2061,-70.973,42.279,14.5,14.5,0.98843,0,8.14,"0",0.538,5.813,100,4.0952,4,307,21,394.54,19.88 +"25","Lynn",4,2062,-70.9693,42.2816,15.6,15.6,0.75026,0,8.14,"0",0.538,5.924,94.1,4.3996,4,307,21,394.33,16.3 +"26","Lynn",4,2063,-70.964,42.284,13.9,13.9,0.84054,0,8.14,"0",0.538,5.599,85.7,4.4546,4,307,21,303.42,16.51 +"27","Lynn",4,2064,-70.9597,42.287,16.6,16.6,0.67191,0,8.14,"0",0.538,5.813,90.3,4.682,4,307,21,376.88,14.81 +"28","Lynn",4,2065,-70.9597,42.2825,14.8,14.8,0.95577,0,8.14,"0",0.538,6.047,88.8,4.4534,4,307,21,306.38,17.28 +"29","Lynn",4,2066,-70.957,42.28,18.4,18.4,0.77299,0,8.14,"0",0.538,6.495,94.4,4.4547,4,307,21,387.94,12.8 +"30","Lynn",4,2067,-70.951,42.278,21,21,1.00245,0,8.14,"0",0.538,6.674,87.3,4.239,4,307,21,380.23,11.98 +"31","Lynn",4,2068,-70.967,42.279,12.7,12.7,1.13081,0,8.14,"0",0.538,5.713,94.1,4.233,4,307,21,360.17,22.6 +"32","Lynn",4,2069,-70.964,42.2765,14.5,14.5,1.35472,0,8.14,"0",0.538,6.072,100,4.175,4,307,21,376.73,13.04 +"33","Lynn",4,2070,-70.972,42.2765,13.2,13.2,1.38799,0,8.14,"0",0.538,5.95,82,3.99,4,307,21,232.6,27.71 +"34","Lynn",4,2071,-70.9795,42.276,13.1,13.1,1.15172,0,8.14,"0",0.538,5.701,95,3.7872,4,307,21,358.77,18.35 +"35","Lynn",4,2072,-70.9775,42.272,13.5,13.5,1.61282,0,8.14,"0",0.538,6.096,96.9,3.7598,4,307,21,248.31,20.34 +"36","Sargus",5,2081,-71,42.27,18.9,18.9,0.06417,0,5.96,"0",0.499,5.933,68.2,3.3603,5,279,19.2,396.9,9.68 +"37","Sargus",5,2082,-71.008,42.2745,20,20,0.09744,0,5.96,"0",0.499,5.841,61.4,3.3779,5,279,19.2,377.56,11.41 +"38","Sargus",5,2083,-71.004,42.2865,21,21,0.08014,0,5.96,"0",0.499,5.85,41.5,3.9342,5,279,19.2,396.9,8.77 +"39","Sargus",5,2084,-71.02,42.2875,24.7,24.2,0.17505,0,5.96,"0",0.499,5.966,30.2,3.8473,5,279,19.2,393.43,10.13 +"40","Lynnfield",6,2091,-71.013,42.313,30.8,30.8,0.02763,75,2.95,"0",0.428,6.595,21.8,5.4011,3,252,18.3,395.63,4.32 +"41","Lynnfield",6,2092,-71.03,42.324,34.9,34.9,0.03359,75,2.95,"0",0.428,7.024,15.8,5.4011,3,252,18.3,395.62,1.98 +"42","Peabody",7,2101,-71.004,42.335,26.6,26.6,0.12744,0,6.91,"0",0.448,6.77,2.9,5.7209,3,233,17.9,385.41,4.84 +"43","Peabody",7,2102,-71.003,42.3235,25.3,25.3,0.1415,0,6.91,"0",0.448,6.169,6.6,5.7209,3,233,17.9,383.37,5.81 +"44","Peabody",7,2103,-70.9775,42.3237,24.7,24.7,0.15936,0,6.91,"0",0.448,6.211,6.5,5.7209,3,233,17.9,394.46,7.44 +"45","Peabody",7,2104,-70.9675,42.317,21.2,21.2,0.12269,0,6.91,"0",0.448,6.069,40,5.7209,3,233,17.9,389.39,9.55 +"46","Peabody",7,2105,-70.9725,42.3075,19.3,19.3,0.17142,0,6.91,"0",0.448,5.682,33.8,5.1004,3,233,17.9,396.9,10.21 +"47","Peabody",7,2106,-70.965,42.3075,20,20,0.18836,0,6.91,"0",0.448,5.786,33.3,5.1004,3,233,17.9,396.9,14.15 +"48","Peabody",7,2107,-70.956,42.3125,16.6,16.6,0.22927,0,6.91,"0",0.448,6.03,85.5,5.6894,3,233,17.9,392.74,18.8 +"49","Peabody",7,2108,-70.955,42.3165,14.4,14.4,0.25387,0,6.91,"0",0.448,5.399,95.3,5.87,3,233,17.9,396.9,30.81 +"50","Peabody",7,2109,-70.9525,42.3208,19.4,19.4,0.21977,0,6.91,"0",0.448,5.602,62,6.0877,3,233,17.9,396.9,16.2 +"51","Danvers",8,2111,-70.951,42.334,19.7,19.7,0.08873,21,5.64,"0",0.439,5.963,45.7,6.8147,4,243,16.8,395.56,13.45 +"52","Danvers",8,2112,-70.963,42.3382,20.5,20.5,0.04337,21,5.64,"0",0.439,6.115,63,6.8147,4,243,16.8,393.97,9.43 +"53","Danvers",8,2113,-70.958,42.346,25,25,0.0536,21,5.64,"0",0.439,6.511,21.1,6.8147,4,243,16.8,396.9,5.28 +"54","Danvers",8,2114,-70.978,42.3425,23.4,23.4,0.04981,21,5.64,"0",0.439,5.998,21.4,6.8147,4,243,16.8,396.9,8.43 +"55","Middleton",9,2121,-71.0175,42.3715,18.9,18.9,0.0136,75,4,"0",0.41,5.888,47.6,7.3197,3,469,21.1,396.9,14.8 +"56","Topsfield",10,2141,-70.9625,42.381,35.4,35.4,0.01311,90,1.22,"0",0.403,7.249,21.9,8.6966,5,226,17.9,395.93,4.81 +"57","Hamilton",11,2151,-70.93,42.374,24.7,24.7,0.02055,85,0.74,"0",0.41,6.383,35.7,9.1876,2,313,17.3,396.9,5.77 +"58","Wenham",12,2161,-70.9295,42.3715,31.6,31.6,0.01432,100,1.32,"0",0.411,6.816,40.5,8.3248,5,256,15.1,392.9,3.95 +"59","Beverly",13,2171,-70.9385,42.346,23.3,23.3,0.15445,25,5.13,"0",0.453,6.145,29.2,7.8148,8,284,19.7,390.68,6.86 +"60","Beverly",13,2172,-70.94,42.332,19.6,19.6,0.10328,25,5.13,"0",0.453,5.927,47.2,6.932,8,284,19.7,396.9,9.22 +"61","Beverly",13,2173,-70.93,42.337,18.7,18.7,0.14932,25,5.13,"0",0.453,5.741,66.2,7.2254,8,284,19.7,395.11,13.15 +"62","Beverly",13,2174,-70.93,42.3275,16,16,0.17171,25,5.13,"0",0.453,5.966,93.4,6.8185,8,284,19.7,378.08,14.44 +"63","Beverly",13,2175,-70.9215,42.332,22.2,22.2,0.11027,25,5.13,"0",0.453,6.456,67.8,7.2255,8,284,19.7,396.9,6.73 +"64","Beverly",13,2176,-70.9075,42.339,25,25,0.1265,25,5.13,"0",0.453,6.762,43.4,7.9809,8,284,19.7,395.58,9.5 +"65","Manchester",14,2181,-70.86,42.345,33,33,0.01951,17.5,1.38,"0",0.4161,7.104,59.5,9.2229,3,216,18.6,393.24,8.05 +"66","North Reading",15,3301,-71.045,42.345,23.5,23.5,0.03584,80,3.37,"0",0.398,6.29,17.8,6.6115,4,337,16.1,396.9,4.67 +"67","North Reading",15,3302,-71.069,42.3525,19.4,19.4,0.04379,80,3.37,"0",0.398,5.787,31.1,6.6115,4,337,16.1,396.9,10.24 +"68","Wilmington",16,3311,-71.09,42.3362,22,22,0.05789,12.5,6.07,"0",0.409,5.878,21.4,6.498,4,345,18.9,396.21,8.1 +"69","Wilmington",16,3312,-71.108,42.34,17.4,17.4,0.13554,12.5,6.07,"0",0.409,5.594,36.8,6.498,4,345,18.9,396.9,13.09 +"70","Wilmington",16,3313,-71.111,42.327,20.9,20.9,0.12816,12.5,6.07,"0",0.409,5.885,33,6.498,4,345,18.9,396.9,8.79 +"71","Burlington",17,3321,-71.121,42.316,24.2,24.2,0.08826,0,10.81,"0",0.413,6.417,6.6,5.2873,4,305,19.2,383.73,6.72 +"72","Burlington",17,3322,-71.1095,42.3008,21.7,21.7,0.15876,0,10.81,"0",0.413,5.961,17.5,5.2873,4,305,19.2,376.94,9.88 +"73","Burlington",17,3323,-71.13,42.305,22.8,22.8,0.09164,0,10.81,"0",0.413,6.065,7.8,5.2873,4,305,19.2,390.91,5.52 +"74","Burlington",17,3324,-71.123,42.292,23.4,23.4,0.19539,0,10.81,"0",0.413,6.245,6.2,5.2873,4,305,19.2,377.17,7.54 +"75","Woburn",18,3331,-71.1105,42.289,24.1,24.1,0.07896,0,12.83,"0",0.437,6.273,6,4.2515,5,398,18.7,394.92,6.78 +"76","Woburn",18,3332,-71.1,42.2875,21.4,21.4,0.09512,0,12.83,"0",0.437,6.286,45,4.5026,5,398,18.7,383.23,8.94 +"77","Woburn",18,3333,-71.09,42.2835,20,20,0.10153,0,12.83,"0",0.437,6.279,74.5,4.0522,5,398,18.7,373.66,11.97 +"78","Woburn",18,3334,-71.076,42.2895,20.8,20.8,0.08707,0,12.83,"0",0.437,6.14,45.8,4.0905,5,398,18.7,386.96,10.27 +"79","Woburn",18,3335,-71.0905,42.295,21.2,21.2,0.05646,0,12.83,"0",0.437,6.232,53.7,5.0141,5,398,18.7,386.4,12.34 +"80","Woburn",18,3336,-71.091,42.305,20.3,20.3,0.08387,0,12.83,"0",0.437,5.874,36.6,4.5026,5,398,18.7,396.06,9.1 +"81","Reading",19,3341,-71.0685,42.308,28,28,0.04113,25,4.86,"0",0.426,6.727,33.5,5.4007,4,281,19,396.9,5.29 +"82","Reading",19,3342,-71.069,42.315,23.9,23.9,0.04462,25,4.86,"0",0.426,6.619,70.4,5.4007,4,281,19,395.63,7.22 +"83","Reading",19,3343,-71.0675,42.326,24.8,24.8,0.03659,25,4.86,"0",0.426,6.302,32.2,5.4007,4,281,19,396.9,6.72 +"84","Reading",19,3344,-71.0575,42.317,22.9,22.9,0.03551,25,4.86,"0",0.426,6.167,46.7,5.4007,4,281,19,390.64,7.51 +"85","Wakefield",20,3351,-71.043,42.3075,23.9,23.9,0.05059,0,4.49,"0",0.449,6.389,48,4.7794,3,247,18.5,396.9,9.62 +"86","Wakefield",20,3352,-71.05,42.3,26.6,26.6,0.05735,0,4.49,"0",0.449,6.63,56.1,4.4377,3,247,18.5,392.3,6.53 +"87","Wakefield",20,3353,-71.033,42.305,22.5,22.5,0.05188,0,4.49,"0",0.449,6.015,45.1,4.4272,3,247,18.5,395.99,12.86 +"88","Wakefield",20,3354,-71.039,42.2885,22.2,22.2,0.07151,0,4.49,"0",0.449,6.121,56.8,3.7476,3,247,18.5,395.15,8.44 +"89","Melrose",21,3361,-71.042,42.2796,23.6,23.6,0.0566,0,3.41,"0",0.489,7.007,86.3,3.4217,2,270,17.8,396.9,5.5 +"90","Melrose",21,3362,-71.0345,42.2785,28.7,28.7,0.05302,0,3.41,"0",0.489,7.079,63.1,3.4145,2,270,17.8,396.06,5.7 +"91","Melrose",21,3363,-71.03,42.272,22.6,22.6,0.04684,0,3.41,"0",0.489,6.417,66.1,3.0923,2,270,17.8,392.18,8.81 +"92","Melrose",21,3364,-71.0425,42.2715,22,22,0.03932,0,3.41,"0",0.489,6.405,73.9,3.0921,2,270,17.8,393.55,8.2 +"93","Stoneham",22,3371,-71.053,42.283,22.9,22.9,0.04203,28,15.04,"0",0.464,6.442,53.6,3.6659,4,270,18.2,395.01,8.16 +"94","Stoneham",22,3372,-71.062,42.296,25,25,0.02875,28,15.04,"0",0.464,6.211,28.9,3.6659,4,270,18.2,396.33,6.21 +"95","Stoneham",22,3373,-71.0615,42.284,20.6,20.6,0.04294,28,15.04,"0",0.464,6.249,77.3,3.615,4,270,18.2,396.9,10.59 +"96","Winchester",23,3381,-71.076,42.2775,28.4,28.4,0.12204,0,2.89,"0",0.445,6.625,57.8,3.4952,2,276,18,357.98,6.65 +"97","Winchester",23,3382,-71.085,42.2775,21.4,21.4,0.11504,0,2.89,"0",0.445,6.163,69.6,3.4952,2,276,18,391.83,11.34 +"98","Winchester",23,3383,-71.089,42.2715,38.7,38.7,0.12083,0,2.89,"0",0.445,8.069,76,3.4952,2,276,18,396.9,4.21 +"99","Winchester",23,3384,-71.0982,42.2685,43.8,43.8,0.08187,0,2.89,"0",0.445,7.82,36.9,3.4952,2,276,18,393.53,3.57 +"100","Winchester",23,3385,-71.08,42.268,33.2,33.2,0.0686,0,2.89,"0",0.445,7.416,62.5,3.4952,2,276,18,396.9,6.19 +"101","Medford",24,3391,-71.0668,42.2545,27.5,27.5,0.14866,0,8.56,"0",0.52,6.727,79.9,2.7778,5,384,20.9,394.76,9.42 +"102","Medford",24,3392,-71.081,42.245,26.5,26.5,0.11432,0,8.56,"0",0.52,6.781,71.3,2.8561,5,384,20.9,395.58,7.67 +"103","Medford",24,3393,-71.0812,42.2515,18.6,18.6,0.22876,0,8.56,"0",0.52,6.405,85.4,2.7147,5,384,20.9,70.8,10.63 +"104","Medford",24,3394,-71.077,42.249,19.3,19.3,0.21161,0,8.56,"0",0.52,6.137,87.4,2.7147,5,384,20.9,394.47,13.44 +"105","Medford",24,3395,-71.069,42.248,20.1,20.1,0.1396,0,8.56,"0",0.52,6.167,90,2.421,5,384,20.9,392.69,12.33 +"106","Medford",24,3396,-71.0662,42.2425,19.5,19.5,0.13262,0,8.56,"0",0.52,5.851,96.7,2.1069,5,384,20.9,394.05,16.47 +"107","Medford",24,3397,-71.0622,42.2431,19.5,19.5,0.1712,0,8.56,"0",0.52,5.836,91.9,2.211,5,384,20.9,395.67,18.66 +"108","Medford",24,3398,-71.0553,42.2465,20.4,20.4,0.13117,0,8.56,"0",0.52,6.127,85.2,2.1224,5,384,20.9,387.69,14.09 +"109","Medford",24,3399,-71.055,42.2505,19.8,19.8,0.12802,0,8.56,"0",0.52,6.474,97.1,2.4329,5,384,20.9,395.24,12.27 +"110","Medford",24,3400,-71.06,42.254,19.4,19.4,0.26363,0,8.56,"0",0.52,6.229,91.2,2.5451,5,384,20.9,391.23,15.55 +"111","Medford",24,3401,-71.056,42.2605,21.7,21.7,0.10793,0,8.56,"0",0.52,6.195,54.4,2.7778,5,384,20.9,393.49,13 +"112","Malden",25,3411,-71.0475,42.261,22.8,22.8,0.10084,0,10.01,"0",0.547,6.715,81.6,2.6775,6,432,17.8,395.59,10.16 +"113","Malden",25,3412,-71.049,42.253,18.8,18.8,0.12329,0,10.01,"0",0.547,5.913,92.9,2.3534,6,432,17.8,394.95,16.21 +"114","Malden",25,3413,-71.0428,42.258,18.7,18.7,0.22212,0,10.01,"0",0.547,6.092,95.4,2.548,6,432,17.8,396.9,17.09 +"115","Malden",25,3414,-71.0396,42.2512,18.5,18.5,0.14231,0,10.01,"0",0.547,6.254,84.2,2.2565,6,432,17.8,388.74,10.45 +"116","Malden",25,3415,-71.0355,42.2545,18.3,18.3,0.17134,0,10.01,"0",0.547,5.928,88.2,2.4631,6,432,17.8,344.91,15.76 +"117","Malden",25,3416,-71.036,42.2608,21.2,21.2,0.13158,0,10.01,"0",0.547,6.176,72.5,2.7301,6,432,17.8,393.3,12.04 +"118","Malden",25,3417,-71.0285,42.262,19.2,19.2,0.15098,0,10.01,"0",0.547,6.021,82.6,2.7474,6,432,17.8,394.51,10.3 +"119","Malden",25,3418,-71.0285,42.258,20.4,20.4,0.13058,0,10.01,"0",0.547,5.872,73.1,2.4775,6,432,17.8,338.63,15.37 +"120","Malden",25,3419,-71.019,42.2605,19.3,19.3,0.14476,0,10.01,"0",0.547,5.731,65.2,2.7592,6,432,17.8,391.5,13.61 +"121","Everett",26,3421,-71.0243,42.2483,22,22,0.06899,0,25.65,"0",0.581,5.87,69.7,2.2577,2,188,19.1,389.15,14.37 +"122","Everett",26,3422,-71.0312,42.2505,20.3,20.3,0.07165,0,25.65,"0",0.581,6.004,84.1,2.1974,2,188,19.1,377.67,14.27 +"123","Everett",26,3423,-71.0377,42.247,20.5,20.5,0.09299,0,25.65,"0",0.581,5.961,92.9,2.0869,2,188,19.1,378.09,17.93 +"124","Everett",26,3424,-71.037,42.2435,17.3,17.3,0.15038,0,25.65,"0",0.581,5.856,97,1.9444,2,188,19.1,370.31,25.41 +"125","Everett",26,3425,-71.0308,42.245,18.8,18.8,0.09849,0,25.65,"0",0.581,5.879,95.8,2.0063,2,188,19.1,379.38,17.58 +"126","Everett",26,3426,-71.0262,42.2431,21.4,21.4,0.16902,0,25.65,"0",0.581,5.986,88.4,1.9929,2,188,19.1,385.02,14.81 +"127","Everett",26,3427,-71.0333,42.2395,15.7,15.7,0.38735,0,25.65,"0",0.581,5.613,95.6,1.7572,2,188,19.1,359.29,27.26 +"128","Somerville",27,3501,-71.053,42.2355,16.2,16.2,0.25915,0,21.89,"0",0.624,5.693,96,1.7883,4,437,21.2,392.11,17.19 +"129","Somerville",27,3502,-71.058,42.235,18,18,0.32543,0,21.89,"0",0.624,6.431,98.8,1.8125,4,437,21.2,396.9,15.39 +"130","Somerville",27,3503,-71.0638,42.2368,14.3,14.3,0.88125,0,21.89,"0",0.624,5.637,94.7,1.9799,4,437,21.2,396.9,18.34 +"131","Somerville",27,3504,-71.0692,42.239,19.2,19.2,0.34006,0,21.89,"0",0.624,6.458,98.9,2.1185,4,437,21.2,395.04,12.6 +"132","Somerville",27,3505,-71.075,42.24,19.6,19.6,1.19294,0,21.89,"0",0.624,6.326,97.7,2.271,4,437,21.2,396.9,12.26 +"133","Somerville",27,3506,-71.0745,42.2405,23,23,0.59005,0,21.89,"0",0.624,6.372,97.9,2.3274,4,437,21.2,385.76,11.12 +"134","Somerville",27,3507,-71.079,42.245,18.4,18.4,0.32982,0,21.89,"0",0.624,5.822,95.4,2.4699,4,437,21.2,388.69,15.03 +"135","Somerville",27,3508,-71.076,42.2405,15.6,15.6,0.97617,0,21.89,"0",0.624,5.757,98.4,2.346,4,437,21.2,262.76,17.31 +"136","Somerville",27,3509,-71.075,42.2362,18.1,18.1,0.55778,0,21.89,"0",0.624,6.335,98.2,2.1107,4,437,21.2,394.67,16.96 +"137","Somerville",27,3510,-71.0677,42.2335,17.4,17.4,0.32264,0,21.89,"0",0.624,5.942,93.5,1.9669,4,437,21.2,378.25,16.9 +"138","Somerville",27,3511,-71.063,42.2325,17.1,17.1,0.35233,0,21.89,"0",0.624,6.454,98.4,1.8498,4,437,21.2,394.08,14.59 +"139","Somerville",27,3512,-71.062,42.2275,13.3,13.3,0.2498,0,21.89,"0",0.624,5.857,98.2,1.6686,4,437,21.2,392.04,21.32 +"140","Somerville",27,3513,-71.0568,42.23,17.8,17.8,0.54452,0,21.89,"0",0.624,6.151,97.9,1.6687,4,437,21.2,396.9,18.46 +"141","Somerville",27,3514,-71.0518,42.2312,14,14,0.2909,0,21.89,"0",0.624,6.174,93.6,1.6119,4,437,21.2,388.08,24.16 +"142","Somerville",27,3515,-71.0543,42.2265,14.4,14.4,1.62864,0,21.89,"0",0.624,5.019,100,1.4394,4,437,21.2,396.9,34.41 +"143","Cambridge",28,3521,-71.048,42.2222,13.4,13.4,3.32105,0,19.58,"1",0.871,5.403,100,1.3216,5,403,14.7,396.9,26.82 +"144","Cambridge",28,3522,-71.0519,42.223,15.6,15.6,4.0974,0,19.58,"0",0.871,5.468,100,1.4118,5,403,14.7,396.9,26.42 +"145","Cambridge",28,3523,-71.051,42.2205,11.8,11.8,2.77974,0,19.58,"0",0.871,4.903,97.8,1.3459,5,403,14.7,396.9,29.29 +"146","Cambridge",28,3524,-71.054,42.219,13.8,13.8,2.37934,0,19.58,"0",0.871,6.13,100,1.4191,5,403,14.7,172.91,27.8 +"147","Cambridge",28,3525,-71.059,42.221,15.6,15.6,2.15505,0,19.58,"0",0.871,5.628,100,1.5166,5,403,14.7,169.27,16.65 +"148","Cambridge",28,3526,-71.0555,42.2222,14.6,14.6,2.36862,0,19.58,"0",0.871,4.926,95.7,1.4608,5,403,14.7,391.71,29.53 +"149","Cambridge",28,3527,-71.0567,42.224,17.8,17.8,2.33099,0,19.58,"0",0.871,5.186,93.8,1.5296,5,403,14.7,356.99,28.32 +"150","Cambridge",28,3528,-71.058,42.223,15.4,15.4,2.73397,0,19.58,"0",0.871,5.597,94.9,1.5257,5,403,14.7,351.85,21.45 +"151","Cambridge",28,3529,-71.062,42.2236,21.5,21.5,1.6566,0,19.58,"0",0.871,6.122,97.3,1.618,5,403,14.7,372.8,14.1 +"152","Cambridge",28,3530,-71.0622,42.2205,19.6,19.6,1.49632,0,19.58,"0",0.871,5.404,100,1.5916,5,403,14.7,341.6,13.28 +"153","Cambridge",28,3531,-71.059,42.217,15.3,15.3,1.12658,0,19.58,"1",0.871,5.012,88,1.6102,5,403,14.7,343.28,12.12 +"154","Cambridge",28,3532,-71.0645,42.215,19.4,19.4,2.14918,0,19.58,"0",0.871,5.709,98.5,1.6232,5,403,14.7,261.95,15.79 +"155","Cambridge",28,3533,-71.0662,42.2162,17,17,1.41385,0,19.58,"1",0.871,6.129,96,1.7494,5,403,14.7,321.02,15.12 +"156","Cambridge",28,3534,-71.068,42.215,15.6,15.6,3.53501,0,19.58,"1",0.871,6.152,82.6,1.7455,5,403,14.7,88.01,15.02 +"157","Cambridge",28,3535,-71.0667,42.22,13.1,13.1,2.44668,0,19.58,"0",0.871,5.272,94,1.7364,5,403,14.7,88.63,16.14 +"158","Cambridge",28,3536,-71.069,42.2285,41.3,41.3,1.22358,0,19.58,"0",0.605,6.943,97.4,1.8773,5,403,14.7,363.43,4.59 +"159","Cambridge",28,3537,-71.067,42.2245,24.3,24.3,1.34284,0,19.58,"0",0.605,6.066,100,1.7573,5,403,14.7,353.89,6.43 +"160","Cambridge",28,3538,-71.065,42.2223,23.3,23.3,1.42502,0,19.58,"0",0.871,6.51,100,1.7659,5,403,14.7,364.31,7.39 +"161","Cambridge",28,3539,-71.07,42.2214,27,27,1.27346,0,19.58,"1",0.605,6.25,92.6,1.7984,5,403,14.7,338.92,5.5 +"162","Cambridge",28,3540,-71.0735,42.2282,50,50,1.46336,0,19.58,"0",0.605,7.489,90.8,1.9709,5,403,14.7,374.43,1.73 +"163","Cambridge",28,3541,-71.077,42.225,50,50,1.83377,0,19.58,"1",0.605,7.802,98.2,2.0407,5,403,14.7,389.61,1.92 +"164","Cambridge",28,3542,-71.0815,42.225,50,50,1.51902,0,19.58,"1",0.605,8.375,93.9,2.162,5,403,14.7,388.45,3.32 +"165","Cambridge",28,3543,-71.0918,42.2265,22.7,22.7,2.24236,0,19.58,"0",0.605,5.854,91.8,2.422,5,403,14.7,395.11,11.64 +"166","Cambridge",28,3544,-71.082,42.2295,25,25,2.924,0,19.58,"0",0.605,6.101,93,2.2834,5,403,14.7,240.16,9.81 +"167","Cambridge",28,3545,-71.077,42.2305,50,50,2.01019,0,19.58,"0",0.605,7.929,96.2,2.0459,5,403,14.7,369.3,3.7 +"168","Cambridge",28,3546,-71.0866,42.2345,23.8,23.8,1.80028,0,19.58,"0",0.605,5.877,79.2,2.4259,5,403,14.7,227.61,12.14 +"169","Cambridge",28,3547,-71.074,42.2331,23.8,23.8,2.3004,0,19.58,"0",0.605,6.319,96.1,2.1,5,403,14.7,297.09,11.1 +"170","Cambridge",28,3548,-71.0775,42.2351,22.3,22.3,2.44953,0,19.58,"0",0.605,6.402,95.2,2.2625,5,403,14.7,330.04,11.32 +"171","Cambridge",28,3549,-71.081,42.2368,17.4,17.4,1.20742,0,19.58,"0",0.605,5.875,94.6,2.4259,5,403,14.7,292.29,14.43 +"172","Cambridge",28,3550,-71.0792,42.239,19.1,19.1,2.3139,0,19.58,"0",0.605,5.88,97.3,2.3887,5,403,14.7,348.13,12.03 +"173","Arlington",29,3561,-71.087,42.2416,23.1,23.1,0.13914,0,4.05,"0",0.51,5.572,88.5,2.5961,5,296,16.6,396.9,14.69 +"174","Arlington",29,3562,-71.0855,42.245,23.6,23.6,0.09178,0,4.05,"0",0.51,6.416,84.1,2.6463,5,296,16.6,395.5,9.04 +"175","Arlington",29,3563,-71.0833,42.2475,22.6,22.6,0.08447,0,4.05,"0",0.51,5.859,68.7,2.7019,5,296,16.6,393.23,9.64 +"176","Arlington",29,3564,-71.094,42.2575,29.4,29.4,0.06664,0,4.05,"0",0.51,6.546,33.1,3.1323,5,296,16.6,390.96,5.33 +"177","Arlington",29,3565,-71.1125,42.255,23.2,23.2,0.07022,0,4.05,"0",0.51,6.02,47.2,3.5549,5,296,16.6,393.23,10.11 +"178","Arlington",29,3566,-71.106,42.2512,24.6,24.6,0.05425,0,4.05,"0",0.51,6.315,73.4,3.3175,5,296,16.6,395.6,6.29 +"179","Arlington",29,3567,-71.0965,42.247,29.9,29.9,0.06642,0,4.05,"0",0.51,6.86,74.4,2.9153,5,296,16.6,391.27,6.92 +"180","Belmont",30,3571,-71.1,42.2408,37.2,37.2,0.0578,0,2.46,"0",0.488,6.98,58.4,2.829,3,193,17.8,396.9,5.04 +"181","Belmont",30,3572,-71.0995,42.2345,39.8,39.8,0.06588,0,2.46,"0",0.488,7.765,83.3,2.741,3,193,17.8,395.56,7.56 +"182","Belmont",30,3573,-71.0966,42.2282,36.2,36.2,0.06888,0,2.46,"0",0.488,6.144,62.2,2.5979,3,193,17.8,396.9,9.45 +"183","Belmont",30,3574,-71.1005,42.2287,37.9,37.9,0.09103,0,2.46,"0",0.488,7.155,92.2,2.7006,3,193,17.8,394.12,4.82 +"184","Belmont",30,3575,-71.1065,42.23,32.5,32.5,0.10008,0,2.46,"0",0.488,6.563,95.6,2.847,3,193,17.8,396.9,5.68 +"185","Belmont",30,3576,-71.112,42.23,26.4,26.4,0.08308,0,2.46,"0",0.488,5.604,89.8,2.9879,3,193,17.8,391,13.98 +"186","Belmont",30,3577,-71.1175,42.235,29.6,29.6,0.06047,0,2.46,"0",0.488,6.153,68.8,3.2797,3,193,17.8,387.11,13.15 +"187","Belmont",30,3578,-71.1115,42.2442,50,50,0.05602,0,2.46,"0",0.488,7.831,53.6,3.1992,3,193,17.8,392.63,4.45 +"188","Lexington",31,3581,-71.122,42.2565,32,32,0.07875,45,3.44,"0",0.437,6.782,41.1,3.7886,5,398,15.2,393.87,6.68 +"189","Lexington",31,3583,-71.1408,42.255,29.8,29.8,0.12579,45,3.44,"0",0.437,6.556,29.1,4.5667,5,398,15.2,382.84,4.56 +"190","Lexington",31,3584,-71.145,42.2651,34.9,34.9,0.0837,45,3.44,"0",0.437,7.185,38.9,4.5667,5,398,15.2,396.9,5.39 +"191","Lexington",31,3585,-71.1216,42.27,37,33,0.09068,45,3.44,"0",0.437,6.951,21.5,6.4798,5,398,15.2,377.68,5.1 +"192","Lexington",31,3586,-71.1485,42.2765,30.5,30.5,0.06911,45,3.44,"0",0.437,6.739,30.8,6.4798,5,398,15.2,389.71,4.69 +"193","Lexington",31,3587,-71.134,42.2785,36.4,36.4,0.08664,45,3.44,"0",0.437,7.178,26.3,6.4798,5,398,15.2,390.49,2.87 +"194","Bedford",32,3591,-71.1525,42.3,31.1,31.1,0.02187,60,2.93,"0",0.401,6.8,9.9,6.2196,1,265,15.6,393.37,5.03 +"195","Bedford",32,3592,-71.1633,42.303,29.1,29.1,0.01439,60,2.93,"0",0.401,6.604,18.8,6.2196,1,265,15.6,376.7,4.38 +"196","Lincoln",33,3602,-71.189,42.2525,50,50,0.01381,80,0.46,"0",0.422,7.875,32,5.6484,4,255,14.4,394.23,2.97 +"197","Concord",34,3611,-71.22,42.2715,33.3,33.3,0.04011,80,1.52,"0",0.404,7.287,34.1,7.309,2,329,12.6,396.9,4.08 +"198","Concord",34,3612,-71.24,42.2725,30.3,30.3,0.04666,80,1.52,"0",0.404,7.107,36.6,7.309,2,329,12.6,354.31,8.61 +"199","Concord",34,3613,-71.222,42.289,34.6,34.6,0.03768,80,1.52,"0",0.404,7.274,38.3,7.309,2,329,12.6,392.2,6.62 +"200","Sudbury",35,3651,-71.244,42.2425,34.9,34.9,0.0315,95,1.47,"0",0.403,6.975,15.3,7.6534,3,402,17,396.9,4.56 +"201","Sudbury",35,3652,-71.263,42.2225,32.9,32.9,0.01778,95,1.47,"0",0.403,7.135,13.9,7.6534,3,402,17,384.3,4.45 +"202","Wayland",36,3661,-71.2185,42.1955,24.1,24.1,0.03445,82.5,2.03,"0",0.415,6.162,38.4,6.27,2,348,14.7,393.77,7.43 +"203","Wayland",36,3662,-71.214,42.218,42.3,42.3,0.02177,82.5,2.03,"0",0.415,7.61,15.7,6.27,2,348,14.7,395.38,3.11 +"204","Weston",37,3671,-71.199,42.232,48.5,48.5,0.0351,95,2.68,"0",0.4161,7.853,33.2,5.118,4,224,14.7,392.78,3.81 +"205","Weston",37,3672,-71.199,42.2058,50,50,0.02009,95,2.68,"0",0.4161,8.034,31.9,5.118,4,224,14.7,390.55,2.88 +"206","Waltham",38,3681,-71.1475,42.2445,22.6,22.6,0.13642,0,10.59,"0",0.489,5.891,22.3,3.9454,4,277,18.6,396.9,10.87 +"207","Waltham",38,3682,-71.15,42.2308,24.4,24.4,0.22969,0,10.59,"0",0.489,6.326,52.5,4.3549,4,277,18.6,394.87,10.97 +"208","Waltham",38,3683,-71.149,42.2268,22.5,22.5,0.25199,0,10.59,"0",0.489,5.783,72.7,4.3549,4,277,18.6,389.43,18.06 +"209","Waltham",38,3684,-71.1503,42.222,24.4,24.4,0.13587,0,10.59,"1",0.489,6.064,59.1,4.2392,4,277,18.6,381.32,14.66 +"210","Waltham",38,3685,-71.143,42.2217,20,20,0.43571,0,10.59,"1",0.489,5.344,100,3.875,4,277,18.6,396.9,23.09 +"211","Waltham",38,3686,-71.1435,42.2177,21.7,21.7,0.17446,0,10.59,"1",0.489,5.96,92.1,3.8771,4,277,18.6,393.25,17.27 +"212","Waltham",38,3687,-71.138,42.2216,19.3,19.3,0.37578,0,10.59,"1",0.489,5.404,88.6,3.665,4,277,18.6,395.24,23.98 +"213","Waltham",38,3688,-71.1335,42.225,22.4,22.4,0.21719,0,10.59,"1",0.489,5.807,53.8,3.6526,4,277,18.6,390.94,16.03 +"214","Waltham",38,3689,-71.1375,42.2355,28.1,28.1,0.14052,0,10.59,"0",0.489,6.375,32.3,3.9454,4,277,18.6,385.81,9.38 +"215","Waltham",38,3690,-71.127,42.235,23.7,23.7,0.28955,0,10.59,"0",0.489,5.412,9.8,3.5875,4,277,18.6,348.93,29.55 +"216","Waltham",38,3691,-71.1245,42.2277,25,25,0.19802,0,10.59,"0",0.489,6.182,42.4,3.9454,4,277,18.6,393.63,9.47 +"217","Watertown",39,3701,-71.1166,42.223,23.3,23.3,0.0456,0,13.89,"1",0.55,5.888,56,3.1121,5,276,16.4,392.8,13.51 +"218","Watertown",39,3702,-71.105,42.2235,28.7,28.7,0.07013,0,13.89,"0",0.55,6.642,85.1,3.4211,5,276,16.4,392.78,9.69 +"219","Watertown",39,3703,-71.0933,42.222,21.5,21.5,0.11069,0,13.89,"1",0.55,5.951,93.8,2.8893,5,276,16.4,396.9,17.92 +"220","Watertown",39,3704,-71.106,42.2185,23,23,0.11425,0,13.89,"1",0.55,6.373,92.4,3.3633,5,276,16.4,393.74,10.5 +"221","Newton",40,3731,-71.11,42.2137,26.7,26.7,0.35809,0,6.2,"1",0.507,6.951,88.5,2.8617,8,307,17.4,391.7,9.71 +"222","Newton",40,3732,-71.121,42.2166,21.7,21.7,0.40771,0,6.2,"1",0.507,6.164,91.3,3.048,8,307,17.4,395.24,21.46 +"223","Newton",40,3733,-71.125,42.2134,27.5,27.5,0.62356,0,6.2,"1",0.507,6.879,77.7,3.2721,8,307,17.4,390.39,9.93 +"224","Newton",40,3734,-71.1208,42.2183,30.1,30.1,0.6147,0,6.2,"0",0.507,6.618,80.8,3.2721,8,307,17.4,396.9,7.6 +"225","Newton",40,3735,-71.11,42.206,44.8,44.8,0.31533,0,6.2,"0",0.504,8.266,78.3,2.8944,8,307,17.4,385.05,4.14 +"226","Newton",40,3736,-71.1012,42.1975,50,50,0.52693,0,6.2,"0",0.504,8.725,83,2.8944,8,307,17.4,382,4.63 +"227","Newton",40,3737,-71.1215,42.2025,37.6,37.6,0.38214,0,6.2,"0",0.504,8.04,86.5,3.2157,8,307,17.4,387.38,3.13 +"228","Newton",40,3738,-71.116,42.1947,31.6,31.6,0.41238,0,6.2,"0",0.504,7.163,79.9,3.2157,8,307,17.4,372.08,6.36 +"229","Newton",40,3739,-71.11,42.185,46.7,46.7,0.29819,0,6.2,"0",0.504,7.686,17,3.3751,8,307,17.4,377.51,3.92 +"230","Newton",40,3740,-71.119,42.1807,31.5,31.5,0.44178,0,6.2,"0",0.504,6.552,21.4,3.3751,8,307,17.4,380.34,3.76 +"231","Newton",40,3741,-71.13,42.188,24.3,24.3,0.537,0,6.2,"0",0.504,5.981,68.1,3.6715,8,307,17.4,378.35,11.65 +"232","Newton",40,3742,-71.1285,42.193,31.7,31.7,0.46296,0,6.2,"0",0.504,7.412,76.9,3.6715,8,307,17.4,376.14,5.25 +"233","Newton",40,3743,-71.14,42.1946,41.7,41.7,0.57529,0,6.2,"0",0.507,8.337,73.3,3.8384,8,307,17.4,385.91,2.47 +"234","Newton",40,3744,-71.134,42.204,48.3,48.3,0.33147,0,6.2,"0",0.507,8.247,70.4,3.6519,8,307,17.4,378.95,3.95 +"235","Newton",40,3745,-71.132,42.2142,29,29,0.44791,0,6.2,"1",0.507,6.726,66.5,3.6519,8,307,17.4,360.2,8.05 +"236","Newton",40,3746,-71.138,42.2141,24,24,0.33045,0,6.2,"0",0.507,6.086,61.5,3.6519,8,307,17.4,376.75,10.88 +"237","Newton",40,3747,-71.1485,42.211,25.1,25.1,0.52058,0,6.2,"1",0.507,6.631,76.5,4.148,8,307,17.4,388.45,9.54 +"238","Newton",40,3748,-71.1491,42.203,31.5,31.5,0.51183,0,6.2,"0",0.507,7.358,71.6,4.148,8,307,17.4,390.07,4.73 +"239","Natick",41,3821,-71.2055,42.1875,23.7,23.7,0.08244,30,4.93,"0",0.428,6.481,18.5,6.1899,6,300,16.6,379.41,6.36 +"240","Natick",41,3822,-71.2035,42.187,23.3,23.3,0.09252,30,4.93,"0",0.428,6.606,42.2,6.1899,6,300,16.6,383.78,7.37 +"241","Natick",41,3823,-71.1966,42.164,22,27,0.11329,30,4.93,"0",0.428,6.897,54.3,6.3361,6,300,16.6,391.25,11.38 +"242","Natick",41,3824,-71.2138,42.1645,20.1,20.1,0.10612,30,4.93,"0",0.428,6.095,65.1,6.3361,6,300,16.6,394.62,12.4 +"243","Natick",41,3825,-71.22,42.1782,22.2,22.2,0.1029,30,4.93,"0",0.428,6.358,52.9,7.0355,6,300,16.6,372.75,11.22 +"244","Natick",41,3826,-71.232,42.1725,23.7,23.7,0.12757,30,4.93,"0",0.428,6.393,7.8,7.0355,6,300,16.6,374.71,5.19 +"245","Framingham",42,3831,-71.2435,42.163,17.6,17.6,0.20608,22,5.86,"0",0.431,5.593,76.5,7.9549,7,330,19.1,372.49,12.5 +"246","Framingham",42,3832,-71.2575,42.1618,18.5,18.5,0.19133,22,5.86,"0",0.431,5.605,70.2,7.9549,7,330,19.1,389.13,18.46 +"247","Framingham",42,3833,-71.262,42.169,24.3,24.3,0.33983,22,5.86,"0",0.431,6.108,34.9,8.0555,7,330,19.1,390.18,9.16 +"248","Framingham",42,3834,-71.247,42.1703,20.5,20.5,0.19657,22,5.86,"0",0.431,6.226,79.2,8.0555,7,330,19.1,376.14,10.15 +"249","Framingham",42,3835,-71.255,42.1767,24.5,24.5,0.16439,22,5.86,"0",0.431,6.433,49.1,7.8265,7,330,19.1,374.71,9.52 +"250","Framingham",42,3836,-71.2475,42.1825,26.2,26.2,0.19073,22,5.86,"0",0.431,6.718,17.5,7.8265,7,330,19.1,393.74,6.56 +"251","Framingham",42,3837,-71.238,42.191,24.4,24.4,0.1403,22,5.86,"0",0.431,6.487,13,7.3967,7,330,19.1,396.28,5.9 +"252","Framingham",42,3838,-71.2435,42.1982,24.8,24.8,0.21409,22,5.86,"0",0.431,6.438,8.9,7.3967,7,330,19.1,377.07,3.59 +"253","Framingham",42,3839,-71.2685,42.1935,29.6,29.6,0.08221,22,5.86,"0",0.431,6.957,6.8,8.9067,7,330,19.1,386.09,3.53 +"254","Framingham",42,3840,-71.2807,42.1727,42.8,42.8,0.36894,22,5.86,"0",0.431,8.259,8.4,8.9067,7,330,19.1,396.9,3.54 +"255","Ashland",43,3851,-71.2895,42.1575,21.9,21.9,0.04819,80,3.64,"0",0.392,6.108,32,9.2203,1,315,16.4,392.89,6.57 +"256","Ashland",43,3852,-71.269,42.1482,20.9,20.9,0.03548,80,3.64,"0",0.392,5.876,19.1,9.2203,1,315,16.4,395.18,9.25 +"257","Sherborn",44,3861,-71.223,42.145,44,44,0.01538,90,3.75,"0",0.394,7.454,34.2,6.3361,3,244,15.9,386.34,3.11 +"258","Brookline",45,4001,-71.0679,42.2073,50,50,0.61154,20,3.97,"0",0.647,8.704,86.9,1.801,5,264,13,389.7,5.12 +"259","Brookline",45,4002,-71.0727,42.2077,36,36,0.66351,20,3.97,"0",0.647,7.333,100,1.8946,5,264,13,383.29,7.79 +"260","Brookline",45,4003,-71.0765,42.2075,30.1,30.1,0.65665,20,3.97,"0",0.647,6.842,100,2.0107,5,264,13,391.93,6.9 +"261","Brookline",45,4004,-71.08,42.204,33.8,33.8,0.54011,20,3.97,"0",0.647,7.203,81.8,2.1121,5,264,13,392.8,9.59 +"262","Brookline",45,4005,-71.079,42.202,43.1,43.1,0.53412,20,3.97,"0",0.647,7.52,89.4,2.1398,5,264,13,388.37,7.26 +"263","Brookline",45,4006,-71.0835,42.2,48.8,48.8,0.52014,20,3.97,"0",0.647,8.398,91.5,2.2885,5,264,13,386.86,5.91 +"264","Brookline",45,4007,-71.075,42.198,31,31,0.82526,20,3.97,"0",0.647,7.327,94.5,2.0788,5,264,13,393.42,11.25 +"265","Brookline",45,4008,-71.071,42.203,36.5,36.5,0.55007,20,3.97,"0",0.647,7.206,91.6,1.9301,5,264,13,387.89,8.1 +"266","Brookline",45,4009,-71.07,42.2,22.8,22.8,0.76162,20,3.97,"0",0.647,5.56,62.8,1.9865,5,264,13,392.4,10.45 +"267","Brookline",45,4010,-71.0725,42.1965,30.7,30.7,0.7857,20,3.97,"0",0.647,7.014,84.6,2.1329,5,264,13,384.07,14.79 +"268","Brookline",45,4011,-71.085,42.1925,50,50,0.57834,20,3.97,"0",0.575,8.297,67,2.4216,5,264,13,384.54,7.44 +"269","Brookline",45,4012,-71.0925,42.2075,43.5,43.5,0.5405,20,3.97,"0",0.575,7.47,52.6,2.872,5,264,13,390.3,3.16 +"270","Dedham",46,4021,-71.098,42.154,20.7,20.7,0.09065,20,6.96,"1",0.464,5.92,61.5,3.9175,3,223,18.6,391.34,13.65 +"271","Dedham",46,4022,-71.087,42.141,21.1,21.1,0.29916,20,6.96,"0",0.464,5.856,42.1,4.429,3,223,18.6,388.65,13 +"272","Dedham",46,4023,-71.094,42.1355,25.2,25.2,0.16211,20,6.96,"0",0.464,6.24,16.3,4.429,3,223,18.6,396.9,6.59 +"273","Dedham",46,4024,-71.0982,42.1445,24.4,24.4,0.1146,20,6.96,"0",0.464,6.538,58.7,3.9175,3,223,18.6,394.96,7.73 +"274","Dedham",46,4025,-71.117,42.151,35.2,35.2,0.22188,20,6.96,"1",0.464,7.691,51.8,4.3665,3,223,18.6,390.77,6.58 +"275","Needham",47,4031,-71.1305,42.1675,32.4,32.4,0.05644,40,6.41,"1",0.447,6.758,32.9,4.0776,4,254,17.6,396.9,3.53 +"276","Needham",47,4032,-71.138,42.1733,32,32,0.09604,40,6.41,"0",0.447,6.854,42.8,4.2673,4,254,17.6,396.9,2.98 +"277","Needham",47,4033,-71.1405,42.1632,33.2,33.2,0.10469,40,6.41,"1",0.447,7.267,49,4.7872,4,254,17.6,389.25,6.05 +"278","Needham",47,4034,-71.1495,42.173,33.1,33.1,0.06127,40,6.41,"1",0.447,6.826,27.6,4.8628,4,254,17.6,393.45,4.16 +"279","Needham",47,4035,-71.1395,42.1813,29.1,29.1,0.07978,40,6.41,"0",0.447,6.482,32.1,4.1403,4,254,17.6,396.9,7.19 +"280","Wellesley",48,4041,-71.148,42.188,35.1,35.1,0.21038,20,3.33,"0",0.4429,6.812,32.2,4.1007,5,216,14.9,396.9,4.85 +"281","Wellesley",48,4042,-71.166,42.187,45.4,45.4,0.03578,20,3.33,"0",0.4429,7.82,64.5,4.6947,5,216,14.9,387.31,3.76 +"282","Wellesley",48,4043,-71.185,42.1848,35.4,35.4,0.03705,20,3.33,"0",0.4429,6.968,37.2,5.2447,5,216,14.9,392.23,4.59 +"283","Wellesley",48,4044,-71.1775,42.1735,46,46,0.06129,20,3.33,"1",0.4429,7.645,49.7,5.2119,5,216,14.9,377.07,3.01 +"284","Dover",49,4051,-71.173,42.1475,50,50,0.01501,90,1.21,"1",0.401,7.923,24.8,5.885,1,198,13.6,395.52,3.16 +"285","Medfield",50,4061,-71.18,42.1105,32.2,32.2,0.00906,90,2.97,"0",0.4,7.088,20.8,7.3073,1,285,15.3,394.72,7.85 +"286","Millis",51,4071,-71.2135,42.1,22,22,0.01096,55,2.25,"0",0.389,6.453,31.9,7.3073,1,300,15.3,394.72,8.23 +"287","Norfolk",52,4091,-71.195,42.0675,20.1,20.1,0.01965,80,1.76,"0",0.385,6.23,31.5,9.0892,1,241,18.2,341.6,12.93 +"288","Walpole",53,4111,-71.148,42.0775,23.2,23.2,0.03871,52.5,5.32,"0",0.405,6.209,31.3,7.3172,6,293,16.6,396.9,7.14 +"289","Walpole",53,4112,-71.1325,42.094,22.3,22.3,0.0459,52.5,5.32,"0",0.405,6.315,45.6,7.3172,6,293,16.6,396.9,7.6 +"290","Walpole",53,4113,-71.155,42.098,24.8,24.8,0.04297,52.5,5.32,"0",0.405,6.565,22.9,7.3172,6,293,16.6,371.72,9.51 +"291","Westwood",54,4121,-71.1385,42.1235,28.5,28.5,0.03502,80,4.95,"0",0.411,6.861,27.9,5.1167,4,245,19.2,396.9,3.33 +"292","Westwood",54,4122,-71.133,42.1408,37.3,37.3,0.07886,80,4.95,"0",0.411,7.148,27.7,5.1167,4,245,19.2,396.9,3.56 +"293","Westwood",54,4123,-71.107,42.1307,27.9,27.9,0.03615,80,4.95,"0",0.411,6.63,23.4,5.1167,4,245,19.2,396.9,4.7 +"294","Norwood",55,4131,-71.109,42.11,23.9,23.9,0.08265,0,13.92,"0",0.437,6.127,18.4,5.5027,4,289,16,396.9,8.58 +"295","Norwood",55,4132,-71.118,42.1217,21.7,21.7,0.08199,0,13.92,"0",0.437,6.009,42.3,5.5027,4,289,16,396.9,10.4 +"296","Norwood",55,4133,-71.1309,42.1166,28.6,28.6,0.12932,0,13.92,"0",0.437,6.678,31.1,5.9604,4,289,16,396.9,6.27 +"297","Norwood",55,4134,-71.128,42.1108,27.1,27.1,0.05372,0,13.92,"0",0.437,6.549,51,5.9604,4,289,16,392.85,7.39 +"298","Norwood",55,4135,-71.121,42.1025,20.3,20.3,0.14103,0,13.92,"0",0.437,5.79,58,6.32,4,289,16,396.9,15.84 +"299","Sharon",56,4141,-71.12,42.0725,22.5,22.5,0.06466,70,2.24,"0",0.4,6.345,20.1,7.8278,5,358,14.8,368.24,4.97 +"300","Sharon",56,4142,-71.1,42.059,29,29,0.05561,70,2.24,"0",0.4,7.041,10,7.8278,5,358,14.8,371.58,4.74 +"301","Sharon",56,4143,-71.1035,42.0735,24.8,24.8,0.04417,70,2.24,"0",0.4,6.871,47.4,7.8278,5,358,14.8,390.86,6.07 +"302","Canton",57,4151,-71.0875,42.095,22,22,0.03537,34,6.09,"0",0.433,6.59,40.4,5.4917,7,329,16.1,395.75,9.5 +"303","Canton",57,4152,-71.0625,42.102,26.4,26.4,0.09266,34,6.09,"0",0.433,6.495,18.4,5.4917,7,329,16.1,383.61,8.67 +"304","Canton",57,4153,-71.0865,42.12,33.1,33.1,0.1,34,6.09,"0",0.433,6.982,17.7,5.4917,7,329,16.1,390.43,4.86 +"305","Milton",58,4161,-71.0465,42.145,36.1,36.1,0.05515,33,2.18,"0",0.472,7.236,41.1,4.022,7,222,18.4,393.68,6.93 +"306","Milton",58,4162,-71.057,42.1525,28.4,28.4,0.05479,33,2.18,"0",0.472,6.616,58.1,3.37,7,222,18.4,393.36,8.93 +"307","Milton",58,4163,-71.045,42.159,33.4,33.4,0.07503,33,2.18,"0",0.472,7.42,71.9,3.0992,7,222,18.4,396.9,6.47 +"308","Milton",58,4164,-71.028,42.1565,28.2,28.2,0.04932,33,2.18,"0",0.472,6.849,70.3,3.1827,7,222,18.4,396.9,7.53 +"309","Quincy",59,4171,-71.0138,42.1555,22.8,22.8,0.49298,0,9.9,"0",0.544,6.635,82.5,3.3175,4,304,18.4,396.9,4.54 +"310","Quincy",59,4172,-71.0201,42.16,20.3,20.3,0.3494,0,9.9,"0",0.544,5.972,76.7,3.1025,4,304,18.4,396.24,9.97 +"311","Quincy",59,4173,-71.016,42.176,16.1,16.1,2.63548,0,9.9,"0",0.544,4.973,37.8,2.5194,4,304,18.4,350.45,12.64 +"312","Quincy",59,4174,-71.0075,42.178,22.1,22.1,0.79041,0,9.9,"0",0.544,6.122,52.8,2.6403,4,304,18.4,396.9,5.98 +"313","Quincy",59,4175,-71.015,42.167,19.4,19.4,0.26169,0,9.9,"0",0.544,6.023,90.4,2.834,4,304,18.4,396.3,11.72 +"314","Quincy",59,4176,-71.0075,42.1613,21.6,21.6,0.26938,0,9.9,"0",0.544,6.266,82.8,3.2628,4,304,18.4,393.39,7.9 +"315","Quincy",59,4177,-71,42.153,23.8,23.8,0.3692,0,9.9,"0",0.544,6.567,87.3,3.6023,4,304,18.4,395.69,9.28 +"316","Quincy",59,4178,-70.9795,42.158,16.2,16.2,0.25356,0,9.9,"0",0.544,5.705,77.7,3.945,4,304,18.4,396.42,11.5 +"317","Quincy",59,4179,-70.988,42.1485,17.8,17.8,0.31827,0,9.9,"0",0.544,5.914,83.2,3.9986,4,304,18.4,390.7,18.33 +"318","Quincy",59,4180,-71.004,42.1425,19.8,19.8,0.24522,0,9.9,"0",0.544,5.782,71.7,4.0317,4,304,18.4,396.9,15.94 +"319","Quincy",59,4181,-71.01,42.15,23.1,23.1,0.40202,0,9.9,"0",0.544,6.382,67.2,3.5325,4,304,18.4,395.21,10.36 +"320","Quincy",59,4182,-71.02,42.151,21,21,0.47547,0,9.9,"0",0.544,6.113,58.8,4.0019,4,304,18.4,396.23,12.73 +"321","Braintree",60,4191,-71.0085,42.129,23.8,23.8,0.1676,0,7.38,"0",0.493,6.426,52.3,4.5404,5,287,19.6,396.9,7.2 +"322","Braintree",60,4192,-70.9975,42.134,23.1,23.1,0.18159,0,7.38,"0",0.493,6.376,54.3,4.5404,5,287,19.6,396.9,6.87 +"323","Braintree",60,4193,-70.99,42.1367,20.4,20.4,0.35114,0,7.38,"0",0.493,6.041,49.9,4.7211,5,287,19.6,396.9,7.7 +"324","Braintree",60,4194,-70.9834,42.1375,18.5,18.5,0.28392,0,7.38,"0",0.493,5.708,74.3,4.7211,5,287,19.6,391.13,11.74 +"325","Braintree",60,4195,-70.9895,42.1265,25,25,0.34109,0,7.38,"0",0.493,6.415,40.1,4.7211,5,287,19.6,396.9,6.12 +"326","Braintree",60,4196,-71,42.1066,24.6,24.6,0.19186,0,7.38,"0",0.493,6.431,14.7,5.4159,5,287,19.6,393.68,5.08 +"327","Braintree",60,4197,-70.9995,42.1175,23,23,0.30347,0,7.38,"0",0.493,6.312,28.9,5.4159,5,287,19.6,396.9,6.15 +"328","Braintree",60,4198,-71.01,42.1215,22.2,22.2,0.24103,0,7.38,"0",0.493,6.083,43.7,5.4159,5,287,19.6,396.9,12.79 +"329","Randolph",61,4201,-71.0275,42.113,19.3,19.3,0.06617,0,3.24,"0",0.46,5.868,25.8,5.2146,4,430,16.9,382.44,9.97 +"330","Randolph",61,4202,-71.0415,42.115,22.6,22.6,0.06724,0,3.24,"0",0.46,6.333,17.2,5.2146,4,430,16.9,375.21,7.34 +"331","Randolph",61,4203,-71.025,42.098,19.8,19.8,0.04544,0,3.24,"0",0.46,6.144,32.2,5.8736,4,430,16.9,368.57,9.09 +"332","Holbrook",62,4211,-71.0115,42.0865,17.1,17.1,0.05023,35,6.06,"0",0.4379,5.706,28.4,6.6407,1,304,16.9,394.02,12.43 +"333","Holbrook",62,4212,-70.996,42.0895,19.4,19.4,0.03466,35,6.06,"0",0.4379,6.031,23.3,6.6407,1,304,16.9,362.25,7.83 +"334","Weymouth",63,4221,-70.9795,42.0995,22.2,22.2,0.05083,0,5.19,"0",0.515,6.316,38.1,6.4584,5,224,20.2,389.71,5.68 +"335","Weymouth",63,4222,-70.965,42.101,20.7,20.7,0.03738,0,5.19,"0",0.515,6.31,38.5,6.4584,5,224,20.2,389.4,6.75 +"336","Weymouth",63,4223,-70.97,42.115,21.1,21.1,0.03961,0,5.19,"0",0.515,6.037,34.5,5.9853,5,224,20.2,396.9,8.01 +"337","Weymouth",63,4224,-70.976,42.128,19.5,19.5,0.03427,0,5.19,"0",0.515,5.869,46.3,5.2311,5,224,20.2,396.9,9.8 +"338","Weymouth",63,4225,-70.9602,42.127,18.5,18.5,0.03041,0,5.19,"0",0.515,5.895,59.6,5.615,5,224,20.2,394.81,10.56 +"339","Weymouth",63,4226,-70.9633,42.1374,20.6,20.6,0.03306,0,5.19,"0",0.515,6.059,37.3,4.8122,5,224,20.2,396.14,8.51 +"340","Weymouth",63,4227,-70.9675,42.144,19,19,0.05497,0,5.19,"0",0.515,5.985,45.4,4.8122,5,224,20.2,396.9,9.74 +"341","Weymouth",63,4228,-70.965,42.1503,18.7,18.7,0.06151,0,5.19,"0",0.515,5.968,58.5,4.8122,5,224,20.2,396.9,9.29 +"342","Cohasset",64,4231,-70.8875,42.1465,32.7,32.7,0.01301,35,1.52,"0",0.442,7.241,49.3,7.0379,1,284,15.5,394.74,5.49 +"343","Hull",65,5001,-70.915,42.16,16.5,16.5,0.02498,0,1.89,"0",0.518,6.54,59.7,6.2669,1,422,15.9,389.96,8.65 +"344","Hingham",66,5011,-70.937,42.1475,23.9,23.9,0.02543,55,3.78,"0",0.484,6.696,56.4,5.7321,5,370,17.6,396.9,7.18 +"345","Hingham",66,5012,-70.9325,42.123,31.2,31.2,0.03049,55,3.78,"0",0.484,6.874,28.1,6.4654,5,370,17.6,387.97,4.61 +"346","Rockland",67,5021,-70.947,42.0725,17.5,17.5,0.03113,0,4.39,"0",0.442,6.014,48.5,8.0136,3,352,18.8,385.64,10.53 +"347","Rockland",67,5022,-70.9501,42.0825,17.2,17.2,0.06162,0,4.39,"0",0.442,5.898,52.3,8.0136,3,352,18.8,364.61,12.67 +"348","Hanover",68,5031,-70.9275,42.0795,23.1,23.1,0.0187,85,4.15,"0",0.429,6.516,27.7,8.5353,4,351,17.9,392.43,6.36 +"349","Norwell",69,5041,-70.92,42.1016,24.5,24.5,0.01501,80,2.01,"0",0.435,6.635,29.7,8.344,4,280,17,390.94,5.99 +"350","Scituate",70,5051,-70.855,42.13,26.6,26.6,0.02899,40,1.25,"0",0.429,6.939,34.5,8.7921,1,335,19.7,389.85,5.89 +"351","Scituate",70,5052,-70.833,42.115,22.9,22.9,0.06211,40,1.25,"0",0.429,6.49,44.4,8.7921,1,335,19.7,396.9,5.98 +"352","Marshfield",71,5061,-70.83,42.0775,24.1,24.1,0.0795,60,1.69,"0",0.411,6.579,35.9,10.7103,4,411,18.3,370.78,5.49 +"353","Marshfield",71,5062,-70.81,42.059,18.6,18.6,0.07244,60,1.69,"0",0.411,5.884,18.5,10.7103,4,411,18.3,392.33,7.79 +"354","Duxbury",72,5071,-70.83,42.0485,30.1,30.1,0.01709,90,2.02,"0",0.41,6.728,36.1,12.1265,5,187,17,384.46,4.5 +"355","Pembroke",73,5081,-70.853,42.052,18.2,18.2,0.04301,80,1.91,"0",0.413,5.663,21.9,10.5857,4,334,22,382.8,8.05 +"356","Pembroke",73,5082,-70.8525,42.03,20.6,20.6,0.10659,80,1.91,"0",0.413,5.936,19.5,10.5857,4,334,22,376.04,5.57 +"357","Boston Allston-Brighton",74,1,-71.083,42.2172,17.8,17.8,8.98296,0,18.1,"1",0.77,6.212,97.4,2.1222,24,666,20.2,377.73,17.6 +"358","Boston Allston-Brighton",74,2,-71.095,42.212,21.7,21.7,3.8497,0,18.1,"1",0.77,6.395,91,2.5052,24,666,20.2,391.34,13.27 +"359","Boston Allston-Brighton",74,3,-71.1007,42.21,22.7,22.7,5.20177,0,18.1,"1",0.77,6.127,83.4,2.7227,24,666,20.2,395.43,11.48 +"360","Boston Allston-Brighton",74,4,-71.093,42.207,22.6,22.6,4.26131,0,18.1,"0",0.77,6.112,81.3,2.5091,24,666,20.2,390.74,12.67 +"361","Boston Allston-Brighton",74,5,-71.0905,42.2033,25,25,4.54192,0,18.1,"0",0.77,6.398,88,2.5182,24,666,20.2,374.56,7.79 +"362","Boston Allston-Brighton",74,6,-71.0865,42.21,19.9,19.9,3.83684,0,18.1,"0",0.77,6.251,91.1,2.2955,24,666,20.2,350.65,14.19 +"363","Boston Allston-Brighton",74,7,-71.081,42.208,20.8,20.8,3.67822,0,18.1,"0",0.77,5.362,96.2,2.1036,24,666,20.2,380.79,10.19 +"364","Boston Allston-Brighton",74,8,-71.0865,42.215,16.8,16.8,4.22239,0,18.1,"1",0.77,5.803,89,1.9047,24,666,20.2,353.04,14.64 +"365","Boston Back Bay",75,101,-71.059,42.2098,21.9,21.9,3.47428,0,18.1,"1",0.718,8.78,82.9,1.9047,24,666,20.2,354.55,5.29 +"366","Boston Back Bay",75,102,-71.0595,42.2075,27.5,27.5,4.55587,0,18.1,"0",0.718,3.561,87.9,1.6132,24,666,20.2,354.7,7.12 +"367","Boston Back Bay",75,104,-71.054,42.2052,21.9,21.9,3.69695,0,18.1,"0",0.718,4.963,91.4,1.7523,24,666,20.2,316.03,14 +"368","Boston Back Bay",75,105,-71.0508,42.207,23.1,23.1,13.5222,0,18.1,"0",0.631,3.863,100,1.5106,24,666,20.2,131.42,13.33 +"369","Boston Back Bay",75,107,-71.048,42.2105,50,50,4.89822,0,18.1,"0",0.631,4.97,100,1.3325,24,666,20.2,375.52,3.26 +"370","Boston Back Bay",75,108,-71.0497,42.2125,50,50,5.66998,0,18.1,"1",0.631,6.683,96.8,1.3567,24,666,20.2,375.33,3.73 +"371","Boston Beacon Hill",76,201,-71.0422,42.2144,50,50,6.53876,0,18.1,"1",0.631,7.016,97.5,1.2024,24,666,20.2,392.05,2.96 +"372","Boston Beacon Hill",76,202,-71.0417,42.216,50,50,9.2323,0,18.1,"0",0.631,6.216,100,1.1691,24,666,20.2,366.15,9.53 +"373","Boston Beacon Hill",76,203,-71.0397,42.2182,50,50,8.26725,0,18.1,"1",0.668,5.875,89.6,1.1296,24,666,20.2,347.88,8.88 +"374","Boston North End",77,301,-71.0339,42.2207,13.8,13.8,11.1081,0,18.1,"0",0.668,4.906,100,1.1742,24,666,20.2,396.9,34.77 +"375","Boston North End",77,302,-71.0346,42.2187,13.8,13.8,18.4982,0,18.1,"0",0.668,4.138,100,1.137,24,666,20.2,396.9,37.97 +"376","Boston Charlestown",78,401,-71.0367,42.224,15,15,19.6091,0,18.1,"0",0.671,7.313,97.9,1.3163,24,666,20.2,396.9,13.44 +"377","Boston Charlestown",78,402,-71.034,42.226,13.9,13.9,15.288,0,18.1,"0",0.671,6.649,93.3,1.3449,24,666,20.2,363.02,23.24 +"378","Boston Charlestown",78,403,-71.038,42.2265,13.3,13.3,9.82349,0,18.1,"0",0.671,6.794,98.8,1.358,24,666,20.2,396.9,21.24 +"379","Boston Charlestown",78,404,-71.04,42.2248,13.1,13.1,23.6482,0,18.1,"0",0.671,6.38,96.2,1.3861,24,666,20.2,396.9,23.69 +"380","Boston Charlestown",78,405,-71.04,42.2275,10.2,10.2,17.8667,0,18.1,"0",0.671,6.223,100,1.3861,24,666,20.2,393.74,21.78 +"381","Boston Charlestown",78,406,-71.046,42.23,10.4,10.4,88.9762,0,18.1,"0",0.671,6.968,91.9,1.4165,24,666,20.2,396.9,17.21 +"382","Boston East Boston",79,407,-71.041,42.229,10.9,10.9,15.8744,0,18.1,"0",0.671,6.545,99.1,1.5192,24,666,20.2,396.9,21.08 +"383","Boston East Boston",79,501,-71.023,42.2287,11.3,11.3,9.18702,0,18.1,"0",0.7,5.536,100,1.5804,24,666,20.2,396.9,23.6 +"384","Boston East Boston",79,502,-71.0215,42.227,12.3,12.3,7.99248,0,18.1,"0",0.7,5.52,100,1.5331,24,666,20.2,396.9,24.56 +"385","Boston East Boston",79,503,-71.0245,42.2235,8.8,8.8,20.0849,0,18.1,"0",0.7,4.368,91.2,1.4395,24,666,20.2,285.83,30.63 +"386","Boston East Boston",79,504,-71.0235,42.2213,7.2,7.2,16.8118,0,18.1,"0",0.7,5.277,98.1,1.4261,24,666,20.2,396.9,30.81 +"387","Boston East Boston",79,506,-71.0228,42.2231,10.5,10.5,24.3938,0,18.1,"0",0.7,4.652,100,1.4672,24,666,20.2,396.9,28.28 +"388","Boston East Boston",79,507,-71.0215,42.2248,7.4,7.4,22.5971,0,18.1,"0",0.7,5,89.5,1.5184,24,666,20.2,396.9,31.99 +"389","Boston East Boston",79,508,-71.0195,42.2255,10.2,10.2,14.3337,0,18.1,"0",0.7,4.88,100,1.5895,24,666,20.2,372.92,30.62 +"390","Boston East Boston",79,509,-71.0168,42.2281,11.5,11.5,8.15174,0,18.1,"0",0.7,5.39,98.9,1.7281,24,666,20.2,396.9,20.85 +"391","Boston East Boston",79,510,-71.0109,42.23,15.1,15.1,6.96215,0,18.1,"0",0.7,5.713,97,1.9265,24,666,20.2,394.43,17.11 +"392","Boston East Boston",79,511,-71.0035,42.233,23.2,23.2,5.29305,0,18.1,"0",0.7,6.051,82.5,2.1678,24,666,20.2,378.38,18.76 +"393","Boston East Boston",79,512,-71.02,42.2205,9.7,9.7,11.5779,0,18.1,"0",0.7,5.036,97,1.77,24,666,20.2,396.9,25.68 +"394","Boston South Boston",80,601,-71.0167,42.201,13.8,13.8,8.64476,0,18.1,"0",0.693,6.193,92.6,1.7912,24,666,20.2,396.9,15.17 +"395","Boston South Boston",80,602,-71.02,42.1993,12.7,12.7,13.3598,0,18.1,"0",0.693,5.887,94.7,1.7821,24,666,20.2,396.9,16.35 +"396","Boston South Boston",80,603,-71.022,42.1996,13.1,13.1,8.71675,0,18.1,"0",0.693,6.471,98.8,1.7257,24,666,20.2,391.98,17.12 +"397","Boston South Boston",80,604,-71.026,42.1993,12.5,12.5,5.87205,0,18.1,"0",0.693,6.405,96,1.6768,24,666,20.2,396.9,19.37 +"398","Boston South Boston",80,605,-71.025,42.2024,8.5,8.5,7.67202,0,18.1,"0",0.693,5.747,98.9,1.6334,24,666,20.2,393.1,19.92 +"399","Boston South Boston",80,606,-71.023,42.209,5,5,38.3518,0,18.1,"0",0.693,5.453,100,1.4896,24,666,20.2,396.9,30.59 +"400","Boston South Boston",80,607,-71.033,42.2032,6.3,6.3,9.91655,0,18.1,"0",0.693,5.852,77.8,1.5004,24,666,20.2,338.16,29.97 +"401","Boston South Boston",80,608,-71.0326,42.2011,5.6,5.6,25.0461,0,18.1,"0",0.693,5.987,100,1.5888,24,666,20.2,396.9,26.77 +"402","Boston South Boston",80,609,-71.03,42.2015,7.2,7.2,14.2362,0,18.1,"0",0.693,6.343,100,1.5741,24,666,20.2,396.9,20.32 +"403","Boston South Boston",80,610,-71.03,42.1988,12.1,12.1,9.59571,0,18.1,"0",0.693,6.404,100,1.639,24,666,20.2,376.11,20.31 +"404","Boston South Boston",80,612,-71.0332,42.198,8.3,8.3,24.8017,0,18.1,"0",0.693,5.349,96,1.7028,24,666,20.2,396.9,19.77 +"405","Boston South Boston",80,613,-71.0345,42.2001,8.5,8.5,41.5292,0,18.1,"0",0.693,5.531,85.4,1.6074,24,666,20.2,329.46,27.38 +"406","Boston South Boston",80,614,-71.032,42.2057,5,5,67.9208,0,18.1,"0",0.693,5.683,100,1.4254,24,666,20.2,384.97,22.98 +"407","Boston Downtown",81,702,-71.039,42.2198,11.9,11.9,20.7162,0,18.1,"0",0.659,4.138,100,1.1781,24,666,20.2,370.22,23.34 +"408","Boston Downtown",81,703,-71.0427,42.209,27.9,27.9,11.9511,0,18.1,"0",0.659,5.608,100,1.2852,24,666,20.2,332.09,12.13 +"409","Boston Downtown",81,705,-71.0437,42.205,17.2,17.2,7.40389,0,18.1,"0",0.597,5.617,97.9,1.4547,24,666,20.2,314.64,26.4 +"410","Boston Downtown",81,706,-71.0455,42.206,27.5,27.5,14.4383,0,18.1,"0",0.597,6.852,100,1.4655,24,666,20.2,179.36,19.78 +"411","Boston Downtown",81,707,-71.0462,42.2075,15,15,51.1358,0,18.1,"0",0.597,5.757,100,1.413,24,666,20.2,2.6,10.11 +"412","Boston Downtown",81,708,-71.0487,42.2048,17.2,17.2,14.0507,0,18.1,"0",0.597,6.657,100,1.5275,24,666,20.2,35.05,21.22 +"413","Boston Downtown",81,709,-71.047,42.203,17.9,17.9,18.811,0,18.1,"0",0.597,4.628,100,1.5539,24,666,20.2,28.79,34.37 +"414","Boston Downtown",81,710,-71.0451,42.2015,16.3,16.3,28.6558,0,18.1,"0",0.597,5.155,100,1.5894,24,666,20.2,210.97,20.08 +"415","Boston Roxbury",82,801,-71.042,42.1985,7,7,45.7461,0,18.1,"0",0.693,4.519,100,1.6582,24,666,20.2,88.27,36.98 +"416","Boston Roxbury",82,802,-71.0455,42.1953,7.2,7.2,18.0846,0,18.1,"0",0.679,6.434,100,1.8347,24,666,20.2,27.25,29.05 +"417","Boston Roxbury",82,803,-71.0477,42.1965,7.5,7.5,10.8342,0,18.1,"0",0.679,6.782,90.8,1.8195,24,666,20.2,21.57,25.79 +"418","Boston Roxbury",82,805,-71.0498,42.2007,10.4,10.4,25.9406,0,18.1,"0",0.679,5.304,89.1,1.6475,24,666,20.2,127.36,26.64 +"419","Boston Roxbury",82,807,-71.0525,42.1989,8.8,8.8,73.5341,0,18.1,"0",0.679,5.957,100,1.8026,24,666,20.2,16.45,20.62 +"420","Boston Roxbury",82,808,-71.0586,42.1999,8.4,8.4,11.8123,0,18.1,"0",0.718,6.824,76.5,1.794,24,666,20.2,48.45,22.74 +"421","Boston Roxbury",82,809,-71.0618,42.199,16.7,16.7,11.0874,0,18.1,"0",0.718,6.411,100,1.8589,24,666,20.2,318.75,15.02 +"422","Boston Roxbury",82,810,-71.065,42.2018,14.2,14.2,7.02259,0,18.1,"0",0.718,6.006,95.3,1.8746,24,666,20.2,319.98,15.7 +"423","Boston Roxbury",82,811,-71.0665,42.197,20.8,20.8,12.0482,0,18.1,"0",0.614,5.648,87.6,1.9512,24,666,20.2,291.55,14.1 +"424","Boston Roxbury",82,812,-71.0619,42.1948,13.4,13.4,7.05042,0,18.1,"0",0.614,6.103,85.1,2.0218,24,666,20.2,2.52,23.29 +"425","Boston Roxbury",82,813,-71.059,42.192,11.7,11.7,8.79212,0,18.1,"0",0.584,5.565,70.6,2.0635,24,666,20.2,3.65,17.16 +"426","Boston Roxbury",82,814,-71.0577,42.1967,8.3,8.3,15.8603,0,18.1,"0",0.679,5.896,95.4,1.9096,24,666,20.2,7.68,24.39 +"427","Boston Roxbury",82,815,-71.0558,42.1937,10.2,10.2,12.2472,0,18.1,"0",0.584,5.837,59.7,1.9976,24,666,20.2,24.65,15.69 +"428","Boston Roxbury",82,816,-71.0542,42.1961,10.9,10.9,37.6619,0,18.1,"0",0.679,6.202,78.7,1.8629,24,666,20.2,18.82,14.52 +"429","Boston Roxbury",82,817,-71.0521,42.194,11,11,7.36711,0,18.1,"0",0.679,6.193,78.1,1.9356,24,666,20.2,96.73,21.52 +"430","Boston Roxbury",82,818,-71.0485,42.192,9.5,9.5,9.33889,0,18.1,"0",0.679,6.38,95.6,1.9682,24,666,20.2,60.72,24.08 +"431","Boston Roxbury",82,819,-71.0547,42.189,14.5,14.5,8.49213,0,18.1,"0",0.584,6.348,86.1,2.0527,24,666,20.2,83.45,17.64 +"432","Boston Roxbury",82,820,-71.0505,42.188,14.1,14.1,10.0623,0,18.1,"0",0.584,6.833,94.3,2.0882,24,666,20.2,81.33,19.69 +"433","Boston Roxbury",82,821,-71.052,42.1854,16.1,16.1,6.44405,0,18.1,"0",0.584,6.425,74.8,2.2004,24,666,20.2,97.95,12.03 +"434","Boston Savin Hill",83,901,-71.0495,42.1815,14.3,14.3,5.58107,0,18.1,"0",0.713,6.436,87.9,2.3158,24,666,20.2,100.19,16.22 +"435","Boston Savin Hill",83,902,-71.0475,42.1842,11.7,11.7,13.9134,0,18.1,"0",0.713,6.208,95,2.2222,24,666,20.2,100.63,15.17 +"436","Boston Savin Hill",83,903,-71.046,42.1867,13.4,13.4,11.1604,0,18.1,"0",0.74,6.629,94.6,2.1247,24,666,20.2,109.85,23.27 +"437","Boston Savin Hill",83,904,-71.0455,42.1893,9.6,9.6,14.4208,0,18.1,"0",0.74,6.461,93.3,2.0026,24,666,20.2,27.49,18.05 +"438","Boston Savin Hill",83,905,-71.0445,42.1917,8.7,8.2,15.1772,0,18.1,"0",0.74,6.152,100,1.9142,24,666,20.2,9.32,26.45 +"439","Boston Savin Hill",83,906,-71.0445,42.1938,8.4,8.4,13.6781,0,18.1,"0",0.74,5.935,87.9,1.8206,24,666,20.2,68.95,34.02 +"440","Boston Savin Hill",83,907,-71.037,42.194,12.8,12.8,9.39063,0,18.1,"0",0.74,5.627,93.9,1.8172,24,666,20.2,396.9,22.88 +"441","Boston Savin Hill",83,908,-71.0321,42.1925,10.5,10.5,22.0511,0,18.1,"0",0.74,5.818,92.4,1.8662,24,666,20.2,391.45,22.11 +"442","Boston Savin Hill",83,910,-71.0345,42.185,17.1,17.1,9.72418,0,18.1,"0",0.74,6.406,97.2,2.0651,24,666,20.2,385.96,19.52 +"443","Boston Savin Hill",83,911,-71.034,42.189,18.4,14.8,5.66637,0,18.1,"0",0.74,6.219,100,2.0048,24,666,20.2,395.69,16.59 +"444","Boston Savin Hill",83,912,-71.0378,42.1892,15.4,15.4,9.96654,0,18.1,"0",0.74,6.485,100,1.9784,24,666,20.2,386.73,18.85 +"445","Boston Savin Hill",83,913,-71.0405,42.192,10.8,10.8,12.8023,0,18.1,"0",0.74,5.854,96.6,1.8956,24,666,20.2,240.52,23.79 +"446","Boston Savin Hill",83,914,-71.0425,42.189,11.8,11.8,10.6718,0,18.1,"0",0.74,6.459,94.8,1.9879,24,666,20.2,43.06,23.98 +"447","Boston Savin Hill",83,915,-71.039,42.1868,14.9,14.9,6.28807,0,18.1,"0",0.74,6.341,96.4,2.072,24,666,20.2,318.01,17.79 +"448","Boston Savin Hill",83,916,-71.037,42.184,12.6,12.6,9.92485,0,18.1,"0",0.74,6.251,96.6,2.198,24,666,20.2,388.52,16.44 +"449","Boston Savin Hill",83,917,-71.04,42.182,14.1,14.1,9.32909,0,18.1,"0",0.713,6.185,98.7,2.2616,24,666,20.2,396.9,18.13 +"450","Boston Savin Hill",83,918,-71.0428,42.1845,13,13,7.52601,0,18.1,"0",0.713,6.417,98.3,2.185,24,666,20.2,304.21,19.31 +"451","Boston Savin Hill",83,919,-71.046,42.181,13.4,13.4,6.71772,0,18.1,"0",0.713,6.749,92.6,2.3236,24,666,20.2,0.32,17.44 +"452","Boston Savin Hill",83,920,-71.041,42.1795,15.2,15.2,5.44114,0,18.1,"0",0.713,6.655,98.2,2.3552,24,666,20.2,355.29,17.73 +"453","Boston Savin Hill",83,921,-71.034,42.179,16.1,16.1,5.09017,0,18.1,"0",0.713,6.297,91.8,2.3682,24,666,20.2,385.09,17.27 +"454","Boston Savin Hill",83,922,-71.04,42.177,17.8,17.8,8.24809,0,18.1,"0",0.713,7.393,99.3,2.4527,24,666,20.2,375.87,16.74 +"455","Boston Savin Hill",83,923,-71.0455,42.1768,14.9,14.4,9.51363,0,18.1,"0",0.713,6.728,94.1,2.4961,24,666,20.2,6.68,18.71 +"456","Boston Savin Hill",83,924,-71.051,42.178,14.1,14.1,4.75237,0,18.1,"0",0.713,6.525,86.5,2.4358,24,666,20.2,50.92,18.13 +"457","Boston Dorchester",84,1001,-71.0517,42.1735,12.7,12.7,4.66883,0,18.1,"0",0.713,5.976,87.9,2.5806,24,666,20.2,10.48,19.01 +"458","Boston Dorchester",84,1002,-71.0515,42.17,13.5,13.5,8.20058,0,18.1,"0",0.713,5.936,80.3,2.7792,24,666,20.2,3.5,16.94 +"459","Boston Dorchester",84,1003,-71.0475,42.169,14.9,14.9,7.75223,0,18.1,"0",0.713,6.301,83.7,2.7831,24,666,20.2,272.21,16.23 +"460","Boston Dorchester",84,1004,-71.043,42.169,20,20,6.80117,0,18.1,"0",0.713,6.081,84.4,2.7175,24,666,20.2,396.9,14.7 +"461","Boston Dorchester",84,1005,-71.043,42.1728,16.4,16.4,4.81213,0,18.1,"0",0.713,6.701,90,2.5975,24,666,20.2,255.23,16.42 +"462","Boston Dorchester",84,1006,-71.035,42.1745,17.7,17.7,3.69311,0,18.1,"0",0.713,6.376,88.4,2.5671,24,666,20.2,391.43,14.65 +"463","Boston Dorchester",84,1007,-71.031,42.1695,19.5,19.5,6.65492,0,18.1,"0",0.713,6.317,83,2.7344,24,666,20.2,396.9,13.99 +"464","Boston Dorchester",84,1008,-71.0358,42.1675,20.2,20.2,5.82115,0,18.1,"0",0.713,6.513,89.9,2.8016,24,666,20.2,393.82,10.29 +"465","Boston Dorchester",84,1009,-71.045,42.164,21.4,21.4,7.83932,0,18.1,"0",0.655,6.209,65.4,2.9634,24,666,20.2,396.9,13.22 +"466","Boston Dorchester",84,1010,-71.055,42.165,19.9,19.9,3.1636,0,18.1,"0",0.655,5.759,48.2,3.0665,24,666,20.2,334.4,14.13 +"467","Boston Dorchester",84,1011,-71.055,42.1685,19,19,3.77498,0,18.1,"0",0.655,5.952,84.7,2.8715,24,666,20.2,22.01,17.15 +"468","Boston Mattapan",85,1101,-71.066,42.178,19.1,19.1,4.42228,0,18.1,"0",0.584,6.003,94.5,2.5403,24,666,20.2,331.29,21.32 +"469","Boston Mattapan",85,1102,-71.07,42.168,19.1,19.1,15.5757,0,18.1,"0",0.58,5.926,71,2.9084,24,666,20.2,368.74,18.13 +"470","Boston Mattapan",85,1103,-71.069,42.1725,20.1,20.1,13.0751,0,18.1,"0",0.58,5.713,56.7,2.8237,24,666,20.2,396.9,14.76 +"471","Boston Mattapan",85,1104,-71.074,42.168,19.9,19.9,4.34879,0,18.1,"0",0.58,6.167,84,3.0334,24,666,20.2,396.9,16.29 +"472","Boston Mattapan",85,1105,-71.0825,42.1698,19.6,19.6,4.03841,0,18.1,"0",0.532,6.229,90.7,3.0993,24,666,20.2,395.33,12.87 +"473","Boston Mattapan",85,1106,-71.0833,42.175,23.2,23.2,3.56868,0,18.1,"0",0.58,6.437,75,2.8965,24,666,20.2,393.37,14.36 +"474","Boston Forest Hills",86,1201,-71.0732,42.184,29.8,29.8,4.64689,0,18.1,"0",0.614,6.98,67.6,2.5329,24,666,20.2,374.68,11.66 +"475","Boston Forest Hills",86,1202,-71.055,42.183,13.8,13.8,8.05579,0,18.1,"0",0.584,5.427,95.4,2.4298,24,666,20.2,352.58,18.14 +"476","Boston Forest Hills",86,1203,-71.0511,42.1879,13.3,13.3,6.39312,0,18.1,"0",0.584,6.162,97.4,2.206,24,666,20.2,302.76,24.1 +"477","Boston Forest Hills",86,1204,-71.0565,42.188,16.7,16.7,4.87141,0,18.1,"0",0.614,6.484,93.6,2.3053,24,666,20.2,396.21,18.68 +"478","Boston Forest Hills",86,1205,-71.0528,42.192,12,12,15.0234,0,18.1,"0",0.614,5.304,97.3,2.1007,24,666,20.2,349.48,24.91 +"479","Boston Forest Hills",86,1206,-71.0558,42.1913,14.6,14.6,10.233,0,18.1,"0",0.614,6.185,96.7,2.1705,24,666,20.2,379.7,18.03 +"480","Boston Forest Hills",86,1207,-71.067,42.1945,21.4,21.4,14.3337,0,18.1,"0",0.614,6.229,88,1.9512,24,666,20.2,383.32,13.11 +"481","Boston West Roxbury",87,1301,-71.1008,42.174,23,23,5.82401,0,18.1,"0",0.532,6.242,64.7,3.4242,24,666,20.2,396.9,10.74 +"482","Boston West Roxbury",87,1302,-71.095,42.173,23.7,23.7,5.70818,0,18.1,"0",0.532,6.75,74.9,3.3317,24,666,20.2,393.07,7.74 +"483","Boston West Roxbury",87,1303,-71.09,42.1665,25,25,5.73116,0,18.1,"0",0.532,7.061,77,3.4106,24,666,20.2,395.28,7.01 +"484","Boston West Roxbury",87,1304,-71.0975,42.1608,21.8,21.8,2.81838,0,18.1,"0",0.532,5.762,40.3,4.0983,24,666,20.2,392.92,10.42 +"485","Boston Hyde Park",88,1401,-71.0804,42.154,20.6,20.6,2.37857,0,18.1,"0",0.583,5.871,41.9,3.724,24,666,20.2,370.73,13.34 +"486","Boston Hyde Park",88,1402,-71.075,42.1455,21.2,21.2,3.67367,0,18.1,"0",0.583,6.312,51.9,3.9917,24,666,20.2,388.62,10.58 +"487","Boston Hyde Park",88,1403,-71.0715,42.155,19.1,19.1,5.69175,0,18.1,"0",0.583,6.114,79.8,3.5459,24,666,20.2,392.68,14.98 +"488","Boston Hyde Park",88,1404,-71.065,42.161,20.6,20.6,4.83567,0,18.1,"0",0.583,5.905,53.2,3.1523,24,666,20.2,388.22,11.45 +"489","Chelsea",89,1601,-71.0189,42.2344,15.2,15.2,0.15086,0,27.74,"0",0.609,5.454,92.7,1.8209,4,711,20.1,395.09,18.06 +"490","Chelsea",89,1602,-71.0228,42.2335,7,7,0.18337,0,27.74,"0",0.609,5.414,98.3,1.7554,4,711,20.1,344.05,23.97 +"491","Chelsea",89,1604,-71.0245,42.2368,8.1,8.1,0.20746,0,27.74,"0",0.609,5.093,98,1.8226,4,711,20.1,318.43,29.68 +"492","Chelsea",89,1605,-71.016,42.2382,13.6,13.6,0.10574,0,27.74,"0",0.609,5.983,98.8,1.8681,4,711,20.1,390.11,18.07 +"493","Chelsea",89,1606,-71.0297,42.2447,20.1,20.1,0.11132,0,27.74,"0",0.609,5.983,83.5,2.1099,4,711,20.1,396.9,13.35 +"494","Revere",90,1701,-71.0125,42.2462,21.8,21.8,0.17331,0,9.69,"0",0.585,5.707,54,2.3817,6,391,19.2,396.9,12.01 +"495","Revere",90,1702,-71.0125,42.25,24.5,24.5,0.27957,0,9.69,"0",0.585,5.926,42.6,2.3817,6,391,19.2,396.9,13.59 +"496","Revere",90,1703,-71.0105,42.2547,23.1,23.1,0.17899,0,9.69,"0",0.585,5.67,28.8,2.7986,6,391,19.2,393.29,17.6 +"497","Revere",90,1704,-71.001,42.2525,19.7,19.7,0.2896,0,9.69,"0",0.585,5.39,72.9,2.7986,6,391,19.2,396.9,21.14 +"498","Revere",90,1705,-70.9947,42.2496,18.3,18.3,0.26838,0,9.69,"0",0.585,5.794,70.6,2.8927,6,391,19.2,396.9,14.1 +"499","Revere",90,1706,-71.005,42.2455,21.2,21.2,0.23912,0,9.69,"0",0.585,6.019,65.3,2.4091,6,391,19.2,396.9,12.92 +"500","Revere",90,1707,-70.9985,42.243,17.5,17.5,0.17783,0,9.69,"0",0.585,5.569,73.5,2.3999,6,391,19.2,395.77,15.1 +"501","Revere",90,1708,-70.992,42.238,16.8,16.8,0.22438,0,9.69,"0",0.585,6.027,79.7,2.4982,6,391,19.2,396.9,14.33 +"502","Winthrop",91,1801,-70.986,42.2312,22.4,22.4,0.06263,0,11.93,"0",0.573,6.593,69.1,2.4786,1,273,21,391.99,9.67 +"503","Winthrop",91,1802,-70.991,42.2275,20.6,20.6,0.04527,0,11.93,"0",0.573,6.12,76.7,2.2875,1,273,21,396.9,9.08 +"504","Winthrop",91,1803,-70.9948,42.226,23.9,23.9,0.06076,0,11.93,"0",0.573,6.976,91,2.1675,1,273,21,396.9,5.64 +"505","Winthrop",91,1804,-70.9875,42.224,22,22,0.10959,0,11.93,"0",0.573,6.794,89.3,2.3889,1,273,21,393.45,6.48 +"506","Winthrop",91,1805,-70.9825,42.221,11.9,19,0.04741,0,11.93,"0",0.573,6.03,80.8,2.505,1,273,21,396.9,7.88 diff --git a/spatial/data/data.html b/spatial/data/data.html new file mode 100644 index 0000000..f0164dc --- /dev/null +++ b/spatial/data/data.html @@ -0,0 +1,47 @@ + + + + + + + +Şebnem's Homepage "Welcome" + + + + + + +

        +Here are some of the datasets that you will need to run the codes given to you: +

      • +Boston House Price Data in .csv file format +
      • +EU shape files +
      • +EU2 update file +

        + + + \ No newline at end of file diff --git a/spatial/index.html b/spatial/index.html new file mode 100644 index 0000000..acba389 --- /dev/null +++ b/spatial/index.html @@ -0,0 +1,42 @@ + + + + + + + +Spatial Econometrics Material + + + + + + +

        +

      • +Data Sets +

        + + + \ No newline at end of file diff --git a/turkish/cv.html b/turkish/cv.html new file mode 100644 index 0000000..fb9b493 --- /dev/null +++ b/turkish/cv.html @@ -0,0 +1,720 @@ + + + + +Sebnem's CV + + + + + +

        Şebnem Er

        +

        Adres: +İstanbul Universitesi Avcılar Kampüsü +
        İşletme Fakültesi +
        Sayısal Yöntemler Anabilim Dalı +
        AVCILAR / ISTANBUL / TURKIYE

        + +

         

        + +
          +
        1. +Eğitim +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +

        Üniversite

        +
        +

        Fakülte

        +
        +

        Alan

        +
        +

        Bölüm

        +
        +

        Mezuniyet Yılı

        +
        +

        Dublin City University

        +
        +

        School of Computing

        +
        +

        Statistics

        +
        +

        PostDoc

        +
        +

        2010-2011

        +
        +

        İstanbul Üniversitesi

        +
        +

        İşletme Fakültesi

        +
        +

        Sayısal Yöntemler

        +
        +

        Doktora

        +
        +

        2009

        +
        +

        İstanbul Üniversitesi

        +
        +

        İktisat Fakültesi

        +
        +

        İktisat Teorisi

        +
        +

        YüksekLisans

        +
        +

        2004

        +
        +

        İstanbul Teknik Üniversitesi

        +
        +

        İşletme Fakültesi

        +
        +

        İşletme Mühendisliği

        +
        +

        Lisans

        +
        +

        2001

        +
        + +

         

        + +
          +
        1. +İş Deneyimi +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +

        Firma

        +
        +

        Şehir

        +
        +

        Bölüm

        +
        +

        Ünvan

        +
        +

        Dönem

        +

         

        +

        İstanbul Üniversitesi

        +
        +

        İstanbul

        +
        +

        İşletme Fakültesi Sayısal Yöntemler Anabilim Dalı

        +
        +

        Araştırma Görevlisi

        +
        +

        10.2002 -

        +

         

        +

        Dublin City University

        +
        +

        School of Computing

        +
        +

        Statistics

        +

        (Prof.Jane Horgan)

        +
        +

        Araştırma

        +
        +

        02.2008 (3 ay)

        +
        +

        Anadolu Hayat Sigorta A.Ş.

        +
        +

        Istanbul

        +
        +

        AR & GE

        +
        +

        Uzman Yardımcısı

        +
        +

        02.2002 (8 ay)

        +

         

        +

        İntema A.Ş.

        +
        +

        Istanbul

        +
        +

        Pazarlama

        +
        +

        Staj

        +
        +

        2000 (2 ay)

        +

         

        +

        TEE

        +
        +

        Istanbul

        +
        +

        Üretim Planlama

        +
        +

        Staj

        +
        +

        1999 (2 ay)

        +

         

        + +

         

        + +
          +
        1. Language
        2. +
        + + + + + + + + + + + + +
        +

        Dil

        +
        +

        Düzey

        +
        +

        Sertifika

        +
        +

        İngilizce

        +
        +

        Çok iyi

        +
        +

        TOEFL Internet Tabanlı (99)

        +
        + +

         

        + +

         

        + + + + + + \ No newline at end of file diff --git a/turkish/dersler/20100929Lab1.txt b/turkish/dersler/20100929Lab1.txt new file mode 100644 index 0000000..3400285 --- /dev/null +++ b/turkish/dersler/20100929Lab1.txt @@ -0,0 +1,270 @@ +# Title: Probability and Statistics +# Module Code: CA266 +# Jane M Horgan + + +# R IS CASE SENSITIVE: Help or HELP or even help are all different. + +# R is also a calculator + +6+7*3/2 + +x = 1:4 +x + +x2 = x**2 +x2 + +x = 10 +prod1 = x*x +prod1 + +# Objects: The entities that R creates and manipulates, # e.g. variables,arrays,strings, functions. +# Workspace: All objects created in R are stored in workspace + +setwd("C:\\Documents and Settings\\SamsungXP\\Belgelerim") + +# or equivalently + +setwd("C:/Documents and Settings/SamsungXP/Belgelerim") + +# in order to see which directory is assigned: + +getwd() + + +# Getting Help +# click the Help button on the toolbar. + +help() +help.start() + +help(mean) + +# is the same with + +?mean + +demo() +?read.table +help.search ("data.entry") +apropos (boxplot} + +"boxplot", "boxplot.default", "boxplot.stat + +# Data Entry and Summary +# Entering data from the screen to a vector + +downtime =c(0, 1, 2, 12, 12, 14, 18, 21, 21, 23, +24,25,28,29,30,30,30,33,36,44,45,47,51) + +# you may need to write an array + +sebnem=array(c(1,2,3,4,5,6),dim=c(3,2)) + +mean(downtime) +median(downtime) +range(downtime) +sd(downtime) + +# Data Entry +# Entering data from a file to a data frame + + +results =read.table ("G:/data/results.txt" , header = T) + +# if you don't want to write the directory each time +# you can specify a folder in a specific directory +# and assign this directory as your work place + +setwd("C:/Documents and Settings/SamsungXP/Belgelerim") + + +# in order to see which directory is assigned: + +getwd() + +results=read.table(results.txt, header=T) + +# You would get an error because the file name must be always written in quotes: + +results=read.table("results.txt", header=T) +results + +results$arch1[5] + +# Alternatively + +attach(results) +names(results) + +#allows you to access without prefix results. + +arch1[5] + +# Missing Values + +mean(arch1) + +# No result because some marks are missing. + +# na.rm = T (not available, remove) + +or + +# na.rm = TRUE + +mean(arch1, na.rm = T) +mean(prog1, na.rm = T) +mean(arch2, na.rm = T) +mean(prog2, na.rm = T) + +mean(results, na.rm = T) + +# Obviously there is no point in getting the mean of "gender", therefore you can specify the columns of the variables that you can actually get the mean for. + +mean(results[,2:5], na.rm = T) + +median(arch1, na.rm=T) +median(prog1, na.rm=T) +median(arch2, na.rm=T) +median(prog2, na.rm=T) + + +rangeComp = max(arch1, na.rm=T)-min(arch1, na.rm=T) +rangeEcon= max(prog1, na.rm=T)-min(prog1, na.rm=T) +rangeAnal =max(arch2, na.rm=T)-min(arch2, na.rm=T) +rangeLinA=max(prog2, na.rm=T)-min(prog2, na.rm=T) + +rangeComp +rangeEcon +rangeAnal +rangeLinA + +# or equivalently + + +range(arch1,na.rm=T) +range(prog1,na.rm=T) +range(arch2,na.rm=T) +range(prog2,na.rm=T) + +sd(results, na.rm=T) + +quantile(arch1, na.rm=T) +quantile(prog1, na.rm=T) +quantile(arch2, na.rm=T) +quantile(prog2, na.rm=T) + +# Deciles + +deciles <-seq(0,1,0.1) +deciles +quantile(arch1, deciles,na.rm=T) + +# Percentiles + +percentiles <-seq(0,1,0.01) +percentiles +quantile(arch1, percentiles,na.rm=T) + +summary(results,na.rm=T) + +summary(arch1,na.rm=T) +summary(prog1,na.rm=T) +summary(arch2,na.rm=T) +summary(prog2,na.rm=T) + +summary(downtime) + +# Graphical Displays: Boxplots + +boxplot(downtime) + +boxplot(downtime,xlab = "downtime",ylab = "minutes") + +# Graphical Displays: Multiple Boxplots + +boxplot(arch1, arch2,xlab="Architecture Semesters 1, and 2") + +# Graphical Displays: Multiple Boxplots + +boxplot(arch1~gender, xlab = "gender", ylab = "Marks (%)",main = "Architecture Semester 1") + +# par function + +par (mfrow = c(2,2)) + +boxplot (arch1~gender, main = "Architecture Semester 1") +boxplot(arch2~gender, main = "Architecture Semester 2") +boxplot(prog1~gender, main = "Probability Semester 1") +boxplot(prog2~gender, main = "Probability Semester 2") + +par (mfrow = c(1,1)) restores full screen. + +# Histograms + +hist(arch1, breaks = 5,xlab ="Marks(%)",ylab = "Number of students", +main = "Architecture Semester 1") + +hist(prog1, "breaks = 5",xlab ="marks(%)",ylab = "Number of Students", +main = "Architecture Semester 1") + +bins <-c(0,40,60,80,100) +hist(arch1, breaks=bins) + +par (mfrow = c(2,2)) + +hist(arch1, xlab = "Architecture",main = " Semester 1", ylim = c(0, 35)) +hist(arch2, xlab = "Architecture",main = " Semester 2", ylim = c(0, 35)) +hist(prog1, xlab = "Programming",main = " ", ylim = c(0, 35)) +hist(prog2, xlab = "Programming",main = " ", ylim = c(0, 35)) + +# Stem and Leaf + +stem(downtime, scale = 2) + +stem(prog1) + +# Scatter Plots + +plot(prog1, prog2,xlab = "Programming, Semester 1", +ylab = "Programming, Semester 2") + +# Pairs + +pairs(results[2:5]) + +# First read the data into separate vectors: +x1=c(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5) +y1=c(8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68) +x2=c(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5) +y2=c(9.14, 8.14, 8.74, 8.77, 9.26, 8.10, 6.13, 3.10, 9.13, 7.26, 4.74) +x3=c(10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5) +y3=c(7.46, 6.77, 12.74, 7.11, 7.81, 8.84, 6.08, 5.39, 8.15, 6.42,5.73) +x4=c(8, 8, 8, 8, 8, 8, 8, 19, 8, 8, 8) +y4=c(6.58, 5.76, 7.71, 8.84, 8.47, 7.04, 5.25, 12.50, 5.56, 7.91,6.89) + +# Calculate the means +mean (data.frame(x1, x2, x3, x4)) + +mean (data.frame(y1, y2, y3, y4)) + +# the standard deviations: + +sd(data.frame(x1, x2, x3, x4)) + +sd(data.frame(y1, y2, y3, y4)) + +# Everything seems the same! But when we plot + +par(mfrow = c(2, 2)) +plot(x1,y1, xlim=c(0, 20), ylim =c(0, 13)) +plot(x2,y2, xlim=c(0, 20), ylim =c(0, 13)) +plot(x3,y3, xlim=c(0, 20), ylim =c(0, 13)) +plot(x4,y4, xlim=c(0, 20), ylim =c(0, 13)) + +# Everything seems different! + + +# ctrl+L clears the screen.... \ No newline at end of file diff --git "a/turkish/dersler/Aral\304\261k Tahmini.pptx" "b/turkish/dersler/Aral\304\261k Tahmini.pptx" new file mode 100644 index 0000000..82445b5 Binary files /dev/null and "b/turkish/dersler/Aral\304\261k Tahmini.pptx" differ diff --git a/turkish/dersler/BBS11_ppt_ch01.ppt b/turkish/dersler/BBS11_ppt_ch01.ppt new file mode 100644 index 0000000..daab603 Binary files /dev/null and b/turkish/dersler/BBS11_ppt_ch01.ppt differ diff --git "a/turkish/dersler/B\303\266l\303\274m 3.ppt" "b/turkish/dersler/B\303\266l\303\274m 3.ppt" new file mode 100644 index 0000000..19dbbd7 Binary files /dev/null and "b/turkish/dersler/B\303\266l\303\274m 3.ppt" differ diff --git a/turkish/dersler/GradSurvey.doc b/turkish/dersler/GradSurvey.doc new file mode 100644 index 0000000..9bc1416 Binary files /dev/null and b/turkish/dersler/GradSurvey.doc differ diff --git "a/turkish/dersler/Hafta 2- B\303\266l\303\274m 2.ppt" "b/turkish/dersler/Hafta 2- B\303\266l\303\274m 2.ppt" new file mode 100644 index 0000000..46739c6 Binary files /dev/null and "b/turkish/dersler/Hafta 2- B\303\266l\303\274m 2.ppt" differ diff --git "a/turkish/dersler/Hafta 3-B\303\266l\303\274m 3.ppt" "b/turkish/dersler/Hafta 3-B\303\266l\303\274m 3.ppt" new file mode 100644 index 0000000..7e7bd7c Binary files /dev/null and "b/turkish/dersler/Hafta 3-B\303\266l\303\274m 3.ppt" differ diff --git "a/turkish/dersler/Hafta 4-B\303\266l\303\274m 4.ppt" "b/turkish/dersler/Hafta 4-B\303\266l\303\274m 4.ppt" new file mode 100644 index 0000000..78aa721 Binary files /dev/null and "b/turkish/dersler/Hafta 4-B\303\266l\303\274m 4.ppt" differ diff --git "a/turkish/dersler/Hafta 4-B\303\266l\303\274m 4son.ppt" "b/turkish/dersler/Hafta 4-B\303\266l\303\274m 4son.ppt" new file mode 100644 index 0000000..7ddae1a Binary files /dev/null and "b/turkish/dersler/Hafta 4-B\303\266l\303\274m 4son.ppt" differ diff --git "a/turkish/dersler/Hafta 6-B\303\266l\303\274m 6.pptx" "b/turkish/dersler/Hafta 6-B\303\266l\303\274m 6.pptx" new file mode 100644 index 0000000..a74619b Binary files /dev/null and "b/turkish/dersler/Hafta 6-B\303\266l\303\274m 6.pptx" differ diff --git "a/turkish/dersler/Hafta 6-B\303\266l\303\274m 6son.ppt" "b/turkish/dersler/Hafta 6-B\303\266l\303\274m 6son.ppt" new file mode 100644 index 0000000..0ccf591 Binary files /dev/null and "b/turkish/dersler/Hafta 6-B\303\266l\303\274m 6son.ppt" differ diff --git "a/turkish/dersler/Hafta1-B\303\266l\303\274m1.ppt" "b/turkish/dersler/Hafta1-B\303\266l\303\274m1.ppt" new file mode 100644 index 0000000..19dfd70 Binary files /dev/null and "b/turkish/dersler/Hafta1-B\303\266l\303\274m1.ppt" differ diff --git "a/turkish/dersler/Hafta5- B\303\266l\303\274m 5.ppt" "b/turkish/dersler/Hafta5- B\303\266l\303\274m 5.ppt" new file mode 100644 index 0000000..a12ec55 Binary files /dev/null and "b/turkish/dersler/Hafta5- B\303\266l\303\274m 5.ppt" differ diff --git "a/turkish/dersler/Hafta7-B\303\266l\303\274m7.pptx" "b/turkish/dersler/Hafta7-B\303\266l\303\274m7.pptx" new file mode 100644 index 0000000..88aeff0 Binary files /dev/null and "b/turkish/dersler/Hafta7-B\303\266l\303\274m7.pptx" differ diff --git "a/turkish/dersler/Hafta7-B\303\266l\303\274m7son.ppt" "b/turkish/dersler/Hafta7-B\303\266l\303\274m7son.ppt" new file mode 100644 index 0000000..bd1ea63 Binary files /dev/null and "b/turkish/dersler/Hafta7-B\303\266l\303\274m7son.ppt" differ diff --git a/turkish/dersler/Regresyon ve Korelasyon.ppt b/turkish/dersler/Regresyon ve Korelasyon.ppt new file mode 100644 index 0000000..fb5fae7 Binary files /dev/null and b/turkish/dersler/Regresyon ve Korelasyon.ppt differ diff --git a/turkish/dersler/doktora/2011doktora.html b/turkish/dersler/doktora/2011doktora.html new file mode 100644 index 0000000..9925fe2 --- /dev/null +++ b/turkish/dersler/doktora/2011doktora.html @@ -0,0 +1,115 @@ + + + + + + +İÜ Dersler + + + + + +

        Şebnem Er

        +

        İ.Ü. İşletme Fakültesi Sayısal Yöntemler Anabilim Dalı
        2010-2011 Bahar Dönemi Doktora Programı

        +

        Tek ve Çok Değişkenli Zaman Serileri Analizi

        + + + + + + + +
        +
        ÖĞRETİM ÜYESİ:
        Prof.Dr. Neyran Orhunbilge
        +
        ÖĞRETİM ÜYE YARDIMCISI:
        Arş.Grv.Dr. Şebnem Er
        +
        DERSİN AMACI:
        Tek ve çok değişkenli zaman serileri analiz yöntemlerini kullanarak geleceğe dönük tahminlerin yapılması.
        +
        DERSİN HEDEFİ:
        Bilimsel araştırmalarda ve iş hayatında bu yöntemleri uygulayabilir hale gelmek ve gerçekçi tahminler yaparak politika geliştirebilmek.
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        1. Hafta:
        3 Mart 2011
        Zaman Serileri Analizine Giriş ve Temel Kavramlar
        Yıllık ve Aylık TÜFE ve ÜFE değerleri (2003-2010) excel dosyası
        2. Hafta:
        10 Mart 2011
        Zaman Serilerini Bileşenlerine Ayırma (Trend, Konjonktür, Mevsim ve Arizi Faktörler) Burcu Kemer
        3. Hafta:
        17 Mart 2011
        Düzgünleştirme Yöntemleri (Hareketli Ortalamlar ve Üstel Düzgünleştirme Yöntemleri)Burcu Kemer
        4. Hafta:
        24 Mart 2011
        Otoregressif ve/veya Hareketli Ortalamalar Yöntemi (Mevsimsel Olmayan)Onur Önay
        5. Hafta:
        31 Mart 2011
        Otoregressif ve/veya Hareketli Ortalamalar Yöntemi (Mevsimsel)Onur Önay
        6. Hafta:
        7 Nisan 2011
        Koşullu Değişen Varyans Modelleri (ARCH/GARCH)Merve Doğruel
        7. Hafta:
        14 Nisan 2011
        Ara Sınav
        8. Hafta:
        21 Nisan 2011
        Dışsal Açıklayıcı Değişken İçeren ARIMA Modelleri (ARMAX)Onur Önay
        9. Hafta:
        28 Nisan 2011
        Vektör Otoregressif Modeller (VAR)Dilara Büyükköz
        10. Hafta:
        5 Mayıs 2011
        Koentegrasyon Analizi (Engle-Granger İki Aşamalı Yöntemi Hata Düzeltme Modeli)Muhammet Atalay
        11. Hafta:
        12 Mayıs 2011
        Koentegrasyon Analizi (Johansen Yöntemi)Muhammet Atalay
        12. Hafta:
        19 Mayıs 2011
        Resmi Tatil
        13. Hafta:
        26 Mayıs 2011
        Panel Veri AnaliziOnur Demircioğlu
        14. Hafta:
        2 Haziran 2011
        Panel Veri AnaliziOnur Demircioğlu
        +
        Dersin Başarı Kriteri :
        +

        Ara sınav : %30 Yarı yıl Sonu sınavı : %70

        +

        Yoklama

        +
        Kaynaklar :
        +
          +
        1. Prof.Dr. Neyran ORHUNBİLGE’nin “Zaman Serileri Analizi Tahmin ve Fiyat İndeksleri
        2. +
        3. Bu konuları içeren tüm zaman serileri analizi kitapları.
        4. +
        5. İSO
        6. +
        7. DPT
        8. +
        9. İTO
        10. +
        11. TUİK
        12. +
        13. TCMB
        14. +
        15. İMKB
        16. +
        17. World Bank
        18. +
        19. Eurostat
        20. +
        21. Gapminder
        22. + +
        + + + \ No newline at end of file diff --git a/turkish/dersler/doktora/ConjointOverview.pdf b/turkish/dersler/doktora/ConjointOverview.pdf new file mode 100644 index 0000000..03fc6c5 Binary files /dev/null and b/turkish/dersler/doktora/ConjointOverview.pdf differ diff --git a/turkish/dersler/doktora/TUFE_UFE.xlsx b/turkish/dersler/doktora/TUFE_UFE.xlsx new file mode 100644 index 0000000..dfa58f5 Binary files /dev/null and b/turkish/dersler/doktora/TUFE_UFE.xlsx differ diff --git a/turkish/dersler/doktora/Vize/soru1_2.xlsx b/turkish/dersler/doktora/Vize/soru1_2.xlsx new file mode 100644 index 0000000..9d6d8b2 Binary files /dev/null and b/turkish/dersler/doktora/Vize/soru1_2.xlsx differ diff --git a/turkish/dersler/doktora/Yoklama.xlsx b/turkish/dersler/doktora/Yoklama.xlsx new file mode 100644 index 0000000..89e0474 Binary files /dev/null and b/turkish/dersler/doktora/Yoklama.xlsx differ diff --git a/turkish/dersler/doktora/doktora.html b/turkish/dersler/doktora/doktora.html new file mode 100644 index 0000000..2d12cd3 --- /dev/null +++ b/turkish/dersler/doktora/doktora.html @@ -0,0 +1,128 @@ + + + + + + +İÜ Dersler + + + + + + +

        Şebnem Er

        +

        İ.Ü. İşletme Fakültesi Sayısal Yöntemler Anabilim Dalı
        2011-2012 Bahar Dönemi Doktora Programı

        +

        Tek ve Çok Değişkenli Zaman Serileri Analizi

        + + + + + + + +
        +
        ÖĞRETİM ÜYESİ:
        Prof.Dr. Neyran Orhunbilge
        +
        ÖĞRETİM ÜYE YARDIMCISI:
        Arş.Grv.Dr. Şebnem Er
        +
        DERSİN AMACI:
        Tek ve çok değişkenli zaman serileri analiz yöntemlerini kullanarak geleceğe dönük tahminlerin yapılması.
        +
        DERSİN HEDEFİ:
        Bilimsel araştırmalarda ve iş hayatında bu yöntemleri uygulayabilir hale gelmek ve gerçekçi tahminler yaparak politika geliştirebilmek.
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        1. Hafta:
        23 Şubat 2012
        Zaman Serileri Analizine Giriş ve Temel Kavramlar
        Yıllık ve Aylık TÜFE ve ÜFE değerleri (2003-2011) excel dosyası
        2. Hafta:
        1 Mart 2012
        Zaman Serilerini Bileşenlerine Ayırma (Trend, Konjonktür, Mevsim ve Arizi Faktörler) Pakize
        3. Hafta:
        8 Mart 2012
        Düzgünleştirme Yöntemleri (Hareketli Ortalamlar ve Üstel Düzgünleştirme Yöntemleri)Pakize
        4. Hafta:
        15 Mart 2012
        Otoregressif ve/veya Hareketli Ortalamalar Yöntemi (Mevsimsel Olmayan)Yonca
        5. Hafta:
        22 Mart 2012
        Otoregressif ve/veya Hareketli Ortalamalar Yöntemi (Mevsimsel)Yonca
        6. Hafta:
        29 Mart 2012
        Koşullu Değişen Varyans Modelleri (ARCH/GARCH)Gonca
        7. Hafta:
        5 Nisan 2012
        Ara Sınav
        8. Hafta:
        12 Nisan 2012
        Dışsal Açıklayıcı Değişken İçeren ARIMA Modelleri (ARMAX)Aynur
        9. Hafta:
        19 Nisan 2012
        Vektör Otoregressif Modeller (VAR)Esra
        10. Hafta:
        26 Nisan 2012
        Vektör Otoregressif Modeller (VAR)Esra
        11. Hafta:
        3 Mayıs 2012
        Koentegrasyon Analizi (Engle-Granger İki Aşamalı Yöntemi Hata Düzeltme Modeli)Özin
        12. Hafta:
        10 Mayıs 2012
        Koentegrasyon Analizi (Johansen Yöntemi)Özin
        13. Hafta:
        17 Mayıs 2012
        Panel Veri AnaliziSelçuk
        14. Hafta:
        24 Mayıs 2012
        Panel Veri AnaliziSelçuk
        +
        Dersin Başarı Kriteri :
        +

        Ara sınav : %30 Yarı yıl Sonu sınavı : %70

        +

        Yoklama

        +
        Kaynaklar :
        +
          +
        1. Prof.Dr. Neyran ORHUNBİLGE’nin “Zaman Serileri Analizi Tahmin ve Fiyat İndeksleri
        2. +
        3. Bu konuları içeren tüm zaman serileri analizi kitapları.
        4. +
        5. İSO
        6. +
        7. DPT
        8. +
        9. İTO
        10. +
        11. TUİK
        12. +
        13. TCMB
        14. +
        15. İMKB
        16. +
        17. World Bank
        18. +
        19. Eurostat
        20. +
        21. Gapminder
        22. + +
        + + + \ No newline at end of file diff --git a/turkish/dersler/doktora/ozdegerler.pdf b/turkish/dersler/doktora/ozdegerler.pdf new file mode 100644 index 0000000..23874ce Binary files /dev/null and b/turkish/dersler/doktora/ozdegerler.pdf differ diff --git a/turkish/dersler/doktora/w2/BurcuKemerDogrusalTrend.xlsx b/turkish/dersler/doktora/w2/BurcuKemerDogrusalTrend.xlsx new file mode 100644 index 0000000..238bd4d Binary files /dev/null and b/turkish/dersler/doktora/w2/BurcuKemerDogrusalTrend.xlsx differ diff --git a/turkish/dersler/doktora/w2/BurcuKemeraylik.xlsx b/turkish/dersler/doktora/w2/BurcuKemeraylik.xlsx new file mode 100644 index 0000000..a646fec Binary files /dev/null and b/turkish/dersler/doktora/w2/BurcuKemeraylik.xlsx differ diff --git a/turkish/dersler/doktora/w2/BurcuKemersunum.ppt b/turkish/dersler/doktora/w2/BurcuKemersunum.ppt new file mode 100644 index 0000000..5aced79 Binary files /dev/null and b/turkish/dersler/doktora/w2/BurcuKemersunum.ppt differ diff --git a/turkish/dersler/doktora/w2/BurcuKemeryillik.xlsx b/turkish/dersler/doktora/w2/BurcuKemeryillik.xlsx new file mode 100644 index 0000000..b8712e5 Binary files /dev/null and b/turkish/dersler/doktora/w2/BurcuKemeryillik.xlsx differ diff --git a/turkish/dersler/doktora/w2/burcu1.html b/turkish/dersler/doktora/w2/burcu1.html new file mode 100644 index 0000000..f3b2337 --- /dev/null +++ b/turkish/dersler/doktora/w2/burcu1.html @@ -0,0 +1,36 @@ + + + + + + +İÜ Dersler + + + + + +

        Şebnem Er

        +

        İ.Ü. İşletme Fakültesi Sayısal Yöntemler Anabilim Dalı
        2010-2011 Bahar Dönemi Doktora Programı

        +

        Tek ve Çok Değişkenli Zaman Serileri Analizi

        +

        Burcu Kemer'in derste anlattığı konuların; +

        +Tüm bu dosyalar Burcu Kemer tarafından hazırlanmıştır. +

        + + + \ No newline at end of file diff --git a/turkish/dersler/index.html b/turkish/dersler/index.html new file mode 100644 index 0000000..11c859f --- /dev/null +++ b/turkish/dersler/index.html @@ -0,0 +1,37 @@ + + + + + + +İÜ Dersler + + + + + + +

        Şebnem Er

        +
      • İstanbul Üniversitesi İşletme Fakültesi

      • +

        +

          +
        • Doktora
        • +

          + + \ No newline at end of file diff --git a/turkish/dersler/lisans/index.html b/turkish/dersler/lisans/index.html new file mode 100644 index 0000000..aa4c544 --- /dev/null +++ b/turkish/dersler/lisans/index.html @@ -0,0 +1,39 @@ + + + + + + +İÜ Dersler + + + + + + +

          Şebnem Er

          +
        • İstanbul Üniversitesi İşletme Fakültesi

        • +

          +

          +

          + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/lisans.html b/turkish/dersler/lisans/istatistigeGiris/lisans.html new file mode 100644 index 0000000..b9c088c --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/lisans.html @@ -0,0 +1,121 @@ + + + + + + +İstatistiğe Giriş + + + + + + +

          Şebnem Er

          +
        • İstanbul Üniversitesi İşletme Fakültesi

        • +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          Öğretim Üyesi: Doç.Dr. Çiğdem Arıcıgil Çilan

          +

          Öğretim Üye Yardımcısı: Dr. Şebnem Er

          +

          Dersler: Pazartesi 13:00-15:00

          +

          Uygulamalar: Cuma 15:00-17:00

          +

          TÜM SLAYTLAR DOÇ.DR. ÇİĞDEM ARICIGİL ÇİLAN TARAFINDAN HAZIRLANMIŞTIR. LÜTFEN İZİNSİZ KULLANMAYINIZ.

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Akademik TakvimTeorik Ders İçeriğiUygulama
          1. Hafta:
          19 Eylül 2011
          Dersin Tanımı, Bilimsel Araştırma Aşamaları ve İstatistiğin Önemiİlk Uygulama
          2. Hafta:
          26 Eylül 2011
          Bilgi Toplama, Düzenleme ve Sunumu (Seriler, Tablolar ve Grafikler)Anket Sonuçları
          3. Hafta:
          3 Ekim 2011
          Tanımsal İstatistik Ölçüler ve Önemi
          4. Hafta:
          10 Ekim 2011
          Tanımsal İstatistik Ölçüler-Ortalamalar (Analitik Ortalamalar)
          5. Hafta:
          17 Ekim 2011
          Tanımsal İstatistik Ölçüler-Ortalamalar (Analitik Olmayan Ortalamalar)
          6. Hafta:
          24 Ekim 2011
          Tanımsal İstatistik Ölçüler – (Dağılma Ölçüleri)
          7. Hafta:
          31 Ekim 2011
          TekrarÖrnek Sorular-7
          8. Hafta:
          7 Kasım 2011
          Kurban Bayramı - İyi Bayramlar
          9. Hafta:
          14 Kasım 2011
          Ara Sınav
          10. Hafta:
          21 Kasım 2011
          Ara Sınav
          11. Hafta:
          28 Kasım 2011
          Olasılık - Marjinal - Koşullu ve Ağaç DiyagramıÖrnek Sorular-11
          12. Hafta:
          5 Aralık 2011
          Bayes Teoremi ve Binom DağılımıÖrnek Sorular-12
          13. Hafta:
          12 Aralık 2011
          Hipergeometrik ve Poisson DağılımlarıÖrnek Sorular-13
          14. Hafta:
          19 Aralık 2011
          Normal ve Üstel Sürekli DağılımlarıÖrnek Sorular-14
          15. Hafta:
          26 Aralık 2011
          Genel tekrarÖrnek Sorular-15
          +
          Dersin Başarı Kriteri :
          +

          Ara sınav : %40 Yarı yıl Sonu sınavı : %60

          +
          Kaynaklar :
          +
            +
          1. Prof.Dr. Neyran ORHUNBİLGE’nin “Tanımsal İstatistik Olasılık ve Olasılık Dağılımları
          2. +
          3. Bu konuları içeren tüm istatistik analiz kitapları.
          4. +
          5. Veri Tabanları:İSO,DPT,İTO, +TUİK, +TCMB, +İMKB, +World Bank, +Eurostat, +Gapminder vesaire... +
          +

          R istatistik paket programınıTürkiye'ye yakın olan bir ülkenin server'ından indirebilirsiniz. TAMAMEN FREE BİR SOFTWARE!!! Her türlü istatistik analiz/test yapmak mümkün.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w1/Excelsample.html b/turkish/dersler/lisans/istatistigeGiris/w1/Excelsample.html new file mode 100644 index 0000000..5662582 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w1/Excelsample.html @@ -0,0 +1,31 @@ + + + + + + +Excel'de Rand fonksiyonu + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          1500 öğrencisi olan bir fakültede 50 kişiyle bir anket çalışması yapacaksanız ve basit tesadüfi örnekleme türünü kullanacaksanız 50 adet rassal sayıyı Excel'de herhangi bir hücreye aşağıdaki formülün yazılmasıyla elde edebilirsiniz. Ancak bu formülün 50 adet Excel hücresinde tekrar edilmesi gerekmektedir. Aksi durumda sadece 1 tane tesadüfi sayı elde edersiniz!:

          +
          + =RANDBETWEEN(1,1500)
          +
          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w1/Rsample.html b/turkish/dersler/lisans/istatistigeGiris/w1/Rsample.html new file mode 100644 index 0000000..4900df9 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w1/Rsample.html @@ -0,0 +1,68 @@ + + + + + + +R programında sample fonksiyonu + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          1500 öğrencisi olan bir fakültede 50 kişiyle bir anket çalışması yapacaksanız ve basit tesadüfi örnekleme türünü kullanacaksanız 50 adet rassal sayıyı R programında sample fonksiyonunu kullanarak aşağıdaki gibi elde edebilirsiniz:

          +
          +R> sample(1500, 50)
          + [1]  255  293  461  252  655  780  974   34  477   53  737  678  815 1089 1266
          +[16]   28  899  946 1421  524  264 1109 1484 1330  345  176  801   23  109  209
          +[31] 1280 1417  790  748  327  918  411  663 1471  657  217  592  594  945  980
          +[46]  326  590 1446  480  764
          +
          +

          komutlarını R'da yazdığınızda her seferinde başka tesadüfi sayılar elde edersiniz. Bunu test etmek size kalmıştır.

          +

          Eğer aynı sayılara ulaşmak istiyorsanız her sample() komutundan önce set.seed fonksiyonunu çalıştırmanız gerekmektedir:

          +
          +R> set.seed(1)
          +R> sample(1500,50)
          + [1]  399  558  859 1360  302 1344 1412  987  939   93  307  263 1023  572 1144
          +[16]  740 1065 1471  564 1152 1384  314  964  186  395  570   20 1482 1281  501
          +[31]  709  881  725  274 1213  980 1163  158 1059  601 1199  945 1142  806  772
          +[46] 1149   34  694 1064 1006
          +R> set.seed(1)
          +R> sample(1500,50)
          + [1]  399  558  859 1360  302 1344 1412  987  939   93  307  263 1023  572 1144
          +[16]  740 1065 1471  564 1152 1384  314  964  186  395  570   20 1482 1281  501
          +[31]  709  881  725  274 1213  980 1163  158 1059  601 1199  945 1142  806  772
          +[46] 1149   34  694 1064 1006
          +
          +

          Bu çıkan tesadüfi sayıları küçükten büyüğe sıralı bir şekilde elde etmek isterseniz de sort fonksiyonunu kullanabilirsiniz:

          +
          +R> set.seed(1)
          +R> sort(sample(1500,50))
          + [1]   20   34   93  158  186  263  274  302  307  314  395  399  501  558  564
          +[16]  570  572  601  694  709  725  740  772  806  859  881  939  945  964  980
          +[31]  987 1006 1023 1059 1064 1065 1142 1144 1149 1152 1163 1199 1213 1281 1344
          +[46] 1360 1384 1412 1471 1482
          +
          +

          sample fonksiyonunu Zar Atma örneğinde de kullanmak mümkün. Lütfen birinci dönemin olasılık dersini hatırlayalım.

          +

          sample fonksiyonu ile ilgili birkaç kaynağa da göz atabilirsiniz:

          + + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w1/dice.html b/turkish/dersler/lisans/istatistigeGiris/w1/dice.html new file mode 100644 index 0000000..fda8efe --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w1/dice.html @@ -0,0 +1,69 @@ + + + + + + +Zar Atma Örneği - Olasılık Teorisi + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          Bir Zarı 10 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> ilkdeneme=sample(zar,10,replace=T)
          +R> table(ilkdeneme)
          +ilkdeneme
          +1 2 3 4 5 6 
          +1 1 4 1 1 2 
          +
          +

          +

          Bir Zarı 100 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> ikincideneme=sample(zar,100,replace=T)
          +R> table(ikincideneme)
          +ikincideneme
          + 1  2  3  4  5  6 
          +21 22 20  8 15 14 
          +
          +

          +

          Bir Zarı 1000 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> ucuncudeneme=sample(zar,1000,replace=T)
          +R> table(ucuncudeneme)
          +  1   2   3   4   5   6 
          +190 140 191 138 174 167 
          +
          +

          Bir Zarı 10000 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> dorduncudeneme=sample(zar,10000,replace=T)
          +R> table(dorduncudeneme)
          +   1    2    3    4    5    6 
          +1685 1640 1686 1621 1634 1734 
          +
          +

          +

          10, 100, 1000 ve 10000 denemelerdeki sonuçlar incelendiğinde deneme sayısı arttıkça zarın yüzündeki sayıların gerçekleşme olasılıklarının 1/6 yani 0.1667'ye yaklaştığını görmekteyiz.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w1/sampling.html b/turkish/dersler/lisans/istatistigeGiris/w1/sampling.html new file mode 100644 index 0000000..78abab4 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w1/sampling.html @@ -0,0 +1,31 @@ + + + + + + +Örnekleme Teorisi + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          Örnekleme konusunda internette oldukça fazla kaynak bulmanız mümkün. İngilizce'niz iyiyse ya da geliştirmek istiyorsanız, lütfen Statistics Canada sayfasını inceleyiniz. Burada örnekleme teorisi ile tesadüfi ve tesadüfi olmayan örnekleme türleri hakkında bilgi edinebilirsiniz. Bunun dışında Prof.Dr.Neyran Orhunbilge'nin Örnekleme Yöntemleri ve Hipotez Testleri kitabından ilgili bölümü okuyunuz.

          +

          Derste verdiğim Google örneğindeki Google ofislerinin dünya üzerindeki haritasını inceleyin lütfen. Haritada zoom-out yaparsanız tüm dünya üzerindeki ofislerin nerelerde olduğunu görebilirsiniz.

          +

          R istatistik programında Tesadüfi Sayıların türetilmesi

          +

          Excel'de Tesadüfi Sayıların türetilmesi

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w1/tutorial1.html b/turkish/dersler/lisans/istatistigeGiris/w1/tutorial1.html new file mode 100644 index 0000000..3b0e50a --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w1/tutorial1.html @@ -0,0 +1,28 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          Haftaya sonuçlarını analiz edeceğimiz anket formunu doldurup submit tuşuna basınız. Sonuçlar haftaya...

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w10/tutorial10.html b/turkish/dersler/lisans/istatistigeGiris/w10/tutorial10.html new file mode 100644 index 0000000..4c91049 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w10/tutorial10.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          10ncu Hafta Uygulama

          +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w11/11nciHafta_olasilik.doc b/turkish/dersler/lisans/istatistigeGiris/w11/11nciHafta_olasilik.doc new file mode 100644 index 0000000..31099e5 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w11/11nciHafta_olasilik.doc differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w11/tutorial11.html b/turkish/dersler/lisans/istatistigeGiris/w11/tutorial11.html new file mode 100644 index 0000000..1adad80 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w11/tutorial11.html @@ -0,0 +1,28 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          11nci Hafta Uygulama

          +

          Uygulama Soruları

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w12/12nciHafta_BayesBinomial.doc b/turkish/dersler/lisans/istatistigeGiris/w12/12nciHafta_BayesBinomial.doc new file mode 100644 index 0000000..8783008 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w12/12nciHafta_BayesBinomial.doc differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w12/tutorial12.html b/turkish/dersler/lisans/istatistigeGiris/w12/tutorial12.html new file mode 100644 index 0000000..09efe53 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w12/tutorial12.html @@ -0,0 +1,28 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          12nci Hafta Uygulama

          +

          Uygulama Soruları

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w13/13ncuHafta_HipergeometrikPoisson.doc b/turkish/dersler/lisans/istatistigeGiris/w13/13ncuHafta_HipergeometrikPoisson.doc new file mode 100644 index 0000000..eb67b27 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w13/13ncuHafta_HipergeometrikPoisson.doc differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w13/tutorial13.html b/turkish/dersler/lisans/istatistigeGiris/w13/tutorial13.html new file mode 100644 index 0000000..2f4a88b --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w13/tutorial13.html @@ -0,0 +1,28 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          13ncü Hafta Uygulama

          +

          Uygulama Soruları

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w14/14ncuHafta_NormalUstel.doc b/turkish/dersler/lisans/istatistigeGiris/w14/14ncuHafta_NormalUstel.doc new file mode 100644 index 0000000..62fa799 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w14/14ncuHafta_NormalUstel.doc differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w14/tutorial14.html b/turkish/dersler/lisans/istatistigeGiris/w14/tutorial14.html new file mode 100644 index 0000000..cf14729 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w14/tutorial14.html @@ -0,0 +1,28 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          14ncü Hafta Uygulama

          +

          Uygulama Soruları

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w15/donemsonutekrarturkce.doc b/turkish/dersler/lisans/istatistigeGiris/w15/donemsonutekrarturkce.doc new file mode 100644 index 0000000..c8f723e Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w15/donemsonutekrarturkce.doc differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w15/tutorial15.html b/turkish/dersler/lisans/istatistigeGiris/w15/tutorial15.html new file mode 100644 index 0000000..d019c3c --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w15/tutorial15.html @@ -0,0 +1,28 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          15nci Hafta Uygulama

          +

          Dönem Sonu Tekrar Soruları

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/0701EN.pdf b/turkish/dersler/lisans/istatistigeGiris/w2/0701EN.pdf new file mode 100644 index 0000000..2a84940 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/0701EN.pdf differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/AnketSonuclar.xlsx b/turkish/dersler/lisans/istatistigeGiris/w2/AnketSonuclar.xlsx new file mode 100644 index 0000000..a8391e9 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/AnketSonuclar.xlsx differ diff --git "a/turkish/dersler/lisans/istatistigeGiris/w2/Facebook kullan\304\261m\304\261.xls" "b/turkish/dersler/lisans/istatistigeGiris/w2/Facebook kullan\304\261m\304\261.xls" new file mode 100644 index 0000000..a93d8cd Binary files /dev/null and "b/turkish/dersler/lisans/istatistigeGiris/w2/Facebook kullan\304\261m\304\261.xls" differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2.pdf b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2.pdf new file mode 100644 index 0000000..5fd6ba5 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2.pdf differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2.ppt b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2.ppt new file mode 100644 index 0000000..08a5df5 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2.ppt differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2Grafikler.pdf b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2Grafikler.pdf new file mode 100644 index 0000000..b256b06 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2Grafikler.pdf differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2Grafikler.ppt b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2Grafikler.ppt new file mode 100644 index 0000000..411cba7 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/Hafta2Grafikler.ppt differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/gov_dd_edpt1.xls b/turkish/dersler/lisans/istatistigeGiris/w2/gov_dd_edpt1.xls new file mode 100644 index 0000000..d025f7b Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/gov_dd_edpt1.xls differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/indicator_tabove15unemploy.xls b/turkish/dersler/lisans/istatistigeGiris/w2/indicator_tabove15unemploy.xls new file mode 100644 index 0000000..8b5b066 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/indicator_tabove15unemploy.xls differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/map-of-europe.jpg b/turkish/dersler/lisans/istatistigeGiris/w2/map-of-europe.jpg new file mode 100644 index 0000000..4128c60 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/map-of-europe.jpg differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/tutorial2.html b/turkish/dersler/lisans/istatistigeGiris/w2/tutorial2.html new file mode 100644 index 0000000..e02d24e --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w2/tutorial2.html @@ -0,0 +1,29 @@ + + + + + + +İstatistiğe Giriş + + + + + +

          Şebnem Er

          +

          İstatistiğe Giriş 2011-2012 Güz Dönemi Lisans Dersi

          +

          2nci Hafta Uygulama

          +

          Sitede yer alan anketi doldurduğunuz için çok teşekkür ederim. Bu hafta bu anketin sonuçlarını göreceğiz. Sonuçlar linkinde yer alıyor. Ancak elbette ham veri şeklinde. Uygulama dersinde birlikte bu verilere dair grafikler çizeceğiz...

          +

          Excel'i kullanarak surekli verilere histogram çizmek oldukça kolay. Lutfen bu linkte yer alan youtube videosunu izleyiniz.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a (1).xls b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a (1).xls new file mode 100644 index 0000000..2056125 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a (1).xls differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a.xls b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a.xls new file mode 100644 index 0000000..3677343 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a.xls differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a25_75male.xls b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a25_75male.xls new file mode 100644 index 0000000..0878b23 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_a25_75male.xls differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_afemale.xls b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_afemale.xls new file mode 100644 index 0000000..97ca856 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w2/une_rt_afemale.xls differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w3/Hafta3TanimsalIst.pdf b/turkish/dersler/lisans/istatistigeGiris/w3/Hafta3TanimsalIst.pdf new file mode 100644 index 0000000..3e463f8 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w3/Hafta3TanimsalIst.pdf differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w3/Hafta3TanimsalIst.ppt b/turkish/dersler/lisans/istatistigeGiris/w3/Hafta3TanimsalIst.ppt new file mode 100644 index 0000000..f62c424 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w3/Hafta3TanimsalIst.ppt differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w3/tutorial3.html b/turkish/dersler/lisans/istatistigeGiris/w3/tutorial3.html new file mode 100644 index 0000000..a3f6845 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w3/tutorial3.html @@ -0,0 +1,28 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          3ncü Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce çözmeye çalışın lütfen. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w4/4ncuHafta_KartillerGeometrikTartiliOrtalama.docx b/turkish/dersler/lisans/istatistigeGiris/w4/4ncuHafta_KartillerGeometrikTartiliOrtalama.docx new file mode 100644 index 0000000..3593636 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w4/4ncuHafta_KartillerGeometrikTartiliOrtalama.docx differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w4/tutorial4.html b/turkish/dersler/lisans/istatistigeGiris/w4/tutorial4.html new file mode 100644 index 0000000..68d661f --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w4/tutorial4.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          4ncü Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          ÖDEVİ DE UNUTMAYIN

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w5/tutorial5.html b/turkish/dersler/lisans/istatistigeGiris/w5/tutorial5.html new file mode 100644 index 0000000..e8d6b61 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w5/tutorial5.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          5nci Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          ÖDEVİ DE UNUTMAYIN. Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w6/tutorial6.html b/turkish/dersler/lisans/istatistigeGiris/w6/tutorial6.html new file mode 100644 index 0000000..6f0d894 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w6/tutorial6.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          6ncı Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistigeGiris/w7/7nciHafta_tekrar.doc b/turkish/dersler/lisans/istatistigeGiris/w7/7nciHafta_tekrar.doc new file mode 100644 index 0000000..ec69418 Binary files /dev/null and b/turkish/dersler/lisans/istatistigeGiris/w7/7nciHafta_tekrar.doc differ diff --git a/turkish/dersler/lisans/istatistigeGiris/w7/tutorial7.html b/turkish/dersler/lisans/istatistigeGiris/w7/tutorial7.html new file mode 100644 index 0000000..b06d8e0 --- /dev/null +++ b/turkish/dersler/lisans/istatistigeGiris/w7/tutorial7.html @@ -0,0 +1,28 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          7nci Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip çalışabilirsiniz.

          + + + \ No newline at end of file diff --git "a/turkish/dersler/lisans/istatistigeGiris/yeni istatistik ders i\303\247eri\304\237i.doc" "b/turkish/dersler/lisans/istatistigeGiris/yeni istatistik ders i\303\247eri\304\237i.doc" new file mode 100644 index 0000000..5a8b28e Binary files /dev/null and "b/turkish/dersler/lisans/istatistigeGiris/yeni istatistik ders i\303\247eri\304\237i.doc" differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/lisans.html b/turkish/dersler/lisans/istatistikAnaliz/lisans.html new file mode 100644 index 0000000..3381b54 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/lisans.html @@ -0,0 +1,120 @@ + + + + + + +İstatistik Analiz + + + + + + +

          Şebnem Er

          +
        • İstanbul Üniversitesi İşletme Fakültesi

        • +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          Öğretim Üyesi: Doç.Dr. Çiğdem Arıcıgil Çilan

          +

          Öğretim Üye Yardımcısı: Dr. Şebnem Er

          +

          Dersler: Salı 09:30-11:00

          +

          Uygulamalar: Cuma 15:00-17:00

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Akademik TakvimTeorik Ders İçeriğiUygulama
          1. Hafta:
          1 Mart 2011
          Örnekleme Teorisi
          2. Hafta:
          8 Mart 2011
          Anakütle Ortalamasının TahminiÖrnek Sorular-2
          3. Hafta:
          15 Mart 2011
          Anakütle Oran TahminiÖrnek Sorular-3
          4. Hafta:
          22 Mart 2011
          Anakütle Varyansının Tahmini, Örnek Büyüklüğünün BelirlenmesiÖrnek Sorular-4
          5. Hafta:
          29 Mart 2011
          Hipotez Testleri ve Aşamaları, Tek Ortalama Testleri ve İki Ortalama Arasındaki Farkın TestleriÖrnek Sorular-5
          6. Hafta:
          5 Nisan 2011
          İki ve İkiden Fazla Ortalama Arasındaki Farkın Testleri - Varyans AnaliziÖrnek Sorular-6
          7. Hafta:
          12 Nisan 2011
          Vize öncesi tekrarÖrnek Sorular-7
          8. Hafta:
          19 Nisan 2011
          Ara Sınav
          9. Hafta:
          26 Nisan 2011
          Ara Sınav
          10. Hafta:
          3 Mayıs 2011
          Oran Testleri Örnek Sorular-10
          11. Hafta:
          10 Mayıs 2011
          Varyans TestleriÖrnek Sorular-11
          12. Hafta:
          17 Mayıs 2011
          Normallik ve Ki-kare TestleriÖrnek Sorular-12
          13. Hafta:
          24 Mayıs 2011
          İşaret ve MannWhitney U Nonparametrik TestleriÖrnek Sorular-13
          14. Hafta:
          31 Mayıs 2011
          Kruskal Wallis TestiÖrnek Sorular-14
          15. Hafta:
          10 Haziran 2011
          Genel tekrarSınavda başarılar!
          +
          Dersin Başarı Kriteri :
          +

          Ara sınav : %40 Yarı yıl Sonu sınavı : %60

          +
          Kaynaklar :
          +
            +
          1. Prof.Dr. Neyran ORHUNBİLGE’nin “Örnekleme Yöntemleri ve Hipotez Testleri
          2. +
          3. Bu konuları içeren tüm istatistik analiz kitapları.
          4. +
          5. Veri Tabanları:İSO,DPT,İTO, +TUİK, +TCMB, +İMKB, +World Bank, +Eurostat, +Gapminder vesaire... +
          +

          R istatistik paket programınıTürkiye'ye yakın olan bir ülkenin server'ından indirebilirsiniz. TAMAMEN FREE BİR SOFTWARE!!! Her türlü istatistik analiz/test yapmak mümkün.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/odevVerenler.txt b/turkish/dersler/lisans/istatistikAnaliz/odevVerenler.txt new file mode 100644 index 0000000..8978cf0 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/odevVerenler.txt @@ -0,0 +1,44 @@ ++Emre Uan 1001090035 ++Tolga Akan 1001090024 ++Taner Kayaca 1001090006 ++Erdogan Yildirim 1001090115 ++Sema Arslan 1001090015 ++Reyhan Gl Dzen 16812 + +*************************************************** +Derse Katilanlar: + + +************** 20 Mays 2011 (Levene ve Ortalama testi) + + ++lknur Kk (yars) ++Merve Sava (yars) ++Fatmagl Kker (yars) ++Derya Ayazolu (yars) ++Cansu alk (yars) ++zgl Erbay (yars) ++Demet Yildiz 1001090329 + +zmen Alpaslan 16616 + ++Seluk akir 1001080158 ++Koray Korkmaz 1001090151 ++Zuhal +Demet +Nazli ++Kbra ++Ceren Dere ++Emrah oban + ++Mevlt Zeren (yars) +-Mahmut Emin evik (yars) ++Kerem Aydnl (yars) ++Mehtap elik (yars) ++Elif Kurupnar (yars) +-Adem Dursun (yars) ++Erkan Yatkn (tamam) ++enay Ayan (tamam) ++Ceren Dere (tamam) + + diff --git a/turkish/dersler/lisans/istatistikAnaliz/w1/Excelsample.html b/turkish/dersler/lisans/istatistikAnaliz/w1/Excelsample.html new file mode 100644 index 0000000..5662582 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w1/Excelsample.html @@ -0,0 +1,31 @@ + + + + + + +Excel'de Rand fonksiyonu + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          1500 öğrencisi olan bir fakültede 50 kişiyle bir anket çalışması yapacaksanız ve basit tesadüfi örnekleme türünü kullanacaksanız 50 adet rassal sayıyı Excel'de herhangi bir hücreye aşağıdaki formülün yazılmasıyla elde edebilirsiniz. Ancak bu formülün 50 adet Excel hücresinde tekrar edilmesi gerekmektedir. Aksi durumda sadece 1 tane tesadüfi sayı elde edersiniz!:

          +
          + =RANDBETWEEN(1,1500)
          +
          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w1/Rsample.html b/turkish/dersler/lisans/istatistikAnaliz/w1/Rsample.html new file mode 100644 index 0000000..4900df9 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w1/Rsample.html @@ -0,0 +1,68 @@ + + + + + + +R programında sample fonksiyonu + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          1500 öğrencisi olan bir fakültede 50 kişiyle bir anket çalışması yapacaksanız ve basit tesadüfi örnekleme türünü kullanacaksanız 50 adet rassal sayıyı R programında sample fonksiyonunu kullanarak aşağıdaki gibi elde edebilirsiniz:

          +
          +R> sample(1500, 50)
          + [1]  255  293  461  252  655  780  974   34  477   53  737  678  815 1089 1266
          +[16]   28  899  946 1421  524  264 1109 1484 1330  345  176  801   23  109  209
          +[31] 1280 1417  790  748  327  918  411  663 1471  657  217  592  594  945  980
          +[46]  326  590 1446  480  764
          +
          +

          komutlarını R'da yazdığınızda her seferinde başka tesadüfi sayılar elde edersiniz. Bunu test etmek size kalmıştır.

          +

          Eğer aynı sayılara ulaşmak istiyorsanız her sample() komutundan önce set.seed fonksiyonunu çalıştırmanız gerekmektedir:

          +
          +R> set.seed(1)
          +R> sample(1500,50)
          + [1]  399  558  859 1360  302 1344 1412  987  939   93  307  263 1023  572 1144
          +[16]  740 1065 1471  564 1152 1384  314  964  186  395  570   20 1482 1281  501
          +[31]  709  881  725  274 1213  980 1163  158 1059  601 1199  945 1142  806  772
          +[46] 1149   34  694 1064 1006
          +R> set.seed(1)
          +R> sample(1500,50)
          + [1]  399  558  859 1360  302 1344 1412  987  939   93  307  263 1023  572 1144
          +[16]  740 1065 1471  564 1152 1384  314  964  186  395  570   20 1482 1281  501
          +[31]  709  881  725  274 1213  980 1163  158 1059  601 1199  945 1142  806  772
          +[46] 1149   34  694 1064 1006
          +
          +

          Bu çıkan tesadüfi sayıları küçükten büyüğe sıralı bir şekilde elde etmek isterseniz de sort fonksiyonunu kullanabilirsiniz:

          +
          +R> set.seed(1)
          +R> sort(sample(1500,50))
          + [1]   20   34   93  158  186  263  274  302  307  314  395  399  501  558  564
          +[16]  570  572  601  694  709  725  740  772  806  859  881  939  945  964  980
          +[31]  987 1006 1023 1059 1064 1065 1142 1144 1149 1152 1163 1199 1213 1281 1344
          +[46] 1360 1384 1412 1471 1482
          +
          +

          sample fonksiyonunu Zar Atma örneğinde de kullanmak mümkün. Lütfen birinci dönemin olasılık dersini hatırlayalım.

          +

          sample fonksiyonu ile ilgili birkaç kaynağa da göz atabilirsiniz:

          + + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w1/dice.html b/turkish/dersler/lisans/istatistikAnaliz/w1/dice.html new file mode 100644 index 0000000..fda8efe --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w1/dice.html @@ -0,0 +1,69 @@ + + + + + + +Zar Atma Örneği - Olasılık Teorisi + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          Bir Zarı 10 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> ilkdeneme=sample(zar,10,replace=T)
          +R> table(ilkdeneme)
          +ilkdeneme
          +1 2 3 4 5 6 
          +1 1 4 1 1 2 
          +
          +

          +

          Bir Zarı 100 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> ikincideneme=sample(zar,100,replace=T)
          +R> table(ikincideneme)
          +ikincideneme
          + 1  2  3  4  5  6 
          +21 22 20  8 15 14 
          +
          +

          +

          Bir Zarı 1000 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> ucuncudeneme=sample(zar,1000,replace=T)
          +R> table(ucuncudeneme)
          +  1   2   3   4   5   6 
          +190 140 191 138 174 167 
          +
          +

          Bir Zarı 10000 kez attığınızda çıkacak sonuçlar

          +

          +

          +R> zar=c(1,2,3,4,5,6)
          +R> dorduncudeneme=sample(zar,10000,replace=T)
          +R> table(dorduncudeneme)
          +   1    2    3    4    5    6 
          +1685 1640 1686 1621 1634 1734 
          +
          +

          +

          10, 100, 1000 ve 10000 denemelerdeki sonuçlar incelendiğinde deneme sayısı arttıkça zarın yüzündeki sayıların gerçekleşme olasılıklarının 1/6 yani 0.1667'ye yaklaştığını görmekteyiz.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w1/sampling.html b/turkish/dersler/lisans/istatistikAnaliz/w1/sampling.html new file mode 100644 index 0000000..78abab4 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w1/sampling.html @@ -0,0 +1,31 @@ + + + + + + +Örnekleme Teorisi + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          1nci Hafta Uygulama

          +

          Örnekleme konusunda internette oldukça fazla kaynak bulmanız mümkün. İngilizce'niz iyiyse ya da geliştirmek istiyorsanız, lütfen Statistics Canada sayfasını inceleyiniz. Burada örnekleme teorisi ile tesadüfi ve tesadüfi olmayan örnekleme türleri hakkında bilgi edinebilirsiniz. Bunun dışında Prof.Dr.Neyran Orhunbilge'nin Örnekleme Yöntemleri ve Hipotez Testleri kitabından ilgili bölümü okuyunuz.

          +

          Derste verdiğim Google örneğindeki Google ofislerinin dünya üzerindeki haritasını inceleyin lütfen. Haritada zoom-out yaparsanız tüm dünya üzerindeki ofislerin nerelerde olduğunu görebilirsiniz.

          +

          R istatistik programında Tesadüfi Sayıların türetilmesi

          +

          Excel'de Tesadüfi Sayıların türetilmesi

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w10/10nciHafta_orantest.doc b/turkish/dersler/lisans/istatistikAnaliz/w10/10nciHafta_orantest.doc new file mode 100644 index 0000000..b2c43c8 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w10/10nciHafta_orantest.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w10/10nciHafta_orantest2.doc b/turkish/dersler/lisans/istatistikAnaliz/w10/10nciHafta_orantest2.doc new file mode 100644 index 0000000..bac884f Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w10/10nciHafta_orantest2.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w10/tutorial10.html b/turkish/dersler/lisans/istatistikAnaliz/w10/tutorial10.html new file mode 100644 index 0000000..4c91049 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w10/tutorial10.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          10ncu Hafta Uygulama

          +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w11/11nciHafta_varyans.doc b/turkish/dersler/lisans/istatistikAnaliz/w11/11nciHafta_varyans.doc new file mode 100644 index 0000000..25aecfc Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w11/11nciHafta_varyans.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w11/tutorial11.html b/turkish/dersler/lisans/istatistikAnaliz/w11/tutorial11.html new file mode 100644 index 0000000..b8a909b --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w11/tutorial11.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          11nci Hafta Uygulama

          +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w12/12nciHafta_normalKikare.doc b/turkish/dersler/lisans/istatistikAnaliz/w12/12nciHafta_normalKikare.doc new file mode 100644 index 0000000..721308e Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w12/12nciHafta_normalKikare.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w12/tutorial12.html b/turkish/dersler/lisans/istatistikAnaliz/w12/tutorial12.html new file mode 100644 index 0000000..c5bbf9b --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w12/tutorial12.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          12nci Hafta Uygulama

          +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w13/13ncuHafta_nonparametrik.doc b/turkish/dersler/lisans/istatistikAnaliz/w13/13ncuHafta_nonparametrik.doc new file mode 100644 index 0000000..8ed89da Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w13/13ncuHafta_nonparametrik.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w13/tutorial13.html b/turkish/dersler/lisans/istatistikAnaliz/w13/tutorial13.html new file mode 100644 index 0000000..e12db8c --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w13/tutorial13.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          13ncü Hafta Uygulama

          +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w14/14ncuHafta_nonparametrik.doc b/turkish/dersler/lisans/istatistikAnaliz/w14/14ncuHafta_nonparametrik.doc new file mode 100644 index 0000000..1030092 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w14/14ncuHafta_nonparametrik.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w14/tutorial14.html b/turkish/dersler/lisans/istatistikAnaliz/w14/tutorial14.html new file mode 100644 index 0000000..5128a65 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w14/tutorial14.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          14ncü Hafta Uygulama

          +Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w2/2nciHafta_TekAnakutleOrtalamaTahmini.doc b/turkish/dersler/lisans/istatistikAnaliz/w2/2nciHafta_TekAnakutleOrtalamaTahmini.doc new file mode 100644 index 0000000..1c729d9 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w2/2nciHafta_TekAnakutleOrtalamaTahmini.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w2/2nciHafta_TekAnakutleOrtalamaTahminiCozumler.xlsx b/turkish/dersler/lisans/istatistikAnaliz/w2/2nciHafta_TekAnakutleOrtalamaTahminiCozumler.xlsx new file mode 100644 index 0000000..af4ec38 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w2/2nciHafta_TekAnakutleOrtalamaTahminiCozumler.xlsx differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w2/tutorial2.html b/turkish/dersler/lisans/istatistikAnaliz/w2/tutorial2.html new file mode 100644 index 0000000..c05ae79 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w2/tutorial2.html @@ -0,0 +1,29 @@ + + + + + + +İstatistik Analiz + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          2nci Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce çözmeye çalışın lütfen. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          R paket programında aralık tahminini yapmak oldukça kolay. Lütfen şu siteyi inceleyiniz.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahmini.doc b/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahmini.doc new file mode 100644 index 0000000..0acdf69 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahmini.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahmini.docx b/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahmini.docx new file mode 100644 index 0000000..bec63b9 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahmini.docx differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahminiCozumler.xlsx b/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahminiCozumler.xlsx new file mode 100644 index 0000000..58f1a47 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w3/3ncuHafta_TekAnakutleOrtalamaOranTahminiCozumler.xlsx differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w3/tutorial3.html b/turkish/dersler/lisans/istatistikAnaliz/w3/tutorial3.html new file mode 100644 index 0000000..a3f6845 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w3/tutorial3.html @@ -0,0 +1,28 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          3ncü Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce çözmeye çalışın lütfen. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w4/4ncuHafta_TekAnakutleOrtalamaOranTahmini.doc b/turkish/dersler/lisans/istatistikAnaliz/w4/4ncuHafta_TekAnakutleOrtalamaOranTahmini.doc new file mode 100644 index 0000000..c4d918f Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w4/4ncuHafta_TekAnakutleOrtalamaOranTahmini.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w4/4ncuHafta_TekAnakutleOrtalamaOranTahmini.docx b/turkish/dersler/lisans/istatistikAnaliz/w4/4ncuHafta_TekAnakutleOrtalamaOranTahmini.docx new file mode 100644 index 0000000..8e80f0b Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w4/4ncuHafta_TekAnakutleOrtalamaOranTahmini.docx differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w4/Yeni Microsoft Office Excel Worksheet.xlsx b/turkish/dersler/lisans/istatistikAnaliz/w4/Yeni Microsoft Office Excel Worksheet.xlsx new file mode 100644 index 0000000..cb8bfd2 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w4/Yeni Microsoft Office Excel Worksheet.xlsx differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w4/tutorial4.html b/turkish/dersler/lisans/istatistikAnaliz/w4/tutorial4.html new file mode 100644 index 0000000..5fa1371 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w4/tutorial4.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          4ncü Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          ÖDEVİ DE UNUTMAYIN

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w5/5nciHafta_TekIkiAnakutleOrtalamaTest.doc b/turkish/dersler/lisans/istatistikAnaliz/w5/5nciHafta_TekIkiAnakutleOrtalamaTest.doc new file mode 100644 index 0000000..b83f1e0 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w5/5nciHafta_TekIkiAnakutleOrtalamaTest.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w5/tutorial5.html b/turkish/dersler/lisans/istatistikAnaliz/w5/tutorial5.html new file mode 100644 index 0000000..e8d6b61 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w5/tutorial5.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          5nci Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          ÖDEVİ DE UNUTMAYIN. Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w6/6nciHafta_IkiIkidenFazlaAnakutleOrtalamaTest.doc b/turkish/dersler/lisans/istatistikAnaliz/w6/6nciHafta_IkiIkidenFazlaAnakutleOrtalamaTest.doc new file mode 100644 index 0000000..1f4d8df Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w6/6nciHafta_IkiIkidenFazlaAnakutleOrtalamaTest.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w6/tutorial6.html b/turkish/dersler/lisans/istatistikAnaliz/w6/tutorial6.html new file mode 100644 index 0000000..6f0d894 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w6/tutorial6.html @@ -0,0 +1,29 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          6ncı Hafta Uygulama

          +

          Cuma günü uygulama dersinde çözeceğimiz soruları (word dosyası olarak) indirip uygulama dersinden önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Çözemediğiniz ya da takıldığınız yerleri cuma günü derste sorabilirsiniz.

          +

          Soruları fotokopiye de bıraktım.

          + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/istatistikAnaliz/w7/7nciHafta_tekrar.doc b/turkish/dersler/lisans/istatistikAnaliz/w7/7nciHafta_tekrar.doc new file mode 100644 index 0000000..2acbe93 Binary files /dev/null and b/turkish/dersler/lisans/istatistikAnaliz/w7/7nciHafta_tekrar.doc differ diff --git a/turkish/dersler/lisans/istatistikAnaliz/w7/tutorial7.html b/turkish/dersler/lisans/istatistikAnaliz/w7/tutorial7.html new file mode 100644 index 0000000..7e8c637 --- /dev/null +++ b/turkish/dersler/lisans/istatistikAnaliz/w7/tutorial7.html @@ -0,0 +1,30 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +

          İstatistik Analiz 2010-2011 Bahar Dönemi Lisans Dersi

          +

          7nci Hafta Uygulama

          +

          Bu hafta sınav öncesi genel tekrar yapacağız. Soruları (word dosyası olarak) indirip dersten önce ÇÖZMEYE ÇALIŞIN LÜTFEN. Zaten çözemiyorsanız sınavda işiniz zor.

          +

          Soruları fotokopiye de bıraktım.

          + + + + \ No newline at end of file diff --git a/turkish/dersler/lisans/uygulamaliIstatistikAnaliz/lisans.html b/turkish/dersler/lisans/uygulamaliIstatistikAnaliz/lisans.html new file mode 100644 index 0000000..249e355 --- /dev/null +++ b/turkish/dersler/lisans/uygulamaliIstatistikAnaliz/lisans.html @@ -0,0 +1,107 @@ + + + + + + +İşletmelerde Uygulamalı İstatistik Analiz + + + + + +

          Şebnem Er

          +
        • İstanbul Üniversitesi İşletme Fakültesi

        • +

          İşletmelerde Uygulamalı İstatistik Analiz 2011-2012 Güz Dönemi Lisans Dersi

          +

          Öğretim Üyesi: Doç.Dr. Çiğdem Arıcıgil Çilan

          +

          Öğretim Üye Yardımcısı: Dr. Şebnem Er

          +

          Dersler: Salı 09:30-11:00

          +

          Uygulamalar: Cuma 15:00-17:00

          + + +
          Akademik TakvimTeorik Ders İçeriğiUygulama
          +
          Dersin Başarı Kriteri :
          +

          Ara sınav : %40 Yarı yıl Sonu sınavı : %60

          +
          Kaynaklar :
          +
            +
          1. Prof.Dr. Neyran ORHUNBİLGE’nin “Regresyon ve Zaman Serileri Kitapları
          2. +
          3. Bu konuları içeren tüm istatistik analiz kitapları.
          4. +
          5. Veri Tabanları:İSO,DPT,İTO, +TUİK, +TCMB, +İMKB, +World Bank, +Eurostat, +Gapminder vesaire... +
          +

          R istatistik paket programınıTürkiye'ye yakın olan bir ülkenin server'ından indirebilirsiniz. TAMAMEN FREE BİR SOFTWARE!!! Her türlü istatistik analiz/test yapmak mümkün.

          + + + \ No newline at end of file diff --git a/turkish/dersler/ylisans/ylisans.html b/turkish/dersler/ylisans/ylisans.html new file mode 100644 index 0000000..a1ec18e --- /dev/null +++ b/turkish/dersler/ylisans/ylisans.html @@ -0,0 +1,23 @@ + + + + + + +İÜ Dersler + + + + + +

          Şebnem Er

          +
        • İstanbul Üniversitesi İşletme Fakültesi

        • +

          + +

          + + \ No newline at end of file diff --git a/turkish/index.html b/turkish/index.html new file mode 100644 index 0000000..9ee3a5d --- /dev/null +++ b/turkish/index.html @@ -0,0 +1,60 @@ + + + + + + +Şebnem'in Sayfasına Hoşgeldiniz... + + + + + + +

          Şebnem Er

          +

          +01042008074 +

          +e-mail: sebnemer@istanbul.edu.tr

          +

          +e-mail: er.sebnem@gmail.com

          +

        • +Özgeçmiş +
        • +Dersler +
        • +Araştırma Alanları +
        • +Yayınlar +
        • +İrlanda'daki Deneyimlerim +
        • +Bisiklet Dünyam +

          + + + + + \ No newline at end of file diff --git a/turkish/ireland.html b/turkish/ireland.html new file mode 100644 index 0000000..c2ba387 --- /dev/null +++ b/turkish/ireland.html @@ -0,0 +1,52 @@ + + + + + + +İrlanda 2010... + + + + + + +

          Şebnem Er

          +

          +01042008074 +

          +e-mail: sebnemer@istanbul.edu.tr

          +

        • +Dublin City University +
        • +PostDoc Çalışmalarım +
        • +Irlanda'da Yaşam +
        • +Irlanda'da Kriz +

          + + + \ No newline at end of file diff --git a/turkish/ireland/Eurostat_Graph_employmentFemale1.png b/turkish/ireland/Eurostat_Graph_employmentFemale1.png new file mode 100644 index 0000000..1ab6e6c Binary files /dev/null and b/turkish/ireland/Eurostat_Graph_employmentFemale1.png differ diff --git a/turkish/ireland/Eurostat_Graph_employmentMale1.png b/turkish/ireland/Eurostat_Graph_employmentMale1.png new file mode 100644 index 0000000..9607cb6 Binary files /dev/null and b/turkish/ireland/Eurostat_Graph_employmentMale1.png differ diff --git a/turkish/ireland/Eurostat_Graph_employmentTotal1.png b/turkish/ireland/Eurostat_Graph_employmentTotal1.png new file mode 100644 index 0000000..75c0766 Binary files /dev/null and b/turkish/ireland/Eurostat_Graph_employmentTotal1.png differ diff --git a/turkish/ireland/SebnemerPostDoc.html b/turkish/ireland/SebnemerPostDoc.html new file mode 100644 index 0000000..d2a8c0d --- /dev/null +++ b/turkish/ireland/SebnemerPostDoc.html @@ -0,0 +1,29 @@ + + + + + + +PostDoc Çalışmalarım... + + + + + +

          Zümrelere Göre Örnekleme

          +
          +
          +3 bildirim ve R Programında yazılmış bir paketim var. GA4Stratification. Ufak bir uygulama ve açıklama. +

          + + + \ No newline at end of file diff --git a/turkish/ireland/aklima gelenler.txt b/turkish/ireland/aklima gelenler.txt new file mode 100644 index 0000000..e1f7ae9 --- /dev/null +++ b/turkish/ireland/aklima gelenler.txt @@ -0,0 +1,39 @@ +Ilk gittigim gn kendime ait bir odam vardi. Bilgisayar, internet, telefon hattim, printer ile olan baglantim aninda hazir. Sadece bir rica ve hocanin bildirmesi yetiyor. Kimse stne dsmeyen isleri yapmiyor. + +Su sebili var, isteyen su iebiliyor. Bizim okulda su parasini asistanlarin/akademik personelin topladigini duyduklarinda ok sasirdilar. + +Hocalarin oldugu blme kartla giriliyor, grenciler hocalardan biriyle grsmek isterse kapinin yanindaki telefondan dahili numarayi ariyor ve hocaya ulasiyor. + +Doktora grencileri ve benim gibi postdoc arastirmacilar sadece tezlerini yazip, arastirmalarini yapiyorlar. Her dnem basinda uygulamali dersler iin insan kaynaklari departmani is ilani ikartiyor ve isteyen buraya basvurarak doktora burslarina (yillik 25000 euro kadar) ilave olarak uygulama derslerinden para kazaniyorlar, ya da dersin hocasinin nceden ayarladigi bir doktora grencisi varsa bu kisinin adini insan kaynaklarina bildiriyor ve saatlik ders parasi kisinin hesabina yatiyor. Her ek is para karsiliginda yapiliyor. + +Kagitlarin okunmasi zamaninda ise dersin hocasi kagitlarini kendi okuyor ya da yardim alacaksa yine nceden insan kaynaklarina destek istedigini ve ka kisi ile alisacagini bildiriyor. Her bir kagit 5euro karsiliginda okunuyor. Bu isi yapmak iin eger hoca nceden gerekli baglantilari kurmadiysa kagit basina 5 euroyu kendi cebinden veriyor. + +niversite apinda isleyen CORE denen bir sistem var. Bu sistem akademik kadronun tm kongre vs. masraflarinin karsilanmasi iin destek basvurularini online olarak yaptiklari bir sistem. Ben de basvurdum ve iki kongreye gittim. Ne kadar masrafim olduysa hepsi karsilandi. Ki ben bir personel degildim. Bu ok nemli. + +Herkesin yz glyor, insanlar mutlu. + +Herkes spor salonuna ye ve gle tatilinde herkes hemen ya yzme ya da fitness salonunda. Yzme havuzu yari olimpik, sauna, buhar banyosu, tepidarium ve jakuzisi var. Bunlari kullanmak ye olan herkese sinirsiz. 6 aylik grenci yeligi 150 euro. + +Kampste Spermarket var. + +Yemekhanede tek esit yemek ikmiyor, en az 10 esit yemek var. Ucuz ve lezzetli. Tepside porselen tabakta sunum. + +Ktphane inanilmaz byk, 1200 masa, grencilerin gruplar halinde alisabilecekleri 18 oda, 400 tane internet baglantisi olan bilgisayar bulunuyor. Bu da DCU'nun sayfasindan bir cmle: +Although there are over 250,000 volumes in the library, DCU will continue to grow with the technological information revolution. +Bizde de syle bir uygulama var: + + +Tm alisanlarin ye oldugu email gruplari var. yelik kisilere bildirerek degil, bir linkten istenilen gruplara kayit olma ile gereklesiyor. Ben hem niversitenin hem de fakltenin email gruplarina hemen ye olmustum. Burada dekanlik duyurulari bana gelmiyor. Birilerine bildirmek gerekiyormus. Kime oldugu belli degil. + +Inanilmaz kar yagdi ve niversitenin rektr bu email gruplari araciligiyla tm gelismeleri gnde 5 kez email yollayarak haber verdi. Okul tatil oldu mu olacak mi haberlerini dogrudan rektrden almak baska bir gelismislik gstergesi. Insana ve alisana olan nem ortada. Bu bilgiler ayni zamanda hemen internet sitesinde duyuruluyor. Biz de ise Habertrk vs gibi srekli haber yayinin yapan tv kanallarinda acaba I tatil mi diye aramak zorunda kaliriz. + +Faklte ile ilgili ye olunabilen bir google-calender uygulamasi var. Isteyen bu takvimi kendi gmail takvimlerine entegre ederek tm toplanti vs.'den haberdar olabiliyor. Toplanti haberleri kagitla degil, email yoluyla gnderiliyor. + +Uygulama dersleri grencilerin alistigi saatler olarak grlyor. Dersten nceki gn uygulama sorulari internette hocanin sayfasinda veriliyor, grenciler bu sorulari indiriyor, eger kendi baslarina yapabiliyorlarsa uygulamaya gelmiyorlar, yapamiyorlarsa geliyorlar. Ama yine burada da asistan sorulari zmyor, tamamen yol gsterici rolnde, takildiklari yerlerde grencilere yardim etmekle grevliler. Yani tamamen hands-on bir uygulama. + + + + + + + diff --git a/turkish/ireland/crisisIreland.html b/turkish/ireland/crisisIreland.html new file mode 100644 index 0000000..5545ebd --- /dev/null +++ b/turkish/ireland/crisisIreland.html @@ -0,0 +1 @@ + İrlanda Kriz...

          İrlanda'da Kriz





          \ No newline at end of file diff --git a/turkish/ireland/data/Eurostat_Graph_UnemploymentFemales.png b/turkish/ireland/data/Eurostat_Graph_UnemploymentFemales.png new file mode 100644 index 0000000..a94bc70 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Graph_UnemploymentFemales.png differ diff --git a/turkish/ireland/data/Eurostat_Graph_UnemploymentMales.png b/turkish/ireland/data/Eurostat_Graph_UnemploymentMales.png new file mode 100644 index 0000000..7533339 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Graph_UnemploymentMales.png differ diff --git a/turkish/ireland/data/Eurostat_Graph_UnemploymentTotal.png b/turkish/ireland/data/Eurostat_Graph_UnemploymentTotal.png new file mode 100644 index 0000000..0a2b400 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Graph_UnemploymentTotal.png differ diff --git a/turkish/ireland/data/Eurostat_Graph_employmentFemales.png b/turkish/ireland/data/Eurostat_Graph_employmentFemales.png new file mode 100644 index 0000000..f27c351 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Graph_employmentFemales.png differ diff --git a/turkish/ireland/data/Eurostat_Graph_employmentMales.png b/turkish/ireland/data/Eurostat_Graph_employmentMales.png new file mode 100644 index 0000000..e2537b9 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Graph_employmentMales.png differ diff --git a/turkish/ireland/data/Eurostat_Graph_employmentTotal.png b/turkish/ireland/data/Eurostat_Graph_employmentTotal.png new file mode 100644 index 0000000..9a589cf Binary files /dev/null and b/turkish/ireland/data/Eurostat_Graph_employmentTotal.png differ diff --git a/turkish/ireland/data/Eurostat_Table_tps00001FlagDesc.xls b/turkish/ireland/data/Eurostat_Table_tps00001FlagDesc.xls new file mode 100644 index 0000000..acfe403 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tps00001FlagDesc.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc Females.xls b/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc Females.xls new file mode 100644 index 0000000..b1613f0 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc Females.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc Males.xls b/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc Males.xls new file mode 100644 index 0000000..35e72a7 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc Males.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc.xls b/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc.xls new file mode 100644 index 0000000..399d70e Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiem010FlagDesc.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc Females.xls b/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc Females.xls new file mode 100644 index 0000000..e9a2f3a Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc Females.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc Males.xls b/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc Males.xls new file mode 100644 index 0000000..6b1ade2 Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc Males.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc.xls b/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc.xls new file mode 100644 index 0000000..58f8dcf Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiem110FlagDesc.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiir020FlagDesc.xls b/turkish/ireland/data/Eurostat_Table_tsiir020FlagDesc.xls new file mode 100644 index 0000000..8f8a9dc Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiir020FlagDesc.xls differ diff --git a/turkish/ireland/data/Eurostat_Table_tsiir040FlagDesc.xls b/turkish/ireland/data/Eurostat_Table_tsiir040FlagDesc.xls new file mode 100644 index 0000000..026ba4c Binary files /dev/null and b/turkish/ireland/data/Eurostat_Table_tsiir040FlagDesc.xls differ diff --git a/turkish/ireland/data/New Picture (1).bmp b/turkish/ireland/data/New Picture (1).bmp new file mode 100644 index 0000000..1259f58 Binary files /dev/null and b/turkish/ireland/data/New Picture (1).bmp differ diff --git a/turkish/ireland/data/New Picture (2).bmp b/turkish/ireland/data/New Picture (2).bmp new file mode 100644 index 0000000..1259f58 Binary files /dev/null and b/turkish/ireland/data/New Picture (2).bmp differ diff --git a/turkish/ireland/data/New Picture.bmp b/turkish/ireland/data/New Picture.bmp new file mode 100644 index 0000000..1259f58 Binary files /dev/null and b/turkish/ireland/data/New Picture.bmp differ diff --git a/turkish/ireland/data/employment.sav b/turkish/ireland/data/employment.sav new file mode 100644 index 0000000..5695291 Binary files /dev/null and b/turkish/ireland/data/employment.sav differ diff --git a/turkish/ireland/data/popGrowth.png b/turkish/ireland/data/popGrowth.png new file mode 100644 index 0000000..01b6619 Binary files /dev/null and b/turkish/ireland/data/popGrowth.png differ diff --git a/turkish/ireland/data/popGrowth2.png b/turkish/ireland/data/popGrowth2.png new file mode 100644 index 0000000..d802ff1 Binary files /dev/null and b/turkish/ireland/data/popGrowth2.png differ diff --git a/turkish/ireland/data/population.sav b/turkish/ireland/data/population.sav new file mode 100644 index 0000000..3927b31 Binary files /dev/null and b/turkish/ireland/data/population.sav differ diff --git a/turkish/ireland/data/populationMap.png b/turkish/ireland/data/populationMap.png new file mode 100644 index 0000000..6d0eada Binary files /dev/null and b/turkish/ireland/data/populationMap.png differ diff --git a/turkish/ireland/data/populationMap2.png b/turkish/ireland/data/populationMap2.png new file mode 100644 index 0000000..5b29752 Binary files /dev/null and b/turkish/ireland/data/populationMap2.png differ diff --git a/turkish/ireland/data/unemployment.sav b/turkish/ireland/data/unemployment.sav new file mode 100644 index 0000000..3537e2c Binary files /dev/null and b/turkish/ireland/data/unemployment.sav differ diff --git a/turkish/ireland/dcu.html b/turkish/ireland/dcu.html new file mode 100644 index 0000000..e6ff37f --- /dev/null +++ b/turkish/ireland/dcu.html @@ -0,0 +1,136 @@ + + + + + + +DCU... + + + + + +

          Dublin City University

          +
            +

            Lisans Öğrencileri

            +
          • Her öğrencinin üniversiteye kayıt olurken anında elde ettiği öğrenci kimlik kartı var. Bu karta para yükleyerek öğrenciler yazıcıdan çıktı alabiliyorlar. +
            +
          • Öğrencilerin bilgisayarları kullanabilmeleri için bir kullanıcı adı ve şifresi var. Her öğrenciye sistemde 250MB kadar bir alan veriliyor. Öğrenciler böylelikle tüm ödevlerinde ve çalışmalarında bu bilgisayarları kulanıyorlar. +
            +
          • Bilgisayar laboratuvarları sabah akşam öğrencilerin kullanımına açık. +

            Doktora Öğrencileri

            +
          • Doktora öğrencileri ve benim gibi postdoc araştırmacılar sadece tezlerini yazıp, araştırmalarını yapıyorlar. Her dönem başında uygulamalı dersler için insan + +kaynakları departmanı iş ilanı çıkartıyor ve isteyen buraya basvurarak doktora burslarına (yıllık 25000 euro kadar) ilave olarak uygulama derslerinden para + +kazanıyorlar, ya da dersin hocasının önceden ayarladığı bir doktora öğrencisi varsa bu kişinin adını insan kaynaklarına bildiriyor ve saatlik ders parası + +kişinin hesabına yatıyor. Her ek iş para karşılığında yapılıyor. Çünkü araştırma yapmak herşeyden önemli. +
            +
            +
          • Kağıtların okunması zamanında ise dersin hocası kağıtlarını kendi okuyor ya da yardım alacaksa yine önceden insan kaynaklarına destek istediğini ve kaç kişi + +ile çalişacağını bildiriyor. Her bir kağıt 5 euro karşılığında okunuyor. Bu işi yapmak için eğer hoca önceden gerekli bağlantıları kurmadıysa kağıt başına 5 + +euroyu kendi cebinden veriyor. + +

            Kongre Desteği

            +
          • Üniversite çapında işleyen CORE denen bir sistem var. Bu sistem akademik kadronun tüm kongre vs. masraflarının karşılanması için destek başvurularını online + +olarak yaptıkları bir sistem. Ben de başvurdum ve iki kongreye gittim. Ne kadar masrafım olduysa hepsi karşılandı. Ki ben bir personel değildim. Bu çok önemli. + +

            Kütüphane

            +
          • Kütüphane inanılmaz büyük, 1200 masa, öğrencilerin gruplar halinde çalışabilecekleri 18 oda, 400 tane internet bağlantısı olan bilgisayar var. Kütüphaneye giriş çıkış ögrenci kartlarıyla. Kitap ödünç almak da aynı şekilde. Ben 2001'de İTÜ'den mezun olurken bizde bu sistem vardı: Yıl 2001. İÜ'de halen yok!.. : Yıl 2011. Bu da + +DCU'nun sayfasından bir cümle: +Although there are over 250,000 volumes in the library, DCU will continue to grow with the technological information revolution. +Bizde de şöyle bir uygulama var, geçen hafta çektim: + + + + + +
            0104200807401042008074
            +
            +
            +Kütüphane cumartesi de açık. Hafta içi ptesi-perşembe 10'a kadar, cuma 9'a kadar açık (Akşam). Bu saatler dışında kitap geri vermek istenirse kütüphane dışından kitapların atıldığı bir bölme var. +
            +DCU Library +Kitap rezerve, uzatma vs. işlemleri buradan yapılıyor. Aradığınız bir kitaba ulaşmak mümkün. Ne zaman döneceğini öğrenmek mümkün. + +

            Spor İmkanları

            +
          • Herkes spor salonuna üye ve öğle tatilinde herkes hemen ya yüzme ya da fitness salonunda. Yüzme havuzu yarı olimpik, sauna, buhar banyosu, tepidarium ve + +jakuzisi var. Bunları kullanmak üye olan herkese sınırsız. 6 aylık öğrenci üyeliği 150 euro. Engellilerin, çocukların, büyüklerin katıldıkları yüzme dersleri var. Karma yüzme, herhangi bir problem olmuyor. Aksam 10'a kadar açık. + +

            Sosyal İmkanlar

            +
          • Kampüste Süpermarket var. Bildiğiniz süpermarket + öğlen/sabah yemek veren bir süpermarket. +
            +
            +
          • +Yemekhanede tek çeşit yemek çıkmıyor, yaklaşık 10 çeşit yemek var. Ucuz ve lezzetli. Tepside porselen tabakta sunum. +
            +
            +
          • The HUB denilen öğrencilerin sosyalleştiği bir yerleri var. Büyük bir kitapçı ve öğrenci radyosu, bilardo vs. +
            +
            + +
          • The Helix. +
            +
            +
          • Veee bir de kocamaan bir park var, yemyeşil, herkes yürüyüşte, halka açık ama üniversiteye bağlı. Öyle kimlik vs kontrolü zaten yok. İsteyen üniversiteye girip çıkabiliyor. + +

            Çalışanlar ve Akademik Yaşam

            +
          • Tüm çalışanların üye olduğu email grupları var. üyelik kişilere bildirerek değil, bir linkten istenilen gruplara kayıt olma ile gerçekleşiyor. Ben hem + +üniversitenin hem de fakültenin email gruplarına hemen üye olmuştum. İÜ İşletme'de 10 yıldır asistanım, dekanlık duyuruları bana gelmiyor. Birilerine bildirmek gerekiyormuş. Kime + +olduğu belli değil. +
            +
            + +
          • İnanılmaz kar yağdı ve üniversitenin rektörü bu email grupları aracılığıyla tüm gelişmeleri günde 5 kez email yollayarak haber verdi: +

            +Okul tatil oldu mu olacak + +mı haberlerini doğrudan rektörden almak başka bir gelişmişlik göstergesi. İnsana ve çalışana olan önem ortada. Bu bilgiler aynı zamanda hemen internet + +sitesinde duyuruluyor. Bizde ise sürekli haber yayını yapan tv kanallarında acaba İÜ tatil mi diye aramak zorunda kalırız. +
            +
            +
          • Fakülte ile ilgili üye olunabilen bir google-calendar uygulaması var. İsteyen bu takvimi kendi gmail takvimlerine entegre ederek tüm toplantı vs.'den haberdar + +olabiliyor. Toplantı haberleri kağıtla değil, email yoluyla gönderiliyor. Diğer etkinliklerden haberdar olmamak elde değil. Hem üniversitenin sayfasında takvim var hem de email yoluyla tüm etkinlikler bildiriliyor. +
            +
            +
          • Uygulama dersleri öğrencilerin çalıştığı saatler olarak görülüyor. Dersten önceki gün uygulama soruları internette hocanın sayfasında veriliyor, öğrenciler bu + +soruları indiriyor, eğer kendi başlarına yapabiliyorlarsa uygulamaya gelmiyorlar, yapamıyorlarsa geliyorlar. Ama yine burada da asistan soruları çözmüyor, + +tamamen yol gösterici rolünde, takıldıkları yerlerde öğrencilere yardım etmekle görevliler. Yani tamamen hands-on bir uygulama. +
            +
            +
          • Hocaların olduğu bölüme kartla giriliyor, öğrenciler hocalardan biriyle görüşmek isterse kapının yanındaki telefondan dahili numarayı arıyor ve hocaya + +ulaşıyor. +
            +
            +Herkesin yüzü gülüyor, insanlar mutlu. Nasıl olmasınlar! +
            +
            +
          + + + \ No newline at end of file diff --git a/turkish/ireland/hurling.wmv b/turkish/ireland/hurling.wmv new file mode 100644 index 0000000..fb492c7 Binary files /dev/null and b/turkish/ireland/hurling.wmv differ diff --git a/turkish/ireland/lifeIreland.html b/turkish/ireland/lifeIreland.html new file mode 100644 index 0000000..442cfeb --- /dev/null +++ b/turkish/ireland/lifeIreland.html @@ -0,0 +1,67 @@ + + + + + + +İrlanda'da Yaşam... + + + + + +

          İrlanda'da Yaşam

          +
          +
          +Oldukça pahalı, ama oldukça kolay. Çok düzenli ve her yönüyle insana değer verilen bir ülke. +

          +
            +

            Demografik Özellikler

            +
          • AB üyeliği: 1 Ocak 1973 +
          • Başkent: Dublin +
          • Nüfus: 4 467 854 kişi (2010-İrlanda Cumhuriyeti) ve kilometre kareye (70273) 63 kişi düşüyor. +
          • Türkiye nüfusu 77 milyon civarında ve kilometre kareye (783562) 98 kişi düşüyor. +
          • İstanbul nüfusu 14 milyon (!!!?) civarında ve kilometre kareye (5343) 2600 kişi düşüyor!!! +

            +

            Kaynak:Eurostat

            +
            +
          • Doğumda yaşam beklentisi (~77yaş (E) – 82 (K)) +
          • Doğurganlık oranı (2 çocuk/kadın) +
          • Araştırma Geliştirme’ye ayrılan harcama payı Türkiye’nin 2 katı (GDP’ye oranı %1.45) + +

            Teknolojik Özellikler

            +
          • Evde internet erişimi olan hanehalklarının yüzdesi +
          • İrlanda (%63-67-72 (2008-2009-2010)) +
          • Türkiye (%25-30-42 (2008-2009-2010)) +

            İstihdam Genel

            +

            +

            Kaynak:Eurostat

            +

            İstihdam Erkek

            +

            +

            Kaynak:Eurostat

            +

            İstihdam Kadın

            +

            +

            Kaynak:Eurostat

            +
          +

          Yaşamda zorlukları olanlar da unutulmamış

          +

          Kaldırımların hepsinde bebek arabası, tekerlekli sandalye yürütmek için meyil var.

          +

          +

          Spor

          +

          Titanik'in en son uğradığı liman - İrlanda Göçleri

          + + + \ No newline at end of file diff --git a/turkish/ireland/photos/20100516Derry/IMGP2447.JPG b/turkish/ireland/photos/20100516Derry/IMGP2447.JPG new file mode 100644 index 0000000..43623e7 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2447.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2448.JPG b/turkish/ireland/photos/20100516Derry/IMGP2448.JPG new file mode 100644 index 0000000..f76fe29 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2448.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2449.JPG b/turkish/ireland/photos/20100516Derry/IMGP2449.JPG new file mode 100644 index 0000000..d7e96a4 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2449.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2450.JPG b/turkish/ireland/photos/20100516Derry/IMGP2450.JPG new file mode 100644 index 0000000..2f09fe6 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2450.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2451.JPG b/turkish/ireland/photos/20100516Derry/IMGP2451.JPG new file mode 100644 index 0000000..b75344d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2451.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2452.JPG b/turkish/ireland/photos/20100516Derry/IMGP2452.JPG new file mode 100644 index 0000000..0b899ea Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2452.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2453 (1).JPG b/turkish/ireland/photos/20100516Derry/IMGP2453 (1).JPG new file mode 100644 index 0000000..81cee8e Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2453 (1).JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2453.JPG b/turkish/ireland/photos/20100516Derry/IMGP2453.JPG new file mode 100644 index 0000000..81cee8e Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2453.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2454 (1).JPG b/turkish/ireland/photos/20100516Derry/IMGP2454 (1).JPG new file mode 100644 index 0000000..7f7f08d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2454 (1).JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2454.JPG b/turkish/ireland/photos/20100516Derry/IMGP2454.JPG new file mode 100644 index 0000000..7f7f08d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2454.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2455.JPG b/turkish/ireland/photos/20100516Derry/IMGP2455.JPG new file mode 100644 index 0000000..98d9c3c Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2455.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2456.JPG b/turkish/ireland/photos/20100516Derry/IMGP2456.JPG new file mode 100644 index 0000000..707974d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2456.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2457.JPG b/turkish/ireland/photos/20100516Derry/IMGP2457.JPG new file mode 100644 index 0000000..f7a9bfd Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2457.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2458.JPG b/turkish/ireland/photos/20100516Derry/IMGP2458.JPG new file mode 100644 index 0000000..e507608 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2458.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2459.JPG b/turkish/ireland/photos/20100516Derry/IMGP2459.JPG new file mode 100644 index 0000000..ce47180 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2459.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2460.JPG b/turkish/ireland/photos/20100516Derry/IMGP2460.JPG new file mode 100644 index 0000000..a0eed2e Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2460.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2461.JPG b/turkish/ireland/photos/20100516Derry/IMGP2461.JPG new file mode 100644 index 0000000..d1b4d65 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2461.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2462.JPG b/turkish/ireland/photos/20100516Derry/IMGP2462.JPG new file mode 100644 index 0000000..8dcbe9e Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2462.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2463.JPG b/turkish/ireland/photos/20100516Derry/IMGP2463.JPG new file mode 100644 index 0000000..9e187d6 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2463.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2464.JPG b/turkish/ireland/photos/20100516Derry/IMGP2464.JPG new file mode 100644 index 0000000..bd91c27 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2464.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2465.JPG b/turkish/ireland/photos/20100516Derry/IMGP2465.JPG new file mode 100644 index 0000000..ee437b2 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2465.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2466.JPG b/turkish/ireland/photos/20100516Derry/IMGP2466.JPG new file mode 100644 index 0000000..5c614a3 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2466.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2467.JPG b/turkish/ireland/photos/20100516Derry/IMGP2467.JPG new file mode 100644 index 0000000..2d7eb49 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2467.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2468.JPG b/turkish/ireland/photos/20100516Derry/IMGP2468.JPG new file mode 100644 index 0000000..f2104af Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2468.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2469.JPG b/turkish/ireland/photos/20100516Derry/IMGP2469.JPG new file mode 100644 index 0000000..a4c80f5 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2469.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2470.JPG b/turkish/ireland/photos/20100516Derry/IMGP2470.JPG new file mode 100644 index 0000000..b725b96 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2470.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2471 (1).JPG b/turkish/ireland/photos/20100516Derry/IMGP2471 (1).JPG new file mode 100644 index 0000000..481520d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2471 (1).JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2471.JPG b/turkish/ireland/photos/20100516Derry/IMGP2471.JPG new file mode 100644 index 0000000..481520d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2471.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2472.JPG b/turkish/ireland/photos/20100516Derry/IMGP2472.JPG new file mode 100644 index 0000000..ecde361 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2472.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2473.JPG b/turkish/ireland/photos/20100516Derry/IMGP2473.JPG new file mode 100644 index 0000000..2d1fee3 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2473.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2474.JPG b/turkish/ireland/photos/20100516Derry/IMGP2474.JPG new file mode 100644 index 0000000..2d67ecf Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2474.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2475.JPG b/turkish/ireland/photos/20100516Derry/IMGP2475.JPG new file mode 100644 index 0000000..2aa448b Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2475.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2476.JPG b/turkish/ireland/photos/20100516Derry/IMGP2476.JPG new file mode 100644 index 0000000..5fdc618 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2476.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2477.JPG b/turkish/ireland/photos/20100516Derry/IMGP2477.JPG new file mode 100644 index 0000000..8c6ff7b Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2477.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2478.JPG b/turkish/ireland/photos/20100516Derry/IMGP2478.JPG new file mode 100644 index 0000000..fe9ab55 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2478.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2479.JPG b/turkish/ireland/photos/20100516Derry/IMGP2479.JPG new file mode 100644 index 0000000..3cf4b7f Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2479.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2480.JPG b/turkish/ireland/photos/20100516Derry/IMGP2480.JPG new file mode 100644 index 0000000..b4903eb Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2480.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2481.JPG b/turkish/ireland/photos/20100516Derry/IMGP2481.JPG new file mode 100644 index 0000000..152e5f1 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2481.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2482.JPG b/turkish/ireland/photos/20100516Derry/IMGP2482.JPG new file mode 100644 index 0000000..f27a726 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2482.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2483.JPG b/turkish/ireland/photos/20100516Derry/IMGP2483.JPG new file mode 100644 index 0000000..8e2d87d Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2483.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2484 (1).JPG b/turkish/ireland/photos/20100516Derry/IMGP2484 (1).JPG new file mode 100644 index 0000000..8823b88 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2484 (1).JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2484.JPG b/turkish/ireland/photos/20100516Derry/IMGP2484.JPG new file mode 100644 index 0000000..8823b88 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2484.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2485.JPG b/turkish/ireland/photos/20100516Derry/IMGP2485.JPG new file mode 100644 index 0000000..6528636 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2485.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2486.JPG b/turkish/ireland/photos/20100516Derry/IMGP2486.JPG new file mode 100644 index 0000000..ea15479 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2486.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2487.JPG b/turkish/ireland/photos/20100516Derry/IMGP2487.JPG new file mode 100644 index 0000000..5530343 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2487.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2488.JPG b/turkish/ireland/photos/20100516Derry/IMGP2488.JPG new file mode 100644 index 0000000..817b06c Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2488.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2489.JPG b/turkish/ireland/photos/20100516Derry/IMGP2489.JPG new file mode 100644 index 0000000..d9af85a Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2489.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2490.JPG b/turkish/ireland/photos/20100516Derry/IMGP2490.JPG new file mode 100644 index 0000000..d8d588f Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2490.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2491.JPG b/turkish/ireland/photos/20100516Derry/IMGP2491.JPG new file mode 100644 index 0000000..fb725fc Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2491.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2492.JPG b/turkish/ireland/photos/20100516Derry/IMGP2492.JPG new file mode 100644 index 0000000..08f650c Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2492.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2493.JPG b/turkish/ireland/photos/20100516Derry/IMGP2493.JPG new file mode 100644 index 0000000..2e6bcd4 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2493.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2494.JPG b/turkish/ireland/photos/20100516Derry/IMGP2494.JPG new file mode 100644 index 0000000..e50f904 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2494.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2495.JPG b/turkish/ireland/photos/20100516Derry/IMGP2495.JPG new file mode 100644 index 0000000..fa15acf Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2495.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2496.JPG b/turkish/ireland/photos/20100516Derry/IMGP2496.JPG new file mode 100644 index 0000000..878b752 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2496.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2497.JPG b/turkish/ireland/photos/20100516Derry/IMGP2497.JPG new file mode 100644 index 0000000..b42f357 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2497.JPG differ diff --git a/turkish/ireland/photos/20100516Derry/IMGP2498.JPG b/turkish/ireland/photos/20100516Derry/IMGP2498.JPG new file mode 100644 index 0000000..8585dc5 Binary files /dev/null and b/turkish/ireland/photos/20100516Derry/IMGP2498.JPG differ diff --git a/turkish/ireland/photos/BMacCraith2.jpg b/turkish/ireland/photos/BMacCraith2.jpg new file mode 100644 index 0000000..37f3535 Binary files /dev/null and b/turkish/ireland/photos/BMacCraith2.jpg differ diff --git a/turkish/ireland/photos/IMGP2315.JPG b/turkish/ireland/photos/IMGP2315.JPG new file mode 100644 index 0000000..42beb10 Binary files /dev/null and b/turkish/ireland/photos/IMGP2315.JPG differ diff --git a/turkish/ireland/photos/IMGP2360.JPG b/turkish/ireland/photos/IMGP2360.JPG new file mode 100644 index 0000000..36c4b26 Binary files /dev/null and b/turkish/ireland/photos/IMGP2360.JPG differ diff --git a/turkish/ireland/photos/IMG_0171.jpg b/turkish/ireland/photos/IMG_0171.jpg new file mode 100644 index 0000000..dd8c1de Binary files /dev/null and b/turkish/ireland/photos/IMG_0171.jpg differ diff --git a/turkish/ireland/photos/IMG_0195.jpg b/turkish/ireland/photos/IMG_0195.jpg new file mode 100644 index 0000000..a8bf2fd Binary files /dev/null and b/turkish/ireland/photos/IMG_0195.jpg differ diff --git a/turkish/ireland/photos/IMG_1038.jpg b/turkish/ireland/photos/IMG_1038.jpg new file mode 100644 index 0000000..6169e3b Binary files /dev/null and b/turkish/ireland/photos/IMG_1038.jpg differ diff --git a/turkish/ireland/photos/IMG_1236.jpg b/turkish/ireland/photos/IMG_1236.jpg new file mode 100644 index 0000000..84fc871 Binary files /dev/null and b/turkish/ireland/photos/IMG_1236.jpg differ diff --git a/turkish/ireland/photos/IMG_1279.jpg b/turkish/ireland/photos/IMG_1279.jpg new file mode 100644 index 0000000..dd6e9ff Binary files /dev/null and b/turkish/ireland/photos/IMG_1279.jpg differ diff --git a/turkish/ireland/photos/autumn/IMGP3491.JPG b/turkish/ireland/photos/autumn/IMGP3491.JPG new file mode 100644 index 0000000..da6f837 Binary files /dev/null and b/turkish/ireland/photos/autumn/IMGP3491.JPG differ diff --git a/turkish/ireland/photos/autumn/IMGP3557.JPG b/turkish/ireland/photos/autumn/IMGP3557.JPG new file mode 100644 index 0000000..e0d985b Binary files /dev/null and b/turkish/ireland/photos/autumn/IMGP3557.JPG differ diff --git a/turkish/ireland/photos/autumn/IMGP3630.JPG b/turkish/ireland/photos/autumn/IMGP3630.JPG new file mode 100644 index 0000000..d69b8cf Binary files /dev/null and b/turkish/ireland/photos/autumn/IMGP3630.JPG differ diff --git a/turkish/ireland/photos/autumn/IMGP3642.JPG b/turkish/ireland/photos/autumn/IMGP3642.JPG new file mode 100644 index 0000000..4884dd1 Binary files /dev/null and b/turkish/ireland/photos/autumn/IMGP3642.JPG differ diff --git a/turkish/ireland/photos/cove/IMG_0716.jpg b/turkish/ireland/photos/cove/IMG_0716.jpg new file mode 100644 index 0000000..a8242f5 Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0716.jpg differ diff --git a/turkish/ireland/photos/cove/IMG_0717.jpg b/turkish/ireland/photos/cove/IMG_0717.jpg new file mode 100644 index 0000000..9da5392 Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0717.jpg differ diff --git a/turkish/ireland/photos/cove/IMG_0718.jpg b/turkish/ireland/photos/cove/IMG_0718.jpg new file mode 100644 index 0000000..f1c6181 Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0718.jpg differ diff --git a/turkish/ireland/photos/cove/IMG_0719.jpg b/turkish/ireland/photos/cove/IMG_0719.jpg new file mode 100644 index 0000000..1e027c8 Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0719.jpg differ diff --git a/turkish/ireland/photos/cove/IMG_0720.jpg b/turkish/ireland/photos/cove/IMG_0720.jpg new file mode 100644 index 0000000..37d2e1e Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0720.jpg differ diff --git a/turkish/ireland/photos/cove/IMG_0721.jpg b/turkish/ireland/photos/cove/IMG_0721.jpg new file mode 100644 index 0000000..deb3feb Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0721.jpg differ diff --git a/turkish/ireland/photos/cove/IMG_0722.jpg b/turkish/ireland/photos/cove/IMG_0722.jpg new file mode 100644 index 0000000..8eb4a0e Binary files /dev/null and b/turkish/ireland/photos/cove/IMG_0722.jpg differ diff --git a/turkish/ireland/photos/dublin/IMGP3684.JPG b/turkish/ireland/photos/dublin/IMGP3684.JPG new file mode 100644 index 0000000..7681d6a Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3684.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3693.JPG b/turkish/ireland/photos/dublin/IMGP3693.JPG new file mode 100644 index 0000000..651ee32 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3693.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3694.JPG b/turkish/ireland/photos/dublin/IMGP3694.JPG new file mode 100644 index 0000000..5303037 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3694.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3695.JPG b/turkish/ireland/photos/dublin/IMGP3695.JPG new file mode 100644 index 0000000..94ecbe5 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3695.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3696.JPG b/turkish/ireland/photos/dublin/IMGP3696.JPG new file mode 100644 index 0000000..1bd85bc Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3696.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3697.JPG b/turkish/ireland/photos/dublin/IMGP3697.JPG new file mode 100644 index 0000000..e0432f3 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3697.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3698.JPG b/turkish/ireland/photos/dublin/IMGP3698.JPG new file mode 100644 index 0000000..eede3ca Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3698.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3699.JPG b/turkish/ireland/photos/dublin/IMGP3699.JPG new file mode 100644 index 0000000..bc190eb Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3699.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3700.JPG b/turkish/ireland/photos/dublin/IMGP3700.JPG new file mode 100644 index 0000000..fb319fa Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3700.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3701.JPG b/turkish/ireland/photos/dublin/IMGP3701.JPG new file mode 100644 index 0000000..e0fae46 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3701.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3702.JPG b/turkish/ireland/photos/dublin/IMGP3702.JPG new file mode 100644 index 0000000..e0d8dba Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3702.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3703.JPG b/turkish/ireland/photos/dublin/IMGP3703.JPG new file mode 100644 index 0000000..19efaa0 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3703.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3709.JPG b/turkish/ireland/photos/dublin/IMGP3709.JPG new file mode 100644 index 0000000..e7976aa Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3709.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3742.JPG b/turkish/ireland/photos/dublin/IMGP3742.JPG new file mode 100644 index 0000000..323d774 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3742.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3783.JPG b/turkish/ireland/photos/dublin/IMGP3783.JPG new file mode 100644 index 0000000..8a3e700 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3783.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3784.JPG b/turkish/ireland/photos/dublin/IMGP3784.JPG new file mode 100644 index 0000000..98cd294 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3784.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3785.JPG b/turkish/ireland/photos/dublin/IMGP3785.JPG new file mode 100644 index 0000000..535d919 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3785.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3786.JPG b/turkish/ireland/photos/dublin/IMGP3786.JPG new file mode 100644 index 0000000..5e9a8ad Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3786.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3787.JPG b/turkish/ireland/photos/dublin/IMGP3787.JPG new file mode 100644 index 0000000..96d4626 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3787.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3788.JPG b/turkish/ireland/photos/dublin/IMGP3788.JPG new file mode 100644 index 0000000..ce09948 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3788.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3789.JPG b/turkish/ireland/photos/dublin/IMGP3789.JPG new file mode 100644 index 0000000..27f0579 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3789.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3790.JPG b/turkish/ireland/photos/dublin/IMGP3790.JPG new file mode 100644 index 0000000..1a95516 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3790.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3791.JPG b/turkish/ireland/photos/dublin/IMGP3791.JPG new file mode 100644 index 0000000..eba4836 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3791.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3792.JPG b/turkish/ireland/photos/dublin/IMGP3792.JPG new file mode 100644 index 0000000..e062f48 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3792.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3793.JPG b/turkish/ireland/photos/dublin/IMGP3793.JPG new file mode 100644 index 0000000..aad621e Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3793.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3794.JPG b/turkish/ireland/photos/dublin/IMGP3794.JPG new file mode 100644 index 0000000..880bc6f Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3794.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3795.JPG b/turkish/ireland/photos/dublin/IMGP3795.JPG new file mode 100644 index 0000000..9640eae Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3795.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3796.JPG b/turkish/ireland/photos/dublin/IMGP3796.JPG new file mode 100644 index 0000000..e5c26bf Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3796.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3797.JPG b/turkish/ireland/photos/dublin/IMGP3797.JPG new file mode 100644 index 0000000..363946b Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3797.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3798.JPG b/turkish/ireland/photos/dublin/IMGP3798.JPG new file mode 100644 index 0000000..2c8116a Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3798.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3799.JPG b/turkish/ireland/photos/dublin/IMGP3799.JPG new file mode 100644 index 0000000..7c6049f Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3799.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3800.JPG b/turkish/ireland/photos/dublin/IMGP3800.JPG new file mode 100644 index 0000000..08fcad5 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3800.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3801.JPG b/turkish/ireland/photos/dublin/IMGP3801.JPG new file mode 100644 index 0000000..33e63f7 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3801.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3802.JPG b/turkish/ireland/photos/dublin/IMGP3802.JPG new file mode 100644 index 0000000..bcafbb7 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3802.JPG differ diff --git a/turkish/ireland/photos/dublin/IMGP3803.JPG b/turkish/ireland/photos/dublin/IMGP3803.JPG new file mode 100644 index 0000000..f390978 Binary files /dev/null and b/turkish/ireland/photos/dublin/IMGP3803.JPG differ diff --git a/turkish/ireland/photos/hiking/110517Walking_Man__150x150__Wide.jpg b/turkish/ireland/photos/hiking/110517Walking_Man__150x150__Wide.jpg new file mode 100644 index 0000000..4af8f7e Binary files /dev/null and b/turkish/ireland/photos/hiking/110517Walking_Man__150x150__Wide.jpg differ diff --git a/turkish/ireland/photos/hiking/DSC_0152.JPG b/turkish/ireland/photos/hiking/DSC_0152.JPG new file mode 100644 index 0000000..25fb98c Binary files /dev/null and b/turkish/ireland/photos/hiking/DSC_0152.JPG differ diff --git a/turkish/ireland/photos/hiking/DSC_0170.JPG b/turkish/ireland/photos/hiking/DSC_0170.JPG new file mode 100644 index 0000000..ddd0da9 Binary files /dev/null and b/turkish/ireland/photos/hiking/DSC_0170.JPG differ diff --git a/turkish/ireland/photos/hiking/DSC_0276.JPG b/turkish/ireland/photos/hiking/DSC_0276.JPG new file mode 100644 index 0000000..9170efc Binary files /dev/null and b/turkish/ireland/photos/hiking/DSC_0276.JPG differ diff --git a/turkish/ireland/photos/hiking/IMGP3874.JPG b/turkish/ireland/photos/hiking/IMGP3874.JPG new file mode 100644 index 0000000..2b9341f Binary files /dev/null and b/turkish/ireland/photos/hiking/IMGP3874.JPG differ diff --git a/turkish/ireland/photos/hiking/IMG_1412.jpg b/turkish/ireland/photos/hiking/IMG_1412.jpg new file mode 100644 index 0000000..901aba8 Binary files /dev/null and b/turkish/ireland/photos/hiking/IMG_1412.jpg differ diff --git a/turkish/ireland/photos/kilkenny/IMGP2709.JPG b/turkish/ireland/photos/kilkenny/IMGP2709.JPG new file mode 100644 index 0000000..899579d Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMGP2709.JPG differ diff --git a/turkish/ireland/photos/kilkenny/IMGP2710.JPG b/turkish/ireland/photos/kilkenny/IMGP2710.JPG new file mode 100644 index 0000000..a21d152 Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMGP2710.JPG differ diff --git a/turkish/ireland/photos/kilkenny/IMGP2718.JPG b/turkish/ireland/photos/kilkenny/IMGP2718.JPG new file mode 100644 index 0000000..318b516 Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMGP2718.JPG differ diff --git a/turkish/ireland/photos/kilkenny/IMGP2720.JPG b/turkish/ireland/photos/kilkenny/IMGP2720.JPG new file mode 100644 index 0000000..81621e5 Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMGP2720.JPG differ diff --git a/turkish/ireland/photos/kilkenny/IMGP2721.JPG b/turkish/ireland/photos/kilkenny/IMGP2721.JPG new file mode 100644 index 0000000..ef5fb61 Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMGP2721.JPG differ diff --git a/turkish/ireland/photos/kilkenny/IMGP2762.JPG b/turkish/ireland/photos/kilkenny/IMGP2762.JPG new file mode 100644 index 0000000..ff56690 Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMGP2762.JPG differ diff --git a/turkish/ireland/photos/kilkenny/IMG_0758.jpg b/turkish/ireland/photos/kilkenny/IMG_0758.jpg new file mode 100644 index 0000000..07f7b46 Binary files /dev/null and b/turkish/ireland/photos/kilkenny/IMG_0758.jpg differ diff --git a/turkish/ireland/photos/kutuphane1.JPG b/turkish/ireland/photos/kutuphane1.JPG new file mode 100644 index 0000000..8faa51c Binary files /dev/null and b/turkish/ireland/photos/kutuphane1.JPG differ diff --git a/turkish/ireland/photos/kutuphane2.JPG b/turkish/ireland/photos/kutuphane2.JPG new file mode 100644 index 0000000..bc347b6 Binary files /dev/null and b/turkish/ireland/photos/kutuphane2.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2366.JPG b/turkish/ireland/photos/north/IMGP2366.JPG new file mode 100644 index 0000000..f5885b1 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2366.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2367.JPG b/turkish/ireland/photos/north/IMGP2367.JPG new file mode 100644 index 0000000..2dce66f Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2367.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2368.JPG b/turkish/ireland/photos/north/IMGP2368.JPG new file mode 100644 index 0000000..149ec5c Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2368.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2369.JPG b/turkish/ireland/photos/north/IMGP2369.JPG new file mode 100644 index 0000000..d440c16 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2369.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2370.JPG b/turkish/ireland/photos/north/IMGP2370.JPG new file mode 100644 index 0000000..8c8f01a Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2370.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2371.JPG b/turkish/ireland/photos/north/IMGP2371.JPG new file mode 100644 index 0000000..407bd11 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2371.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2372.JPG b/turkish/ireland/photos/north/IMGP2372.JPG new file mode 100644 index 0000000..0b2b042 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2372.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2373.JPG b/turkish/ireland/photos/north/IMGP2373.JPG new file mode 100644 index 0000000..0288ee0 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2373.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2374.JPG b/turkish/ireland/photos/north/IMGP2374.JPG new file mode 100644 index 0000000..80be4db Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2374.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2375.JPG b/turkish/ireland/photos/north/IMGP2375.JPG new file mode 100644 index 0000000..3a751ab Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2375.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2376.JPG b/turkish/ireland/photos/north/IMGP2376.JPG new file mode 100644 index 0000000..005ada7 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2376.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2377.JPG b/turkish/ireland/photos/north/IMGP2377.JPG new file mode 100644 index 0000000..7a7e89d Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2377.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2378.JPG b/turkish/ireland/photos/north/IMGP2378.JPG new file mode 100644 index 0000000..8e33a1e Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2378.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2379.JPG b/turkish/ireland/photos/north/IMGP2379.JPG new file mode 100644 index 0000000..777b87c Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2379.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2380.JPG b/turkish/ireland/photos/north/IMGP2380.JPG new file mode 100644 index 0000000..3e1ffe0 Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2380.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2381.JPG b/turkish/ireland/photos/north/IMGP2381.JPG new file mode 100644 index 0000000..91fbc4b Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2381.JPG differ diff --git a/turkish/ireland/photos/north/IMGP2384.JPG b/turkish/ireland/photos/north/IMGP2384.JPG new file mode 100644 index 0000000..fa68cbe Binary files /dev/null and b/turkish/ireland/photos/north/IMGP2384.JPG differ diff --git a/turkish/ireland/photos/north/IMG_0268.jpg b/turkish/ireland/photos/north/IMG_0268.jpg new file mode 100644 index 0000000..acd7015 Binary files /dev/null and b/turkish/ireland/photos/north/IMG_0268.jpg differ diff --git a/turkish/ireland/photos/snow/IMGP3996.JPG b/turkish/ireland/photos/snow/IMGP3996.JPG new file mode 100644 index 0000000..0d6f887 Binary files /dev/null and b/turkish/ireland/photos/snow/IMGP3996.JPG differ diff --git a/turkish/ireland/photos/snow/IMGP4005.JPG b/turkish/ireland/photos/snow/IMGP4005.JPG new file mode 100644 index 0000000..da8c96a Binary files /dev/null and b/turkish/ireland/photos/snow/IMGP4005.JPG differ diff --git a/turkish/ireland/photos/snow/IMGP4148.JPG b/turkish/ireland/photos/snow/IMGP4148.JPG new file mode 100644 index 0000000..121d852 Binary files /dev/null and b/turkish/ireland/photos/snow/IMGP4148.JPG differ diff --git a/turkish/ireland/photos/snow/IMGP4152.JPG b/turkish/ireland/photos/snow/IMGP4152.JPG new file mode 100644 index 0000000..b816dab Binary files /dev/null and b/turkish/ireland/photos/snow/IMGP4152.JPG differ diff --git a/turkish/ireland/photos/snow/IMGP4181.JPG b/turkish/ireland/photos/snow/IMGP4181.JPG new file mode 100644 index 0000000..69ade91 Binary files /dev/null and b/turkish/ireland/photos/snow/IMGP4181.JPG differ diff --git a/turkish/ireland/photos/west/DSC_0133.JPG b/turkish/ireland/photos/west/DSC_0133.JPG new file mode 100644 index 0000000..baedd9f Binary files /dev/null and b/turkish/ireland/photos/west/DSC_0133.JPG differ diff --git a/turkish/ireland/photos/west/IMGP2934.JPG b/turkish/ireland/photos/west/IMGP2934.JPG new file mode 100644 index 0000000..6b92b23 Binary files /dev/null and b/turkish/ireland/photos/west/IMGP2934.JPG differ diff --git a/turkish/ireland/photos/west/IMGP2935.JPG b/turkish/ireland/photos/west/IMGP2935.JPG new file mode 100644 index 0000000..941ed17 Binary files /dev/null and b/turkish/ireland/photos/west/IMGP2935.JPG differ diff --git a/turkish/ireland/photos/west/IMGP2977.JPG b/turkish/ireland/photos/west/IMGP2977.JPG new file mode 100644 index 0000000..256f558 Binary files /dev/null and b/turkish/ireland/photos/west/IMGP2977.JPG differ diff --git a/turkish/ireland/photos/west/IMGP2978.JPG b/turkish/ireland/photos/west/IMGP2978.JPG new file mode 100644 index 0000000..9ee9a04 Binary files /dev/null and b/turkish/ireland/photos/west/IMGP2978.JPG differ diff --git a/turkish/ireland/photos/west/IMG_0901.jpg b/turkish/ireland/photos/west/IMG_0901.jpg new file mode 100644 index 0000000..adc8cc6 Binary files /dev/null and b/turkish/ireland/photos/west/IMG_0901.jpg differ diff --git a/turkish/ireland/populationMap3.png b/turkish/ireland/populationMap3.png new file mode 100644 index 0000000..c410d9a Binary files /dev/null and b/turkish/ireland/populationMap3.png differ diff --git a/turkish/ireland/spor.html b/turkish/ireland/spor.html new file mode 100644 index 0000000..3263b93 --- /dev/null +++ b/turkish/ireland/spor.html @@ -0,0 +1 @@ + Spor...

          Olmazsa olmaz bir spor dalı: Hurling

          Bu spor parasız yapılan bir spor dalı. Taraftarlar tribünde karışık oturuyorlar, herhangi bir kavga, atışma yok.

          Bisiklet hayatın bir parçası

          Haftasonu herkes hiking/biking/jogging... yapıyor.

          \ No newline at end of file diff --git a/turkish/ireland/titanic.html b/turkish/ireland/titanic.html new file mode 100644 index 0000000..48284ee --- /dev/null +++ b/turkish/ireland/titanic.html @@ -0,0 +1 @@ + Cobh...

          Güneyde bir liman... Cobh

          \ No newline at end of file diff --git a/turkish/publications.html b/turkish/publications.html new file mode 100644 index 0000000..4fa9172 --- /dev/null +++ b/turkish/publications.html @@ -0,0 +1,91 @@ + + + + + + +Şebnem'in Yayınları + + + + + + +

          Şebnem Er

          +

          +

        • Uluslararası Yayınlarım + +
        • Ulusal Yayınlarım + +

          + +
          + + + + +
          Google Scholar + + + +
          +
          + + + + \ No newline at end of file diff --git a/turkish/publications/20100517CASIPresentationFinal.pdf b/turkish/publications/20100517CASIPresentationFinal.pdf new file mode 100644 index 0000000..74e8ad0 Binary files /dev/null and b/turkish/publications/20100517CASIPresentationFinal.pdf differ diff --git a/turkish/publications/AS2010Bled20100921.pdf b/turkish/publications/AS2010Bled20100921.pdf new file mode 100644 index 0000000..44f75fc Binary files /dev/null and b/turkish/publications/AS2010Bled20100921.pdf differ diff --git a/turkish/publications/Demirci_Er_Malatya2007_Sunum.pdf b/turkish/publications/Demirci_Er_Malatya2007_Sunum.pdf new file mode 100644 index 0000000..5c200e0 Binary files /dev/null and b/turkish/publications/Demirci_Er_Malatya2007_Sunum.pdf differ diff --git a/turkish/publications/Demirci_Er_Malatya_2007.pdf b/turkish/publications/Demirci_Er_Malatya_2007.pdf new file mode 100644 index 0000000..d255aab Binary files /dev/null and b/turkish/publications/Demirci_Er_Malatya_2007.pdf differ diff --git a/turkish/publications/Er_2012_IJSA.pdf b/turkish/publications/Er_2012_IJSA.pdf new file mode 100644 index 0000000..564653d Binary files /dev/null and b/turkish/publications/Er_2012_IJSA.pdf differ diff --git a/turkish/publications/Er_Keskinturk_YAEM2005.pdf b/turkish/publications/Er_Keskinturk_YAEM2005.pdf new file mode 100644 index 0000000..19e2665 Binary files /dev/null and b/turkish/publications/Er_Keskinturk_YAEM2005.pdf differ diff --git a/turkish/publications/Er_Keskinturk_YAEM2006.pdf b/turkish/publications/Er_Keskinturk_YAEM2006.pdf new file mode 100644 index 0000000..edbf503 Binary files /dev/null and b/turkish/publications/Er_Keskinturk_YAEM2006.pdf differ diff --git a/turkish/publications/Er_Vuran_2012.pdf b/turkish/publications/Er_Vuran_2012.pdf new file mode 100644 index 0000000..d29fdf1 Binary files /dev/null and b/turkish/publications/Er_Vuran_2012.pdf differ diff --git a/turkish/publications/ISI2011_STS058_Er.pdf b/turkish/publications/ISI2011_STS058_Er.pdf new file mode 100644 index 0000000..7520d60 Binary files /dev/null and b/turkish/publications/ISI2011_STS058_Er.pdf differ diff --git a/turkish/publications/Keskinturk_Er_DCUSeminar2008.pdf b/turkish/publications/Keskinturk_Er_DCUSeminar2008.pdf new file mode 100644 index 0000000..0789b40 Binary files /dev/null and b/turkish/publications/Keskinturk_Er_DCUSeminar2008.pdf differ diff --git a/turkish/publications/Keskinturk_Er_YAEM2007.pdf b/turkish/publications/Keskinturk_Er_YAEM2007.pdf new file mode 100644 index 0000000..94b98a1 Binary files /dev/null and b/turkish/publications/Keskinturk_Er_YAEM2007.pdf differ diff --git a/turkish/publications/ebesdata.dta b/turkish/publications/ebesdata.dta new file mode 100644 index 0000000..1a1fef1 Binary files /dev/null and b/turkish/publications/ebesdata.dta differ diff --git a/turkish/researchareas.html b/turkish/researchareas.html new file mode 100644 index 0000000..fce3574 --- /dev/null +++ b/turkish/researchareas.html @@ -0,0 +1,52 @@ + + + + + + + +Şebnem'in Araştırma Alanları + + + + + + +

          Şebnem Er

          +

          +

        • +İstatistik +
        • +İstatistik Analiz +
        • +Regresyon Analizi +
        • +Zaman Serileri Analizi +
        • +Panel Veri Analizi + +

          + + + \ No newline at end of file diff --git a/turkish/snow.js b/turkish/snow.js new file mode 100644 index 0000000..41dcf0e --- /dev/null +++ b/turkish/snow.js @@ -0,0 +1,211 @@ +// Set the number of snowflakes (more than 30 - 40 not recommended) + +var snowmax=35 + + + +// Set the colors for the snow. Add as many colors as you like + +var snowcolor=new Array("00bfff","#ff7f50","#ff1493","#aaaacc","#ddddFF","#ccccDD") + + + +// Set the fonts, that create the snowflakes. Add as many fonts as you like + +var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS") + + + +// Set the letter that creates your snowflake (recommended:*) + +var snowletter="*" + + + +// Set the speed of sinking (recommended values range from 0.3 to 2) + +var sinkspeed=0.6 + + + +// Set the maximal-size of your snowflaxes + +var snowmaxsize=30 + + + +// Set the minimal-size of your snowflaxes + +var snowminsize=10 + + + +// Set the snowing-zone + +// Set 1 for all-over-snowing, set 2 for left-side-snowing + +// Set 3 for center-snowing, set 4 for right-side-snowing + +var snowingzone=1 + + + +/////////////////////////////////////////////////////////////////////////// + +// CONFIGURATION ENDS HERE + +/////////////////////////////////////////////////////////////////////////// + + + + + +// Do not edit below this line + +var snow=new Array() + +var marginbottom + +var marginright + +var timer + +var i_snow=0 + +var x_mv=new Array(); + +var crds=new Array(); + +var lftrght=new Array(); + +var browserinfos=navigator.userAgent + +var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/) + +var ns6=document.getElementById&&!document.all + +var opera=browserinfos.match(/Opera/) + +var browserok=ie5||ns6||opera + + + +function randommaker(range) { + + rand=Math.floor(range*Math.random()) + + return rand + +} + + + +function initsnow() { + + if (ie5 || opera) { + + marginbottom = document.body.clientHeight + + marginright = document.body.clientWidth + + } + + else if (ns6) { + + marginbottom = window.innerHeight + + marginright = window.innerWidth + + } + + var snowsizerange=snowmaxsize-snowminsize + + for (i=0;i<=snowmax;i++) { + + crds[i] = 0; + + lftrght[i] = Math.random()*15; + + x_mv[i] = 0.03 + Math.random()/10; + + snow[i]=document.getElementById("s"+i) + + snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)] + + snow[i].size=randommaker(snowsizerange)+snowminsize + + snow[i].style.fontSize=snow[i].size + + snow[i].style.color=snowcolor[randommaker(snowcolor.length)] + + snow[i].sink=sinkspeed*snow[i].size/5 + + if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)} + + if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)} + + if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4} + + if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2} + + snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size) + + snow[i].style.left=snow[i].posx + + snow[i].style.top=snow[i].posy + + } + + movesnow() + +} + + + +function movesnow() { + + for (i=0;i<=snowmax;i++) { + + crds[i] += x_mv[i]; + + snow[i].posy+=snow[i].sink + + snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]); + + snow[i].style.top=snow[i].posy + + + + if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){ + + if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)} + + if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)} + + if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4} + + if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2} + + snow[i].posy=0 + + } + + } + + var timer=setTimeout("movesnow()",50) + +} + + + +for (i=0;i<=snowmax;i++) { + + document.write(""+snowletter+"") + +} + +if (browserok) { + + window.onload=initsnow + +}