diff --git a/examples/widgetapp/assets/bootstrap-formhelpers-countries.css b/examples/widgetapp/assets/bootstrap-formhelpers-countries.css new file mode 100644 index 00000000..d46a3f91 --- /dev/null +++ b/examples/widgetapp/assets/bootstrap-formhelpers-countries.css @@ -0,0 +1,1392 @@ +/*! + * Bootstrap Form Helpers + * + * Copyright 2013 Vincent Lamanna, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built by @vincent lamanna. + */ + +.icon-flag-AD, .icon-flag-AE, .icon-flag-AF, .icon-flag-AG, .icon-flag-AI, .icon-flag-AL, .icon-flag-AM, .icon-flag-AN, .icon-flag-AO, .icon-flag-AQ, .icon-flag-AR, .icon-flag-AS, .icon-flag-AT, .icon-flag-AU, .icon-flag-AW, .icon-flag-AX, .icon-flag-AZ, .icon-flag-BA, .icon-flag-BB, .icon-flag-BD, .icon-flag-BE, .icon-flag-BG, .icon-flag-BH, .icon-flag-BI, .icon-flag-BJ, .icon-flag-BL, .icon-flag-BM, .icon-flag-BN, .icon-flag-BO, .icon-flag-BR, .icon-flag-BS, .icon-flag-BT, .icon-flag-BW, .icon-flag-BY, .icon-flag-BZ, .icon-flag-CA, .icon-flag-CD, .icon-flag-CF, .icon-flag-CG, .icon-flag-CH, .icon-flag-CI, .icon-flag-CL, .icon-flag-CM, .icon-flag-CN, .icon-flag-CO, .icon-flag-CR, .icon-flag-CV, .icon-flag-CY, .icon-flag-CZ, .icon-flag-DJ, .icon-flag-DK, .icon-flag-DM, .icon-flag-DO, .icon-flag-DZ, .icon-flag-EC, .icon-flag-EE, .icon-flag-EG, .icon-flag-EH, .icon-flag-ER, .icon-flag-ES, .icon-flag-ET, .icon-flag-EU, .icon-flag-FI, .icon-flag-FJ, .icon-flag-FK, .icon-flag-FM, .icon-flag-FO, .icon-flag-FR, .icon-flag-FX, .icon-flag-GF, .icon-flag-GP, .icon-flag-MQ, .icon-flag-NC, .icon-flag-PF, .icon-flag-PM, .icon-flag-RE, .icon-flag-TF, .icon-flag-WF, .icon-flag-GA, .icon-flag-GB, .icon-flag-GD, .icon-flag-GE, .icon-flag-GG, .icon-flag-GH, .icon-flag-GL, .icon-flag-GM, .icon-flag-GN, .icon-flag-GQ, .icon-flag-GR, .icon-flag-GS, .icon-flag-GT, .icon-flag-GU, .icon-flag-GW, .icon-flag-GY, .icon-flag-HK, .icon-flag-HN, .icon-flag-HR, .icon-flag-HT, .icon-flag-HU, .icon-flag-ID, .icon-flag-IE, .icon-flag-IL, .icon-flag-IM, .icon-flag-IN, .icon-flag-IQ, .icon-flag-IS, .icon-flag-IT, .icon-flag-JE, .icon-flag-JM, .icon-flag-JO, .icon-flag-JP, .icon-flag-KE, .icon-flag-KG, .icon-flag-KH, .icon-flag-KI, .icon-flag-KM, .icon-flag-KN, .icon-flag-KP, .icon-flag-KR, .icon-flag-KV, .icon-flag-KW, .icon-flag-KY, .icon-flag-LA, .icon-flag-LC, .icon-flag-LK, .icon-flag-LR, .icon-flag-LS, .icon-flag-LT, .icon-flag-LU, .icon-flag-LV, .icon-flag-LY, .icon-flag-MA, .icon-flag-ME, .icon-flag-MG, .icon-flag-MH, .icon-flag-ML, .icon-flag-MM, .icon-flag-MP, .icon-flag-MR, .icon-flag-MS, .icon-flag-MT, .icon-flag-MU, .icon-flag-MV, .icon-flag-MW, .icon-flag-MZ, .icon-flag-NA, .icon-flag-NE, .icon-flag-NF, .icon-flag-NG, .icon-flag-NI, .icon-flag-NL, .icon-flag-NO, .icon-flag-NP, .icon-flag-NR, .icon-flag-NZ, .icon-flag-OM, .icon-flag-PA, .icon-flag-PE, .icon-flag-PG, .icon-flag-PH, .icon-flag-PK, .icon-flag-PL, .icon-flag-PN, .icon-flag-PS, .icon-flag-PT, .icon-flag-PW, .icon-flag-PY, .icon-flag-QA, .icon-flag-RS, .icon-flag-RU, .icon-flag-RW, .icon-flag-SA, .icon-flag-SB, .icon-flag-SC, .icon-flag-SD, .icon-flag-SE, .icon-flag-SG, .icon-flag-SH, .icon-flag-SI, .icon-flag-SK, .icon-flag-SM, .icon-flag-SN, .icon-flag-SO, .icon-flag-SR, .icon-flag-SS, .icon-flag-ST, .icon-flag-SV, .icon-flag-SY, .icon-flag-SZ, .icon-flag-TC, .icon-flag-TD, .icon-flag-TG, .icon-flag-TH, .icon-flag-TJ, .icon-flag-TM, .icon-flag-TN, .icon-flag-TP, .icon-flag-TR, .icon-flag-TT, .icon-flag-TV, .icon-flag-TW, .icon-flag-TZ, .icon-flag-UA, .icon-flag-UG, .icon-flag-US, .icon-flag-UY, .icon-flag-UZ, .icon-flag-VC, .icon-flag-VE, .icon-flag-VG, .icon-flag-VI, .icon-flag-VN, .icon-flag-VU, .icon-flag-WS, .icon-flag-YE, .icon-flag-ZA, .icon-flag-ZM, .icon-flag-BF, .icon-flag-CU, .icon-flag-DE, .icon-flag-IR, .icon-flag-KZ, .icon-flag-LB, .icon-flag-LI, .icon-flag-MC, .icon-flag-MD, .icon-flag-MK, .icon-flag-MN, .icon-flag-MO, .icon-flag-MX, .icon-flag-MY, .icon-flag-PR, .icon-flag-RO, .icon-flag-SL, .icon-flag-TO, .icon-flag-VA, .icon-flag-ZW{ + background: url(../img/bootstrap-formhelpers-countries.flags.png) no-repeat; + +} + +.selectbox-options > .icon-flag-AD, .icon-flag-AE, .icon-flag-AF, .icon-flag-AG, .icon-flag-AI, .icon-flag-AL, .icon-flag-AM, .icon-flag-AN, .icon-flag-AO, .icon-flag-AQ, .icon-flag-AR, .icon-flag-AS, .icon-flag-AT, .icon-flag-AU, .icon-flag-AW, .icon-flag-AX, .icon-flag-AZ, .icon-flag-BA, .icon-flag-BB, .icon-flag-BD, .icon-flag-BE, .icon-flag-BG, .icon-flag-BH, .icon-flag-BI, .icon-flag-BJ, .icon-flag-BL, .icon-flag-BM, .icon-flag-BN, .icon-flag-BO, .icon-flag-BR, .icon-flag-BS, .icon-flag-BT, .icon-flag-BW, .icon-flag-BY, .icon-flag-BZ, .icon-flag-CA, .icon-flag-CD, .icon-flag-CF, .icon-flag-CG, .icon-flag-CH, .icon-flag-CI, .icon-flag-CL, .icon-flag-CM, .icon-flag-CN, .icon-flag-CO, .icon-flag-CR, .icon-flag-CV, .icon-flag-CY, .icon-flag-CZ, .icon-flag-DJ, .icon-flag-DK, .icon-flag-DM, .icon-flag-DO, .icon-flag-DZ, .icon-flag-EC, .icon-flag-EE, .icon-flag-EG, .icon-flag-EH, .icon-flag-ER, .icon-flag-ES, .icon-flag-ET, .icon-flag-EU, .icon-flag-FI, .icon-flag-FJ, .icon-flag-FK, .icon-flag-FM, .icon-flag-FO, .icon-flag-FR, .icon-flag-FX, .icon-flag-GF, .icon-flag-GP, .icon-flag-MQ, .icon-flag-NC, .icon-flag-PF, .icon-flag-PM, .icon-flag-RE, .icon-flag-TF, .icon-flag-WF, .icon-flag-GA, .icon-flag-GB, .icon-flag-GD, .icon-flag-GE, .icon-flag-GG, .icon-flag-GH, .icon-flag-GL, .icon-flag-GM, .icon-flag-GN, .icon-flag-GQ, .icon-flag-GR, .icon-flag-GS, .icon-flag-GT, .icon-flag-GU, .icon-flag-GW, .icon-flag-GY, .icon-flag-HK, .icon-flag-HN, .icon-flag-HR, .icon-flag-HT, .icon-flag-HU, .icon-flag-ID, .icon-flag-IE, .icon-flag-IL, .icon-flag-IM, .icon-flag-IN, .icon-flag-IQ, .icon-flag-IS, .icon-flag-IT, .icon-flag-JE, .icon-flag-JM, .icon-flag-JO, .icon-flag-JP, .icon-flag-KE, .icon-flag-KG, .icon-flag-KH, .icon-flag-KI, .icon-flag-KM, .icon-flag-KN, .icon-flag-KP, .icon-flag-KR, .icon-flag-KV, .icon-flag-KW, .icon-flag-KY, .icon-flag-LA, .icon-flag-LC, .icon-flag-LK, .icon-flag-LR, .icon-flag-LS, .icon-flag-LT, .icon-flag-LU, .icon-flag-LV, .icon-flag-LY, .icon-flag-MA, .icon-flag-ME, .icon-flag-MG, .icon-flag-MH, .icon-flag-ML, .icon-flag-MM, .icon-flag-MP, .icon-flag-MR, .icon-flag-MS, .icon-flag-MT, .icon-flag-MU, .icon-flag-MV, .icon-flag-MW, .icon-flag-MZ, .icon-flag-NA, .icon-flag-NE, .icon-flag-NF, .icon-flag-NG, .icon-flag-NI, .icon-flag-NL, .icon-flag-NO, .icon-flag-NP, .icon-flag-NR, .icon-flag-NZ, .icon-flag-OM, .icon-flag-PA, .icon-flag-PE, .icon-flag-PG, .icon-flag-PH, .icon-flag-PK, .icon-flag-PL, .icon-flag-PN, .icon-flag-PS, .icon-flag-PT, .icon-flag-PW, .icon-flag-PY, .icon-flag-QA, .icon-flag-RS, .icon-flag-RU, .icon-flag-RW, .icon-flag-SA, .icon-flag-SB, .icon-flag-SC, .icon-flag-SD, .icon-flag-SE, .icon-flag-SG, .icon-flag-SH, .icon-flag-SI, .icon-flag-SK, .icon-flag-SM, .icon-flag-SN, .icon-flag-SO, .icon-flag-SR, .icon-flag-SS, .icon-flag-ST, .icon-flag-SV, .icon-flag-SY, .icon-flag-SZ, .icon-flag-TC, .icon-flag-TD, .icon-flag-TG, .icon-flag-TH, .icon-flag-TJ, .icon-flag-TM, .icon-flag-TN, .icon-flag-TP, .icon-flag-TR, .icon-flag-TT, .icon-flag-TV, .icon-flag-TW, .icon-flag-TZ, .icon-flag-UA, .icon-flag-UG, .icon-flag-US, .icon-flag-UY, .icon-flag-UZ, .icon-flag-VC, .icon-flag-VE, .icon-flag-VG, .icon-flag-VI, .icon-flag-VN, .icon-flag-VU, .icon-flag-WS, .icon-flag-YE, .icon-flag-ZA, .icon-flag-ZM, .icon-flag-BF, .icon-flag-CU, .icon-flag-DE, .icon-flag-IR, .icon-flag-KZ, .icon-flag-LB, .icon-flag-LI, .icon-flag-MC, .icon-flag-MD, .icon-flag-MK, .icon-flag-MN, .icon-flag-MO, .icon-flag-MX, .icon-flag-MY, .icon-flag-PR, .icon-flag-RO, .icon-flag-SL, .icon-flag-TO, .icon-flag-VA, .icon-flag-ZW, .icon-flag-EUR, .icon-flag-XCD{ + margin-right: 5px; +} + +.icon-flag-AD{ + background-position: -1921px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AE{ + background-position: -1904px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AF{ + background-position: -3689px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AG{ + background-position: -34px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AI{ + background-position: -51px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AL{ + background-position: -68px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AM{ + background-position: -85px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AN{ + background-position: -102px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AO{ + background-position: -119px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AQ{ + background-position: -136px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AR{ + background-position: -153px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AS{ + background-position: -170px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AT{ + background-position: -187px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AU{ + background-position: -204px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AW{ + background-position: -221px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AX{ + background-position: -238px 0; + width: 16px; + height: 16px; +} + +.icon-flag-AZ{ + background-position: -255px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BA{ + background-position: -272px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BB{ + background-position: -289px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BD{ + background-position: -306px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BE{ + background-position: -323px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BG{ + background-position: -340px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BH{ + background-position: -357px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BI{ + background-position: -374px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BJ{ + background-position: -391px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BL{ + background-position: -408px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BM{ + background-position: -425px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BN{ + background-position: -442px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BO{ + background-position: -459px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BR{ + background-position: -476px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BS{ + background-position: -493px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BT{ + background-position: -510px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BW{ + background-position: -527px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BY{ + background-position: -544px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BZ{ + background-position: -561px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CA{ + background-position: -578px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CD{ + background-position: -595px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CF{ + background-position: -612px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CG{ + background-position: -629px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CH{ + background-position: -646px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CI{ + background-position: -663px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CL{ + background-position: -680px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CM{ + background-position: -697px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CN{ + background-position: -714px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CO{ + background-position: -731px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CR{ + background-position: -748px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CV{ + background-position: -765px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CY{ + background-position: -782px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CZ{ + background-position: -799px 0; + width: 16px; + height: 16px; +} + +.icon-flag-DJ{ + background-position: -816px 0; + width: 16px; + height: 16px; +} + +.icon-flag-DK{ + background-position: -833px 0; + width: 16px; + height: 16px; +} + +.icon-flag-DM{ + background-position: -850px 0; + width: 16px; + height: 16px; +} + +.icon-flag-DO{ + background-position: -867px 0; + width: 16px; + height: 16px; +} + +.icon-flag-DZ{ + background-position: -884px 0; + width: 16px; + height: 16px; +} + +.icon-flag-EC{ + background-position: -901px 0; + width: 16px; + height: 16px; +} + +.icon-flag-EE{ + background-position: -918px 0; + width: 16px; + height: 16px; +} + +.icon-flag-EG{ + background-position: -935px 0; + width: 16px; + height: 16px; +} + +.icon-flag-EH{ + background-position: -952px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ER{ + background-position: -969px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ES{ + background-position: -986px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ET{ + background-position: -1003px 0; + width: 16px; + height: 16px; +} + +.icon-flag-EU{ + background-position: -1020px 0; + width: 16px; + height: 16px; +} + +.icon-flag-FI{ + background-position: -1037px 0; + width: 16px; + height: 16px; +} + +.icon-flag-FJ{ + background-position: -1054px 0; + width: 16px; + height: 16px; +} + +.icon-flag-FK{ + background-position: -1071px 0; + width: 16px; + height: 16px; +} + +.icon-flag-FM{ + background-position: -1088px 0; + width: 16px; + height: 16px; +} + +.icon-flag-FO{ + background-position: -1105px 0; + width: 16px; + height: 16px; +} + +.icon-flag-FR, .icon-flag-FX, .icon-flag-GF, .icon-flag-GP, .icon-flag-MQ, .icon-flag-NC, .icon-flag-PF, .icon-flag-PM, .icon-flag-RE, .icon-flag-TF, .icon-flag-WF{ + background-position: -1122px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GA{ + background-position: -1139px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GB{ + background-position: -1156px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GD{ + background-position: -1173px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GE{ + background-position: -1190px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GG{ + background-position: -1207px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GH{ + background-position: -1224px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GL{ + background-position: -1241px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GM{ + background-position: -1258px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GN{ + background-position: -1275px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GQ{ + background-position: -1292px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GR{ + background-position: -1309px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GS{ + background-position: -1326px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GT{ + background-position: -1343px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GU{ + background-position: -1360px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GW{ + background-position: -1377px 0; + width: 16px; + height: 16px; +} + +.icon-flag-GY{ + background-position: -1394px 0; + width: 16px; + height: 16px; +} + +.icon-flag-HK{ + background-position: -1411px 0; + width: 16px; + height: 16px; +} + +.icon-flag-HN{ + background-position: -1428px 0; + width: 16px; + height: 16px; +} + +.icon-flag-HR{ + background-position: -1445px 0; + width: 16px; + height: 16px; +} + +.icon-flag-HT{ + background-position: -1462px 0; + width: 16px; + height: 16px; +} + +.icon-flag-HU{ + background-position: -1479px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ID{ + background-position: -1496px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IE{ + background-position: -1513px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IL{ + background-position: -1530px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IM{ + background-position: -1547px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IN{ + background-position: -1564px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IQ{ + background-position: -1581px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IS{ + background-position: -1598px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IT{ + background-position: -1615px 0; + width: 16px; + height: 16px; +} + +.icon-flag-JE{ + background-position: -1632px 0; + width: 16px; + height: 16px; +} + +.icon-flag-JM{ + background-position: -1649px 0; + width: 16px; + height: 16px; +} + +.icon-flag-JO{ + background-position: -1666px 0; + width: 16px; + height: 16px; +} + +.icon-flag-JP{ + background-position: -1683px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KE{ + background-position: -1700px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KG{ + background-position: -1717px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KH{ + background-position: -1734px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KI{ + background-position: -1751px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KM{ + background-position: -1768px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KN{ + background-position: -1785px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KP{ + background-position: -1802px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KR{ + background-position: -1819px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KV{ + background-position: -1836px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KW{ + background-position: -1853px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KY{ + background-position: -1870px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LA{ + background-position: -1887px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LC{ + background-position: 0 0; + width: 16px; + height: 16px; +} + +.icon-flag-LK{ + background-position: -17px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LR{ + background-position: -1938px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LS{ + background-position: -1955px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LT{ + background-position: -1972px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LU{ + background-position: -1989px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LV{ + background-position: -2006px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LY{ + background-position: -2023px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MA{ + background-position: -2040px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ME{ + background-position: -2057px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MG{ + background-position: -2074px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MH{ + background-position: -2091px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ML{ + background-position: -2108px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MM{ + background-position: -2125px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MP{ + background-position: -2142px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MR{ + background-position: -2159px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MS{ + background-position: -2176px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MT{ + background-position: -2193px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MU{ + background-position: -2210px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MV{ + background-position: -2227px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MW{ + background-position: -2244px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MZ{ + background-position: -2261px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NA{ + background-position: -2278px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NE{ + background-position: -2295px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NF{ + background-position: -2312px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NG{ + background-position: -2329px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NI{ + background-position: -2346px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NL{ + background-position: -2363px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NO{ + background-position: -2380px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NP{ + background-position: -2397px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NR{ + background-position: -2414px 0; + width: 16px; + height: 16px; +} + +.icon-flag-NZ{ + background-position: -2431px 0; + width: 16px; + height: 16px; +} + +.icon-flag-OM{ + background-position: -2448px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PA{ + background-position: -2465px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PE{ + background-position: -2482px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PG{ + background-position: -2499px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PH{ + background-position: -2516px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PK{ + background-position: -2533px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PL{ + background-position: -2550px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PN{ + background-position: -2567px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PS{ + background-position: -2584px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PT{ + background-position: -2601px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PW{ + background-position: -2618px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PY{ + background-position: -2635px 0; + width: 16px; + height: 16px; +} + +.icon-flag-QA{ + background-position: -2652px 0; + width: 16px; + height: 16px; +} + +.icon-flag-RS{ + background-position: -2669px 0; + width: 16px; + height: 16px; +} + +.icon-flag-RU{ + background-position: -2686px 0; + width: 16px; + height: 16px; +} + +.icon-flag-RW{ + background-position: -2703px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SA{ + background-position: -2720px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SB{ + background-position: -2737px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SC{ + background-position: -2754px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SD{ + background-position: -2771px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SE{ + background-position: -2788px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SG{ + background-position: -2805px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SH{ + background-position: -2822px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SI{ + background-position: -2839px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SK{ + background-position: -2856px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SM{ + background-position: -2873px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SN{ + background-position: -2890px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SO{ + background-position: -2907px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SR{ + background-position: -2924px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SS{ + background-position: -2941px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ST{ + background-position: -2958px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SV{ + background-position: -2975px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SY{ + background-position: -2992px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SZ{ + background-position: -3009px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TC{ + background-position: -3026px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TD{ + background-position: -3043px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TG{ + background-position: -3060px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TH{ + background-position: -3077px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TJ{ + background-position: -3094px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TM{ + background-position: -3111px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TN{ + background-position: -3128px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TP{ + background-position: -3145px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TR{ + background-position: -3162px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TT{ + background-position: -3179px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TV{ + background-position: -3196px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TW{ + background-position: -3213px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TZ{ + background-position: -3230px 0; + width: 16px; + height: 16px; +} + +.icon-flag-UA{ + background-position: -3247px 0; + width: 16px; + height: 16px; +} + +.icon-flag-UG{ + background-position: -3264px 0; + width: 16px; + height: 16px; +} + +.icon-flag-US{ + background-position: -3281px 0; + width: 16px; + height: 16px; +} + +.icon-flag-UY{ + background-position: -3298px 0; + width: 16px; + height: 16px; +} + +.icon-flag-UZ{ + background-position: -3315px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VC{ + background-position: -3332px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VE{ + background-position: -3349px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VG{ + background-position: -3366px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VI{ + background-position: -3383px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VN{ + background-position: -3400px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VU{ + background-position: -3417px 0; + width: 16px; + height: 16px; +} + +.icon-flag-WS{ + background-position: -3434px 0; + width: 16px; + height: 16px; +} + +.icon-flag-YE{ + background-position: -3451px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ZA{ + background-position: -3468px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ZM{ + background-position: -3485px 0; + width: 16px; + height: 16px; +} + +.icon-flag-BF{ + background-position: -3502px 0; + width: 16px; + height: 16px; +} + +.icon-flag-CU{ + background-position: -3519px 0; + width: 16px; + height: 16px; +} + +.icon-flag-DE{ + background-position: -3536px 0; + width: 16px; + height: 16px; +} + +.icon-flag-IR{ + background-position: -3553px 0; + width: 16px; + height: 16px; +} + +.icon-flag-KZ{ + background-position: -3570px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LB{ + background-position: -3587px 0; + width: 16px; + height: 16px; +} + +.icon-flag-LI{ + background-position: -3604px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MC{ + background-position: -3621px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MD{ + background-position: -3638px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MK{ + background-position: -3655px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MN{ + background-position: -3672px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MO{ + background-position: -3706px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MX{ + background-position: -3723px 0; + width: 16px; + height: 16px; +} + +.icon-flag-MY{ + background-position: -3740px 0; + width: 16px; + height: 16px; +} + +.icon-flag-PR{ + background-position: -3757px 0; + width: 16px; + height: 16px; +} + +.icon-flag-RO{ + background-position: -3774px 0; + width: 16px; + height: 16px; +} + +.icon-flag-SL{ + background-position: -3791px 0; + width: 16px; + height: 16px; +} + +.icon-flag-TO{ + background-position: -3808px 0; + width: 16px; + height: 16px; +} + +.icon-flag-VA{ + background-position: -3825px 0; + width: 16px; + height: 16px; +} + +.icon-flag-ZW{ + background-position: -3842px 0; + width: 16px; + height: 16px; +} + +.icon-flag-EUR{ + background: url(../img/eu.png) no-repeat; + width: 16px; + height: 16px; +} + +.icon-flag-XCD{ + background: url(../img/xcd.png) no-repeat; + width: 16px; + height: 16px; +} \ No newline at end of file diff --git a/examples/widgetapp/assets/bootstrap-formhelpers.css b/examples/widgetapp/assets/bootstrap-formhelpers.css new file mode 100644 index 00000000..40d12a1c --- /dev/null +++ b/examples/widgetapp/assets/bootstrap-formhelpers.css @@ -0,0 +1,330 @@ +/*! + * Bootstrap Form Helpers + * + * Copyright 2012 Vincent Lamanna, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built by @vincent lamanna. + */ + +.bfh-selectbox { + height: 30px; + position: relative; + display: inline-block; +} + +.bfh-selectbox-toggle { + *margin-bottom: -3px; +} + +.bfh-selectbox-toggle:active, +.open .bfh-selectbox-toggle { + outline: 0; +} + +.bfh-selectbox .caret { + margin-top: 8px; + margin-left: 2px; + height: 8px; +} + +.bfh-selectbox > .bfh-selectbox-toggle > .caret { + float: right; +} + +.bfh-selectbox-options { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.bfh-selectbox-options ul { + list-style: none; +} + +.bfh-selectbox-options.pull-right { + right: 0; + left: auto; +} + +.bfh-selectbox-options a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + height: 20px; + color: #333333; + white-space: nowrap; + text-decoration: none; +} + +.bfh-googlefonts .bfh-selectbox-options a { + height: 30px; + text-indent: -9999px; + background-image: url(../img/bootstrap-formhelpers-googlefonts.png); +} + +.bfh-selectbox-options li > a:focus { + color: #ffffff; + text-decoration: none; + background-color: #0088cc; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.bfh-googlefonts .bfh-selectbox-options li > a:focus { + background-image: url(../img/bootstrap-formhelpers-googlefonts.png); + background-repeat: no-repeat; + filter: none; + background-color: transparent; + filter: none; + outline: none; +} + +.bfh-selectbox-options .active > a, +.bfh-selectbox-options .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #0088cc; + background-color: #0081c2; + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.bfh-googlefonts .bfh-selectbox-options .active > a, +.bfh-googlefonts .bfh-selectbox-options .active > a:hover { + background-image: url(../img/bootstrap-formhelpers-googlefonts.png); + background-repeat: no-repeat; + filter: none; + background-color: transparent; + filter: none; +} + +.bfh-selectbox-options .disabled > a, +.bfh-selectbox-options .disabled > a:hover { + color: #999999; +} + +.open { + *z-index: 1000; +} + +.open > .bfh-selectbox-options { + display: block; +} + +.pull-right > .bfh-selectbox-options { + right: 0; + left: auto; +} + +.bfh-selectbox > .bfh-selectbox-toggle { + color: #000; + padding: 4px; + display: inline-block; + text-decoration: none; + background-color: white; + border: 1px solid #CCC; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.bfh-selectbox-options ul { + max-height: 200px; + overflow-x: hidden; + overflow-y: auto; + margin: 5px 0 0 0; + width: 240px; +} + +.bfh-selectbox-filter { + margin: 0 10px; +} + +.bfh-selectbox > .bfh-selectbox-toggle > .bfh-selectbox-option { + display: inline-block; + float: left; + height: 20px; + overflow: hidden; +} + +span.bfh-countries { + line-height: 18px; +} + +.bfh-datepicker-calendar > table.calendar { + width: 376px; + background: #fff; +} + +.bfh-datepicker-calendar > table.calendar .months-header > th { + text-align: center; + font-size: 12px; +} + +.bfh-datepicker-calendar > table.calendar .months-header > th.month > span { + width: 100px; + display: inline-block; +} + +.bfh-datepicker-calendar > table.calendar .months-header > th.year > span { + width: 50px; + display: inline-block; +} + +.bfh-datepicker-calendar > table.calendar .days-header > th { + text-align: center; + font-size: 11px; + line-height: 12px; +} + +.bfh-datepicker-calendar > table.calendar > tbody > tr > td { + text-align: center; + font-size: 11px; + line-height: 12px; +} + +.bfh-datepicker-calendar > table.calendar > tbody > tr > td.today { + background-color: #999; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.bfh-datepicker-calendar > table.calendar > tbody > tr > td.off { + color: #aaa; +} + +.bfh-datepicker { + position: relative; +} + +.bfh-datepicker-toggle { + *margin-bottom: -3px; +} + +.bfh-datepicker-calendar { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; +} + +.bfh-datepicker-calendar.pull-right { + right: 0; + left: auto; +} + +.open > .bfh-datepicker-calendar { + display: block; +} + +.bfh-datepicker-calendar > table > tbody > tr > td:not(.off):hover { + cursor: pointer; + color: #ffffff; + text-decoration: none; + background-color: #0088cc; + background-color: #0081c2; + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.bfh-timepicker-popover > table { + width: 180px; + margin: 0; +} + +.bfh-timepicker-popover > table > tbody > tr > td { + text-align: center; + border: 0; +} + +.bfh-timepicker-popover > table > tbody > tr > td.separator { + line-height: 65px; + font-weight: bold; + font-size: 20px; +} + +.bfh-timepicker-popover > table > tbody > tr > td > input { + margin: 0; + text-align: center; +} + +.bfh-timepicker { + position: relative; +} + +.bfh-timepicker-toggle { + *margin-bottom: -3px; +} + +.bfh-timepicker-popover { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.bfh-timepicker-popover.pull-right { + right: 0; + left: auto; +} + +.open > .bfh-timepicker-popover { + display: block; +} \ No newline at end of file diff --git a/examples/widgetapp/assets/widget.coffee b/examples/widgetapp/assets/widget.coffee index 0ad58f06..383994d4 100644 --- a/examples/widgetapp/assets/widget.coffee +++ b/examples/widgetapp/assets/widget.coffee @@ -553,8 +553,7 @@ class WSF_AUTOCOMPLETE_CONTROL extends WSF_INPUT_CONTROL self.change() class WSF_COUNTRY_CHOOSER_CONTROL extends WSF_INPUT_CONTROL - requirements: ['assets/bootstrap-formhelpers-countries.js', 'assets/bootstrap-formhelpers-countries-en-US.js', 'assets/bootstrap-formhelpers-selectbox.js'] - + requirements: ['assets/bootstrap-formhelpers-countries.js', 'assets/bootstrap-formhelpers-countries-en-US.js', 'assets/bootstrap-formhelpers-selectbox.js', 'assets/bootstrap-formhelpers-countries.css', 'assets/bootstrap-formhelpers.css'] class WSF_DATETIME_PICKER_CONTROL extends WSF_INPUT_CONTROL requirements: ['assets/bootstrap-datetimepicker.css', 'assets/bootstrap-datetimepicker.js'] @@ -563,12 +562,12 @@ class WSF_DATETIME_PICKER_CONTROL extends WSF_INPUT_CONTROL super self = @ console.log @$el - @$el.datetimepicker({ - language : 'en', - pick12HourFormat : false, - startDate : new Date() - }) - + @$el.datetimepicker({ + language : 'en' + pick12HourFormat : false + startDate : new Date() + }) + class WSF_CHECKBOX_CONTROL extends WSF_CONTROL attach_events: ()-> super diff --git a/examples/widgetapp/assets/widget.js b/examples/widgetapp/assets/widget.js index 723694fd..ea48054c 100644 --- a/examples/widgetapp/assets/widget.js +++ b/examples/widgetapp/assets/widget.js @@ -1,1265 +1,1261 @@ // Generated by CoffeeScript 1.6.1 -(function() { - var Mini, WSF_AUTOCOMPLETE_CONTROL, WSF_BUTTON_CONTROL, WSF_CHECKBOX_CONTROL, WSF_CHECKBOX_LIST_CONTROL, WSF_CODEVIEW_CONTROL, WSF_CONTROL, WSF_COUNTRY_CHOOSER_CONTROL, WSF_DATETIME_PICKER_CONTROL, WSF_DROPDOWN_CONTROL, WSF_FILE_CONTROL, WSF_FORM_ELEMENT_CONTROL, WSF_GRID_CONTROL, WSF_HTML_CONTROL, WSF_INPUT_CONTROL, WSF_MAX_VALIDATOR, WSF_MIN_VALIDATOR, WSF_NAVLIST_ITEM_CONTROL, WSF_PAGE_CONTROL, WSF_PAGINATION_CONTROL, WSF_PASSWORD_CONTROL, WSF_PROGRESS_CONTROL, WSF_REGEXP_VALIDATOR, WSF_REPEATER_CONTROL, WSF_SLIDER_CONTROL, WSF_TEXTAREA_CONTROL, WSF_VALIDATOR, build_control, cache, controls, lazy_load, loaded, parseSuggestions, redirect, show_alert, start_modal, start_modal_big, template, tmpl, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; +var Mini, WSF_AUTOCOMPLETE_CONTROL, WSF_BUTTON_CONTROL, WSF_CHECKBOX_CONTROL, WSF_CHECKBOX_LIST_CONTROL, WSF_CODEVIEW_CONTROL, WSF_CONTROL, WSF_COUNTRY_CHOOSER_CONTROL, WSF_DATETIME_PICKER_CONTROL, WSF_DROPDOWN_CONTROL, WSF_FILE_CONTROL, WSF_FORM_ELEMENT_CONTROL, WSF_GRID_CONTROL, WSF_HTML_CONTROL, WSF_INPUT_CONTROL, WSF_MAX_VALIDATOR, WSF_MIN_VALIDATOR, WSF_NAVLIST_ITEM_CONTROL, WSF_PAGE_CONTROL, WSF_PAGINATION_CONTROL, WSF_PASSWORD_CONTROL, WSF_PROGRESS_CONTROL, WSF_REGEXP_VALIDATOR, WSF_REPEATER_CONTROL, WSF_SLIDER_CONTROL, WSF_TEXTAREA_CONTROL, WSF_VALIDATOR, build_control, cache, controls, lazy_load, loaded, parseSuggestions, redirect, show_alert, start_modal, start_modal_big, template, tmpl, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - cache = {}; +cache = {}; - jQuery.cachedAsset = function(url, options) { - var head, onload, script, success, successful, timeoutHandle; - if (/\.css$/.test(url)) { - $("", { - rel: "stylesheet", - type: "text/css", - href: url - }).appendTo("head"); - return { - done: function(fn) { - return fn(); +jQuery.cachedAsset = function(url, options) { + var head, onload, script, success, successful, timeoutHandle; + if (/\.css$/.test(url)) { + $("", { + rel: "stylesheet", + type: "text/css", + href: url + }).appendTo("head"); + return { + done: function(fn) { + return fn(); + } + }; + } else { + success = []; + head = document.head || document.getElementsByTagName('head')[0] || document.documentElement; + script = document.createElement('script'); + script.async = 'async'; + script.src = url; + successful = false; + onload = function(_, aborted) { + var s, _i, _len; + if (aborted == null) { + aborted = false; + } + if (!(aborted || !script.readyState || script.readyState === 'complete')) { + return; + } + clearTimeout(timeoutHandle); + script.onload = script.onreadystatechange = script.onerror = null; + if (head && script.parentNode) { + head.removeChild(script); + } + script = void 0; + if (success && !aborted) { + successful = true; + for (_i = 0, _len = success.length; _i < _len; _i++) { + s = success[_i]; + s(); } - }; - } else { - success = []; - head = document.head || document.getElementsByTagName('head')[0] || document.documentElement; - script = document.createElement('script'); - script.async = 'async'; - script.src = url; - successful = false; - onload = function(_, aborted) { - var s, _i, _len; - if (aborted == null) { - aborted = false; - } - if (!(aborted || !script.readyState || script.readyState === 'complete')) { - return; - } - clearTimeout(timeoutHandle); - script.onload = script.onreadystatechange = script.onerror = null; - if (head && script.parentNode) { - head.removeChild(script); - } - script = void 0; - if (success && !aborted) { - successful = true; - for (_i = 0, _len = success.length; _i < _len; _i++) { - s = success[_i]; - s(); - } - return success = []; - } - }; - script.onload = script.onreadystatechange = onload; - script.onerror = function() { - return onload(null, true); - }; - timeoutHandle = setTimeout(script.onerror, 7500); - head.insertBefore(script, head.firstChild); - return { - done: function(fn) { - if (!successful) { - success.push(fn); - } else { - fn(); - } - } - }; - } - }; - - jQuery.unparam = function(value) { - var i, l, pair, params, pieces; - params = {}; - pieces = value.split("&"); - pair = void 0; - i = void 0; - l = void 0; - i = 0; - l = pieces.length; - while (i < l) { - pair = pieces[i].split("=", 2); - params[decodeURIComponent(pair[0])] = (pair.length === 2 ? decodeURIComponent(pair[1].replace(/\+/g, " ")) : true); - i++; - } - return params; - }; - - template = tmpl = function(str, data) { - var fn; - fn = (!/\W/.test(str) ? cache[str] = cache[str] || tmpl(str) : new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + "with(obj){p.push('" + str.replace(/[\r\t\n]/g, " ").split("{{").join("\t").replace(/((^|}})[^\t]*)'/g, "$1\r").replace(/\t=(.*?)}}/g, "',$1,'").split("\t").join("');").split("}}").join("p.push('").split("\r").join("\\'") + "');}return p.join('');")); - if (data) { - return fn(data); - } else { - return fn; - } - }; - - Mini = { - compile: function(t) { - return { - render: template(t) - }; - } - }; - - parseSuggestions = function(data) { - var a, d; - for (a in data) { - if (a === 'suggestions') { - return data[a]; - } else { - d = parseSuggestions(data[a]); - if (d != null) { - return d; + return success = []; + } + }; + script.onload = script.onreadystatechange = onload; + script.onerror = function() { + return onload(null, true); + }; + timeoutHandle = setTimeout(script.onerror, 7500); + head.insertBefore(script, head.firstChild); + return { + done: function(fn) { + if (!successful) { + success.push(fn); + } else { + fn(); } } - } - return null; - }; + }; + } +}; - loaded = {}; +jQuery.unparam = function(value) { + var i, l, pair, params, pieces; + params = {}; + pieces = value.split("&"); + pair = void 0; + i = void 0; + l = void 0; + i = 0; + l = pieces.length; + while (i < l) { + pair = pieces[i].split("=", 2); + params[decodeURIComponent(pair[0])] = (pair.length === 2 ? decodeURIComponent(pair[1].replace(/\+/g, " ")) : true); + i++; + } + return params; +}; - lazy_load = function(requirements, fn, that) { - if (requirements.length === 0) { - return function() { - var a; - a = arguments; - return fn.apply(that, a); - }; - } - if (that == null) { - that = window; +template = tmpl = function(str, data) { + var fn; + fn = (!/\W/.test(str) ? cache[str] = cache[str] || tmpl(str) : new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + "with(obj){p.push('" + str.replace(/[\r\t\n]/g, " ").split("{{").join("\t").replace(/((^|}})[^\t]*)'/g, "$1\r").replace(/\t=(.*?)}}/g, "',$1,'").split("\t").join("');").split("}}").join("p.push('").split("\r").join("\\'") + "');}return p.join('');")); + if (data) { + return fn(data); + } else { + return fn; + } +}; + +Mini = { + compile: function(t) { + return { + render: template(t) + }; + } +}; + +parseSuggestions = function(data) { + var a, d; + for (a in data) { + if (a === 'suggestions') { + return data[a]; + } else { + d = parseSuggestions(data[a]); + if (d != null) { + return d; + } } + } + return null; +}; + +loaded = {}; + +lazy_load = function(requirements, fn, that) { + if (requirements.length === 0) { return function() { - var a, args, counter, done, r, self, _i, _len; + var a; a = arguments; - if (typeof args === "undefined" || args === null) { - args = []; - } - counter = requirements.length + 1; - self = this; - done = function() { - counter = counter - 1; - if (counter === 0) { - fn.apply(that, a); - } - }; - for (_i = 0, _len = requirements.length; _i < _len; _i++) { - r = requirements[_i]; - if (loaded[r] == null) { - loaded[r] = $.cachedAsset(r); - } - loaded[r].done(done); - } - return done(); + return fn.apply(that, a); }; + } + if (that == null) { + that = window; + } + return function() { + var a, args, counter, done, r, self, _i, _len; + a = arguments; + if (typeof args === "undefined" || args === null) { + args = []; + } + counter = requirements.length + 1; + self = this; + done = function() { + counter = counter - 1; + if (counter === 0) { + fn.apply(that, a); + } + }; + for (_i = 0, _len = requirements.length; _i < _len; _i++) { + r = requirements[_i]; + if (loaded[r] == null) { + loaded[r] = $.cachedAsset(r); + } + loaded[r].done(done); + } + return done(); + }; +}; + +build_control = function(control_name, state, control) { + var $el, type, typeclass; + $el = control.$el.find('[data-name=' + control_name + ']').first(); + type = $el.data('type'); + typeclass = null; + try { + typeclass = eval(type); + } catch (e) { + typeclass = WSF_CONTROL; + } + if ((type != null) && (typeclass != null)) { + return new typeclass(control, $el, control_name, state); + } + return null; +}; + +WSF_VALIDATOR = (function() { + + function WSF_VALIDATOR(parent_control, settings) { + this.parent_control = parent_control; + this.settings = settings; + this.error = this.settings.error; + return; + } + + WSF_VALIDATOR.prototype.validate = function() { + return true; }; - build_control = function(control_name, state, control) { - var $el, type, typeclass; - $el = control.$el.find('[data-name=' + control_name + ']').first(); - type = $el.data('type'); - typeclass = null; - try { - typeclass = eval(type); - } catch (e) { - typeclass = WSF_CONTROL; - } - if ((type != null) && (typeclass != null)) { - return new typeclass(control, $el, control_name, state); - } - return null; + return WSF_VALIDATOR; + +})(); + +WSF_REGEXP_VALIDATOR = (function(_super) { + + __extends(WSF_REGEXP_VALIDATOR, _super); + + function WSF_REGEXP_VALIDATOR() { + WSF_REGEXP_VALIDATOR.__super__.constructor.apply(this, arguments); + this.pattern = new RegExp(this.settings.expression, 'g'); + } + + WSF_REGEXP_VALIDATOR.prototype.validate = function() { + var res, val; + val = this.parent_control.value(); + res = val.match(this.pattern); + return res !== null; }; - WSF_VALIDATOR = (function() { + return WSF_REGEXP_VALIDATOR; - function WSF_VALIDATOR(parent_control, settings) { - this.parent_control = parent_control; - this.settings = settings; - this.error = this.settings.error; - return; - } +})(WSF_VALIDATOR); - WSF_VALIDATOR.prototype.validate = function() { - return true; - }; +WSF_MIN_VALIDATOR = (function(_super) { - return WSF_VALIDATOR; + __extends(WSF_MIN_VALIDATOR, _super); - })(); + function WSF_MIN_VALIDATOR() { + return WSF_MIN_VALIDATOR.__super__.constructor.apply(this, arguments); + } - WSF_REGEXP_VALIDATOR = (function(_super) { + WSF_MIN_VALIDATOR.prototype.validate = function() { + var val; + val = this.parent_control.value(); + return val.length >= this.settings.min; + }; - __extends(WSF_REGEXP_VALIDATOR, _super); + return WSF_MIN_VALIDATOR; - function WSF_REGEXP_VALIDATOR() { - WSF_REGEXP_VALIDATOR.__super__.constructor.apply(this, arguments); - this.pattern = new RegExp(this.settings.expression, 'g'); - } +})(WSF_VALIDATOR); - WSF_REGEXP_VALIDATOR.prototype.validate = function() { - var res, val; - val = this.parent_control.value(); - res = val.match(this.pattern); - return res !== null; - }; +WSF_MAX_VALIDATOR = (function(_super) { - return WSF_REGEXP_VALIDATOR; + __extends(WSF_MAX_VALIDATOR, _super); - })(WSF_VALIDATOR); + function WSF_MAX_VALIDATOR() { + return WSF_MAX_VALIDATOR.__super__.constructor.apply(this, arguments); + } - WSF_MIN_VALIDATOR = (function(_super) { + WSF_MAX_VALIDATOR.prototype.validate = function() { + var val; + val = this.parent_control.value(); + return val.length <= this.settings.max; + }; - __extends(WSF_MIN_VALIDATOR, _super); + return WSF_MAX_VALIDATOR; - function WSF_MIN_VALIDATOR() { - return WSF_MIN_VALIDATOR.__super__.constructor.apply(this, arguments); - } +})(WSF_VALIDATOR); - WSF_MIN_VALIDATOR.prototype.validate = function() { - var val; - val = this.parent_control.value(); - return val.length >= this.settings.min; - }; +WSF_CONTROL = (function() { - return WSF_MIN_VALIDATOR; + WSF_CONTROL.prototype.requirements = []; - })(WSF_VALIDATOR); + function WSF_CONTROL(parent_control, $el, control_name, fullstate) { + this.parent_control = parent_control; + this.$el = $el; + this.control_name = control_name; + this.fullstate = fullstate; + this.state = this.fullstate.state; + this.load_subcontrols(); + this.isolation = "" + this.$el.data('isolation') === "1"; + this.$el.data('control', this); + this.initialize = lazy_load(this.requirements, this.attach_events, this); + return; + } - WSF_MAX_VALIDATOR = (function(_super) { - - __extends(WSF_MAX_VALIDATOR, _super); - - function WSF_MAX_VALIDATOR() { - return WSF_MAX_VALIDATOR.__super__.constructor.apply(this, arguments); - } - - WSF_MAX_VALIDATOR.prototype.validate = function() { - var val; - val = this.parent_control.value(); - return val.length <= this.settings.max; - }; - - return WSF_MAX_VALIDATOR; - - })(WSF_VALIDATOR); - - WSF_CONTROL = (function() { - - WSF_CONTROL.prototype.requirements = []; - - function WSF_CONTROL(parent_control, $el, control_name, fullstate) { - this.parent_control = parent_control; - this.$el = $el; - this.control_name = control_name; - this.fullstate = fullstate; - this.state = this.fullstate.state; - this.load_subcontrols(); - this.isolation = "" + this.$el.data('isolation') === "1"; - this.$el.data('control', this); - this.initialize = lazy_load(this.requirements, this.attach_events, this); - return; - } - - WSF_CONTROL.prototype.load_subcontrols = function() { - var control_name, state; - if (this.fullstate.controls != null) { - this.controls = (function() { - var _ref, _results; - _ref = this.fullstate.controls; - _results = []; - for (control_name in _ref) { - state = _ref[control_name]; - _results.push(build_control(control_name, state, this)); - } - return _results; - }).call(this); - } else { - this.controls = []; - } - }; - - WSF_CONTROL.prototype.attach_events = function() { - var control, _i, _len, _ref; - console.log("Attached " + this.control_name); - _ref = this.controls; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - control = _ref[_i]; - if (control != null) { - control.initialize(); + WSF_CONTROL.prototype.load_subcontrols = function() { + var control_name, state; + if (this.fullstate.controls != null) { + this.controls = (function() { + var _ref, _results; + _ref = this.fullstate.controls; + _results = []; + for (control_name in _ref) { + state = _ref[control_name]; + _results.push(build_control(control_name, state, this)); } + return _results; + }).call(this); + } else { + this.controls = []; + } + }; + + WSF_CONTROL.prototype.attach_events = function() { + var control, _i, _len, _ref; + console.log("Attached " + this.control_name); + _ref = this.controls; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + control = _ref[_i]; + if (control != null) { + control.initialize(); } - }; + } + }; - WSF_CONTROL.prototype.update = function(state) {}; + WSF_CONTROL.prototype.update = function(state) {}; - WSF_CONTROL.prototype.process_actions = function(actions) { - var action, fn, _i, _len; - for (_i = 0, _len = actions.length; _i < _len; _i++) { - action = actions[_i]; - try { - fn = null; - if (this[action.type] != null) { - fn = this[action.type]; - fn.call(this, action); - } else { - fn = eval(action.type); - fn(action); - } - } catch (e) { - console.log("Failed preforming action " + action.type); - } - } - }; - - WSF_CONTROL.prototype.process_update = function(new_states) { - var control, _i, _len, _ref; + WSF_CONTROL.prototype.process_actions = function(actions) { + var action, fn, _i, _len; + for (_i = 0, _len = actions.length; _i < _len; _i++) { + action = actions[_i]; try { - if (new_states.actions != null) { - this.process_actions(new_states.actions); - } - if (new_states[this.control_name] != null) { - this.update(new_states[this.control_name]); - _ref = this.controls; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - control = _ref[_i]; - if (control != null) { - control.process_update(new_states[this.control_name]['controls']); - } - } + fn = null; + if (this[action.type] != null) { + fn = this[action.type]; + fn.call(this, action); + } else { + fn = eval(action.type); + fn(action); } } catch (e) { - return; + console.log("Failed preforming action " + action.type); } - }; - - WSF_CONTROL.prototype.get_context_state = function() { - if ((this.parent_control != null) && !this.isolation) { - return this.parent_control.get_context_state(); - } - return this.wrap(this.control_name, this.fullstate); - }; - - WSF_CONTROL.prototype.get_full_control_name = function() { - var val; - if (this.parent_control != null) { - val = this.parent_control.get_full_control_name(); - if (val !== "") { - val = val + "-"; - } - return val + this.control_name; - } - return this.control_name; - }; - - WSF_CONTROL.prototype.wrap = function(cname, state) { - var ctrs; - ctrs = {}; - ctrs[cname] = state; - state = { - "controls": ctrs - }; - if (this.parent_control != null) { - return this.parent_control.wrap(this.parent_control.control_name, state); - } - return state; - }; - - WSF_CONTROL.prototype.callback_url = function(params) { - if (this.parent_control != null) { - return this.parent_control.callback_url(params); - } - $.extend(params, this.url_params); - return this.url + '?' + $.param(params); - }; - - WSF_CONTROL.prototype.trigger_callback = function(control_name, event, event_parameter) { - return this.run_trigger_callback(this.get_full_control_name(), event, event_parameter); - }; - - WSF_CONTROL.prototype.get_page = function() { - if (this.parent_control != null) { - return this.parent_control.get_page(); - } - return this; - }; - - WSF_CONTROL.prototype.run_trigger_callback = function(control_name, event, event_parameter) { - var self; - if ((this.parent_control != null) && !this.isolation) { - return this.parent_control.run_trigger_callback(control_name, event, event_parameter); - } - self = this; - return $.ajax({ - type: 'POST', - url: this.callback_url({ - control_name: control_name, - event: event, - event_parameter: event_parameter - }), - data: JSON.stringify(this.get_context_state()), - processData: false, - contentType: 'application/json', - cache: false - }).done(function(new_states) { - return self.get_page().process_update(new_states); - }); - }; - - WSF_CONTROL.prototype.on = function(name, callback, context) { - if (this._events == null) { - this._events = {}; - } - if (this._events[name] == null) { - this._events[name] = []; - } - this._events[name].push({ - callback: callback, - context: context - }); - return this; - }; - - WSF_CONTROL.prototype.trigger = function(name) { - var ev, _i, _len, _ref, _ref1; - if (((_ref = this._events) != null ? _ref[name] : void 0) == null) { - return this; - } - _ref1 = this._events[name]; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - ev = _ref1[_i]; - ev.callback.call(ev.context); - } - return this; - }; - - WSF_CONTROL.prototype.remove = function() { - console.log("Removed " + this.control_name); - return this.$el.remove(); - }; - - return WSF_CONTROL; - - })(); - - WSF_PAGE_CONTROL = (function(_super) { - - __extends(WSF_PAGE_CONTROL, _super); - - function WSF_PAGE_CONTROL(fullstate) { - this.fullstate = fullstate; - this.state = this.fullstate.state; - this.parent_control = null; - this.$el = $('[data-name=' + this.state.id + ']'); - this.control_name = this.state.id; - this.url = this.state['url']; - this.url_params = jQuery.unparam(this.state['url_params']); - this.$el.data('control', this); - this.initialize = lazy_load(this.requirements, this.attach_events, this); - this.load_subcontrols(); } + }; - WSF_PAGE_CONTROL.prototype.process_update = function(new_states) { - var control, _i, _len, _ref; - _ref = this.controls; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - control = _ref[_i]; - if (control != null) { - control.process_update(new_states); + WSF_CONTROL.prototype.process_update = function(new_states) { + var control, _i, _len, _ref; + try { + if (new_states.actions != null) { + this.process_actions(new_states.actions); + } + if (new_states[this.control_name] != null) { + this.update(new_states[this.control_name]); + _ref = this.controls; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + control = _ref[_i]; + if (control != null) { + control.process_update(new_states[this.control_name]['controls']); + } } } - }; - - WSF_PAGE_CONTROL.prototype.get_full_control_name = function() { - return ""; - }; - - WSF_PAGE_CONTROL.prototype.wrap = function(cname, state) { - return state; - }; - - WSF_PAGE_CONTROL.prototype.remove = function() { - console.log("Removed " + this.control_name); - return this.$el.remove(); - }; - - return WSF_PAGE_CONTROL; - - })(WSF_CONTROL); - - WSF_SLIDER_CONTROL = (function(_super) { - - __extends(WSF_SLIDER_CONTROL, _super); - - function WSF_SLIDER_CONTROL() { - return WSF_SLIDER_CONTROL.__super__.constructor.apply(this, arguments); + } catch (e) { + return; } + }; - WSF_SLIDER_CONTROL.prototype.requirements = ['/assets/bootstrap.min.js']; + WSF_CONTROL.prototype.get_context_state = function() { + if ((this.parent_control != null) && !this.isolation) { + return this.parent_control.get_context_state(); + } + return this.wrap(this.control_name, this.fullstate); + }; - WSF_SLIDER_CONTROL.prototype.attach_events = function() { - var id; - WSF_SLIDER_CONTROL.__super__.attach_events.apply(this, arguments); - id = "slider" + Math.round(Math.random() * 10000); - this.$el.attr("id", id); - this.$el.find("ol li").attr("data-target", "#" + id); - return this.$el.find(".carousel-control").attr("href", "#" + id); + WSF_CONTROL.prototype.get_full_control_name = function() { + var val; + if (this.parent_control != null) { + val = this.parent_control.get_full_control_name(); + if (val !== "") { + val = val + "-"; + } + return val + this.control_name; + } + return this.control_name; + }; + + WSF_CONTROL.prototype.wrap = function(cname, state) { + var ctrs; + ctrs = {}; + ctrs[cname] = state; + state = { + "controls": ctrs }; - - return WSF_SLIDER_CONTROL; - - })(WSF_CONTROL); - - WSF_DROPDOWN_CONTROL = (function(_super) { - - __extends(WSF_DROPDOWN_CONTROL, _super); - - function WSF_DROPDOWN_CONTROL() { - return WSF_DROPDOWN_CONTROL.__super__.constructor.apply(this, arguments); + if (this.parent_control != null) { + return this.parent_control.wrap(this.parent_control.control_name, state); } + return state; + }; - WSF_DROPDOWN_CONTROL.prototype.requirements = ['/assets/bootstrap.min.js']; - - return WSF_DROPDOWN_CONTROL; - - })(WSF_CONTROL); - - controls = {}; - - WSF_BUTTON_CONTROL = (function(_super) { - - __extends(WSF_BUTTON_CONTROL, _super); - - function WSF_BUTTON_CONTROL() { - return WSF_BUTTON_CONTROL.__super__.constructor.apply(this, arguments); + WSF_CONTROL.prototype.callback_url = function(params) { + if (this.parent_control != null) { + return this.parent_control.callback_url(params); } + $.extend(params, this.url_params); + return this.url + '?' + $.param(params); + }; - WSF_BUTTON_CONTROL.prototype.attach_events = function() { - var self; - WSF_BUTTON_CONTROL.__super__.attach_events.apply(this, arguments); - self = this; - return this.$el.click(function(e) { - e.preventDefault(); - return self.click(); + WSF_CONTROL.prototype.trigger_callback = function(control_name, event, event_parameter) { + return this.run_trigger_callback(this.get_full_control_name(), event, event_parameter); + }; + + WSF_CONTROL.prototype.get_page = function() { + if (this.parent_control != null) { + return this.parent_control.get_page(); + } + return this; + }; + + WSF_CONTROL.prototype.run_trigger_callback = function(control_name, event, event_parameter) { + var self; + if ((this.parent_control != null) && !this.isolation) { + return this.parent_control.run_trigger_callback(control_name, event, event_parameter); + } + self = this; + return $.ajax({ + type: 'POST', + url: this.callback_url({ + control_name: control_name, + event: event, + event_parameter: event_parameter + }), + data: JSON.stringify(this.get_context_state()), + processData: false, + contentType: 'application/json', + cache: false + }).done(function(new_states) { + return self.get_page().process_update(new_states); + }); + }; + + WSF_CONTROL.prototype.on = function(name, callback, context) { + if (this._events == null) { + this._events = {}; + } + if (this._events[name] == null) { + this._events[name] = []; + } + this._events[name].push({ + callback: callback, + context: context + }); + return this; + }; + + WSF_CONTROL.prototype.trigger = function(name) { + var ev, _i, _len, _ref, _ref1; + if (((_ref = this._events) != null ? _ref[name] : void 0) == null) { + return this; + } + _ref1 = this._events[name]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + ev = _ref1[_i]; + ev.callback.call(ev.context); + } + return this; + }; + + WSF_CONTROL.prototype.remove = function() { + console.log("Removed " + this.control_name); + return this.$el.remove(); + }; + + return WSF_CONTROL; + +})(); + +WSF_PAGE_CONTROL = (function(_super) { + + __extends(WSF_PAGE_CONTROL, _super); + + function WSF_PAGE_CONTROL(fullstate) { + this.fullstate = fullstate; + this.state = this.fullstate.state; + this.parent_control = null; + this.$el = $('[data-name=' + this.state.id + ']'); + this.control_name = this.state.id; + this.url = this.state['url']; + this.url_params = jQuery.unparam(this.state['url_params']); + this.$el.data('control', this); + this.initialize = lazy_load(this.requirements, this.attach_events, this); + this.load_subcontrols(); + } + + WSF_PAGE_CONTROL.prototype.process_update = function(new_states) { + var control, _i, _len, _ref; + _ref = this.controls; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + control = _ref[_i]; + if (control != null) { + control.process_update(new_states); + } + } + }; + + WSF_PAGE_CONTROL.prototype.get_full_control_name = function() { + return ""; + }; + + WSF_PAGE_CONTROL.prototype.wrap = function(cname, state) { + return state; + }; + + WSF_PAGE_CONTROL.prototype.remove = function() { + console.log("Removed " + this.control_name); + return this.$el.remove(); + }; + + return WSF_PAGE_CONTROL; + +})(WSF_CONTROL); + +WSF_SLIDER_CONTROL = (function(_super) { + + __extends(WSF_SLIDER_CONTROL, _super); + + function WSF_SLIDER_CONTROL() { + return WSF_SLIDER_CONTROL.__super__.constructor.apply(this, arguments); + } + + WSF_SLIDER_CONTROL.prototype.requirements = ['/assets/bootstrap.min.js']; + + WSF_SLIDER_CONTROL.prototype.attach_events = function() { + var id; + WSF_SLIDER_CONTROL.__super__.attach_events.apply(this, arguments); + id = "slider" + Math.round(Math.random() * 10000); + this.$el.attr("id", id); + this.$el.find("ol li").attr("data-target", "#" + id); + return this.$el.find(".carousel-control").attr("href", "#" + id); + }; + + return WSF_SLIDER_CONTROL; + +})(WSF_CONTROL); + +WSF_DROPDOWN_CONTROL = (function(_super) { + + __extends(WSF_DROPDOWN_CONTROL, _super); + + function WSF_DROPDOWN_CONTROL() { + return WSF_DROPDOWN_CONTROL.__super__.constructor.apply(this, arguments); + } + + WSF_DROPDOWN_CONTROL.prototype.requirements = ['/assets/bootstrap.min.js']; + + return WSF_DROPDOWN_CONTROL; + +})(WSF_CONTROL); + +controls = {}; + +WSF_BUTTON_CONTROL = (function(_super) { + + __extends(WSF_BUTTON_CONTROL, _super); + + function WSF_BUTTON_CONTROL() { + return WSF_BUTTON_CONTROL.__super__.constructor.apply(this, arguments); + } + + WSF_BUTTON_CONTROL.prototype.attach_events = function() { + var self; + WSF_BUTTON_CONTROL.__super__.attach_events.apply(this, arguments); + self = this; + return this.$el.click(function(e) { + e.preventDefault(); + return self.click(); + }); + }; + + WSF_BUTTON_CONTROL.prototype.click = function() { + if (this.state['callback_click']) { + return this.trigger_callback(this.control_name, 'click'); + } + }; + + WSF_BUTTON_CONTROL.prototype.update = function(state) { + if (state.disabled !== void 0) { + this.state['disabled'] = state.disabled; + this.$el.prop('disabled', state.disabled); + } + if (state.text != null) { + this.state['text'] = state.text; + return this.$el.text(state.text); + } + }; + + return WSF_BUTTON_CONTROL; + +})(WSF_CONTROL); + +WSF_INPUT_CONTROL = (function(_super) { + + __extends(WSF_INPUT_CONTROL, _super); + + function WSF_INPUT_CONTROL() { + return WSF_INPUT_CONTROL.__super__.constructor.apply(this, arguments); + } + + WSF_INPUT_CONTROL.prototype.attach_events = function() { + var self; + WSF_INPUT_CONTROL.__super__.attach_events.apply(this, arguments); + self = this; + return this.$el.change(function() { + return self.change(); + }); + }; + + WSF_INPUT_CONTROL.prototype.change = function() { + this.state['text'] = this.$el.val(); + if (this.state['callback_change']) { + this.trigger_callback(this.control_name, 'change'); + } + return this.trigger('change'); + }; + + WSF_INPUT_CONTROL.prototype.value = function() { + return this.$el.val(); + }; + + WSF_INPUT_CONTROL.prototype.update = function(state) { + if (state.disabled !== void 0) { + this.state['disabled'] = state.disabled; + this.$el.prop('disabled', state.disabled); + } + if (state.text != null) { + this.state['text'] = state.text; + return this.$el.val(state.text); + } + }; + + return WSF_INPUT_CONTROL; + +})(WSF_CONTROL); + +WSF_FILE_CONTROL = (function(_super) { + + __extends(WSF_FILE_CONTROL, _super); + + function WSF_FILE_CONTROL() { + WSF_FILE_CONTROL.__super__.constructor.apply(this, arguments); + this.uploading = false; + } + + WSF_FILE_CONTROL.prototype.start_upload = function() { + var action, file, formData; + if (this.$el[0].files.length === 0) { + return; + } + if (this.uploading) { + return; + } + this.uploading = true; + this.$el.hide(); + this.progressbar = $("