code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
Calendar.LANG("pt", "Portuguese", {
fdow: 1, // primeiro dia da semana para esse local; 0 = Domingo, 1 = Segunda, etc.
goToday: "Dia de Hoje",
today: "Hoje",
wk: "sm",
weekend: "0,6", // 0 = Domingo, 1 = Segunda, etc.
AM: "am",
PM: "pm",
mn : [ "Janeiro",
"Fevereiro",
"Março",
"Abril",
"Maio",
"Junho",
"Julho",
"Agosto",
"Setembro",
"Outubro",
"Novembro",
"Dezembro" ],
smn : [ "Jan",
"Fev",
"Mar",
"Abr",
"Mai",
"Jun",
"Jul",
"Ago",
"Set",
"Out",
"Nov",
"Dez" ],
dn : [ "Domingo",
"Segunda",
"Terça",
"Quarta",
"Quinta",
"Sexta",
"Sábado",
"Domingo" ],
sdn : [ "Dom",
"Seg",
"Ter",
"Qua",
"Qui",
"Sex",
"Sab",
"Dom" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/pt.js | JavaScript | asf20 | 1,309 |
Calendar.LANG("cz", "Czech", {
fdow: 1, // first day of week for this locale; 0 = Sunday, 1 = Monday, etc.
goToday: "Ukaž dnešek",
today: "Dnes", // appears in bottom bar
wk: "týd",
weekend: "0,6", // 0 = Sunday, 1 = Monday, etc.
AM: "am",
PM: "pm",
mn : [ "Leden",
"Únor",
"Březen",
"Duben",
"Květen",
"Červen",
"Červenec",
"Srpen",
"Září",
"Říjen",
"Listopad",
"Prosinec" ],
smn : [ "Led",
"Úno",
"Bře",
"Dub",
"Kvě",
"Črn",
"Črc",
"Srp",
"Zář",
"Říj",
"Lis",
"Pro" ],
dn : [ "Neděle",
"Pondělí",
"Úterý",
"Středa",
"Čtvrtek",
"Pátek",
"Sobota",
"Neděle" ],
sdn : [ "Ne",
"Po",
"Út",
"St",
"Čt",
"Pá",
"So",
"Ne" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/cz.js | JavaScript | asf20 | 1,344 |
Calendar.LANG("de", "Deutsch", {
fdow: 1, // first day of week for this locale; 0 = Sunday, 1 = Monday, etc.
goToday : "Heute ausw\u00e4hlen",
today: "Heute", // appears in bottom bar
wk: "wk",
weekend: "0,6", // 0 = Sunday, 1 = Monday, etc.
AM: "am",
PM: "pm",
mn : [ "Januar",
"Februar",
"M\u00e4rz",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember" ],
smn : [ "Jan",
"Feb",
"M\u00e4r",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez" ],
dn : [ "Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag",
"Sonntag" ],
sdn : [ "So",
"Mo",
"Di",
"Mi",
"Do",
"Fr",
"Sa",
"So" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/de.js | JavaScript | asf20 | 1,345 |
Calendar.LANG("jp", "Japanese", {
fdow: 1, // 地元の週の初めの日; 0 = 日曜日, 1 = 月曜日, 等.
goToday: "本日へ",
today: "本日", // ボットンバーに表示
wk: "週",
weekend: "0,6", // 0 = 日曜日, 1 = 月曜日, 等.
AM: "am",
PM: "pm",
mn : [ "1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月" ],
smn : [ "1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月" ],
dn : [ "日曜日",
"月曜日",
"火曜日",
"水曜日",
"木曜日",
"金曜日",
"土曜日",
"日曜日" ],
sdn : [ "日",
"月",
"火",
"水",
"木",
"金",
"土",
"日" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/jp.js | JavaScript | asf20 | 1,353 |
Calendar.LANG("it", "Italiano", {
fdow: 1, // first day of week for this locale; 0 = Sunday, 1 = Monday, etc.
goToday: "Vai a oggi",
today: "Oggi", // appears in bottom bar
wk: "set",
weekend: "0,6", // 0 = Sunday, 1 = Monday, etc.
AM: "am",
PM: "pm",
mn : [ "Gennaio",
"Febbraio",
"Marzo",
"Aprile",
"Maggio",
"Giugno",
"Luglio",
"Agosto",
"Settembre",
"Ottobre",
"Novembre",
"Dicembre" ],
smn : [ "Gen",
"Feb",
"Mar",
"Apr",
"Mag",
"Giu",
"Lug",
"Ago",
"Set",
"Ott",
"Nov",
"Dic" ],
dn : [ "Domenica",
"Lunedì",
"Martedì",
"Mercoledì",
"Giovedi",
"Venerdì",
"Sabato",
"Domenica" ],
sdn : [ "Do",
"Lu",
"Ma",
"Me",
"Gi",
"Ve",
"Sa",
"Do" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/it.js | JavaScript | asf20 | 1,338 |
Calendar.LANG("es", "Español", {
fdow: 1, // first day of week for this locale; 0 = Sunday, 1 = Monday, etc.
goToday: "Ir a Hoy",
today: "Hoy", // appears in bottom bar
wk: "sem",
weekend: "0,6", // 0 = Sunday, 1 = Monday, etc.
AM: "am",
PM: "pm",
mn : [ "Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agosto",
"Septiembre",
"Octubre",
"Noviembre",
"Diciembre" ],
smn : [ "Ene",
"Feb",
"Mar",
"Abr",
"May",
"Jun",
"Jul",
"Ago",
"Sep",
"Oct",
"Nov",
"Dic" ],
dn : [ "Domingo",
"Lunes",
"Martes",
"Miercoles",
"Jueves",
"Viernes",
"Sabado",
"Domingo" ],
sdn : [ "Do",
"Lu",
"Ma",
"Mi",
"Ju",
"Vi",
"Sa",
"Do" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/es.js | JavaScript | asf20 | 1,321 |
// autor: Piotr kwiatkowski
// www: http://pasjonata.net
Calendar.LANG("pl", "Polish", {
fdow: 1, // pierwszy dzień tygodnia; 0 = Niedziela, 1 = Poniedziałek, itd.
goToday: "Idzie Dzisiaj",
today: "Dziś",
wk: "wk",
weekend: "0,6", // 0 = Niedziela, 1 = Poniedziałek, itd.
AM: "am",
PM: "pm",
mn : [ "Styczeń",
"Luty",
"Marzec",
"Kwiecień",
"Maj",
"Czerwiec",
"Lipiec",
"Sierpień",
"Wrzesień",
"Październik",
"Listopad",
"Grudzień" ],
smn : [ "Sty",
"Lut",
"Mar",
"Kwi",
"Maj",
"Cze",
"Lip",
"Sie",
"Wrz",
"Paź",
"Lis",
"Gru" ],
dn : [ "Niedziela",
"Poniedziałek",
"Wtorek",
"Środa",
"Czwartek",
"Piątek",
"Sobota",
"Niedziela" ],
sdn : [ "Ni",
"Po",
"Wt",
"Śr",
"Cz",
"Pi",
"So",
"Ni" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/pl.js | JavaScript | asf20 | 1,397 |
Calendar.LANG("en", "English", {
fdow: 1, // first day of week for this locale; 0 = Sunday, 1 = Monday, etc.
goToday: "Go Today",
today: "Today", // appears in bottom bar
wk: "wk",
weekend: "0,6", // 0 = Sunday, 1 = Monday, etc.
AM: "am",
PM: "pm",
mn : [ "January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December" ],
smn : [ "Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" ],
dn : [ "Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday" ],
sdn : [ "Su",
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
"Su" ]
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/js/lang/en.js | JavaScript | asf20 | 1,321 |
.DynarchCalendar, .DynarchCalendar-focused {
background-color: #d4d0c8;
}
.DynarchCalendar-topBar,
.DynarchCalendar-bottomBar,
.DynarchCalendar-focused .DynarchCalendar-topBar,
.DynarchCalendar-focused .DynarchCalendar-bottomBar {
background-color: #848078;
color: #fff;
}
.DynarchCalendar-title div { color: #fff; }
.DynarchCalendar-dayNames { background-color: #f4f0e8; }
.DynarchCalendar-hover-navBtn div,
.DynarchCalendar-hover-title div,
.DynarchCalendar-hover-bottomBar-today {
border-color: #f4f0e8 #444038 #444038 #f4f0e8;
background-color: #d4d0c8;
color: #000;
}
.DynarchCalendar-menu table td div.DynarchCalendar-hover-navBtn {
border-color: #f4f0e8 #444038 #444038 #f4f0e8;
background-color: #e4e0d8;
color: #000;
}
.DynarchCalendar-pressed-navBtn div,
.DynarchCalendar-pressed-title div,
.DynarchCalendar-pressed-bottomBar-today,
.DynarchCalendar-menu table td div.DynarchCalendar-pressed-navBtn {
border-color: #444038 #f4f0e8 #f4f0e8 #444038;
background-color: #646058;
color: #fff;
}
.DynarchCalendar-hover-date {
border-color: #f4f0e8 #444038 #444038 #f4f0e8;
background-color: #e4e0d8;
}
.DynarchCalendar-day {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.DynarchCalendar-day-disabled {
background: #c4c0b8;
}
.DynarchCalendar-hover-week { background-color: #e4e0d8 !important; }
.DynarchCalendar-day-selected {
background-color: #e4e0d8;
border: 1px solid;
border-color: #444038 #f4f0e8 #f4f0e8 #444038;
margin: 0;
}
.DynarchCalendar-day-today.DynarchCalendar-day-selected { background-color: #e4e0d8; }
.DynarchCalendar-menu {
background-color: #d4d0c8;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/win2k/win2k.css | CSS | asf20 | 1,658 |
/* This is for Gecko-based browsers */
.DynarchCalendar {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.DynarchCalendar-title, .DynarchCalendar-title div {
-moz-border-radius: 0 0 4px 4px;
-webkit-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.DynarchCalendar-topBar {
-moz-border-radius: 4px 4px 0 0;
-webkit-border-radius: 4px;
border-radius: 4px 4px 0 0;
}
.DynarchCalendar-bottomBar {
-moz-border-radius: 0 0 4px 4px;
-webkit-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.DynarchCalendar-bottomBar-today {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.DynarchCalendar-navBtn, .DynarchCalendar-navBtn div {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.DynarchCalendar-menu {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.DynarchCalendar-menu table td div {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.DynarchCalendar-weekNumber {
-moz-border-radius: 4px 0 0 4px;
-webkit-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.DynarchCalendar-day {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.DynarchCalendar-day-disabled {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.DynarchCalendar-tooltipCont {
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 5px;
}
.DynarchCalendar-time-hour, .DynarchCalendar-time-minute {
-moz-border-radius: 3px 0 0 3px;
-webkit-border-radius: 3px;
}
.DynarchCalendar-time-am {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/border-radius.css | CSS | asf20 | 1,699 |
.DynarchCalendar-focused {
background-color: #fff;
}
.DynarchCalendar-topBar {
background: url("brushed-steel.jpg") no-repeat 50% -50px;
}
.DynarchCalendar-bottomBar {
background: url("brushed-steel.jpg") no-repeat 50% -80px;
}
.DynarchCalendar-menu {
background-color: #fed;
}
.DynarchCalendar-hover-title,
.DynarchCalendar-hover-navBtn,
.DynarchCalendar-hover-bottomBar-today,
.DynarchCalendar-menu table td div.DynarchCalendar-hover-navBtn {
background: transparent url("coolbg.png") repeat-x 0 50%;
}
.DynarchCalendar-hover-title div,
.DynarchCalendar-hover-navBtn div { background-color: transparent; }
.DynarchCalendar-pressed-title,
.DynarchCalendar-pressed-navBtn,
.DynarchCalendar-pressed-bottomBar-today,
.DynarchCalendar-menu table td div.DynarchCalendar-pressed-navBtn {
background: #db2 url("coolbg.png") repeat-x 0 50%;
color: #000 !important;
}
.DynarchCalendar-pressed-title div,
.DynarchCalendar-pressed-navBtn div { background-color: transparent; color: #000; }
.DynarchCalendar-hover-week,
.DynarchCalendar-focused .DynarchCalendar-hover-week {
background: transparent url("coolbg.png") repeat-x 0 50%;
}
.DynarchCalendar {
background: url("gold.jpg") no-repeat 50% 30px;
}
.DynarchCalendar-weekNumber {
border-right: 1px solid #f92;
}
.DynarchCalendar-hover-date {
background-image: url("coolbg.png");
background-position: 0 50%;
background-repeat: repeat-x;
border-color: #f92;
}
.DynarchCalendar-day-selected {
background-color: #f92;
color: #000 !important;
background-image: url("coolbg.png");
background-position: 0 50%;
background-repeat: repeat-x;
}
.DynarchCalendar-day-today.DynarchCalendar-day-selected {
background-color: #f92;
color: #00f !important;
}
.DynarchCalendar-tooltipCont,
.DynarchCalendar-focused .DynarchCalendar-tooltipCont {
background: #db2 url("brushed-steel.jpg") no-repeat 50% -100px;
}
.DynarchCalendar-focused .DynarchCalendar-body {
background: url("../shadow-b.png") repeat-x 0 0;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/gold/gold.css | CSS | asf20 | 1,998 |
.DynarchCalendar-focused {
background-color: #fff;
}
.DynarchCalendar-topBar {
background: url("brushed-steel.jpg") no-repeat 50% 0;
}
.DynarchCalendar-bottomBar {
background: url("brushed-steel.jpg") no-repeat 50% 50%;
}
.DynarchCalendar-hover-title,
.DynarchCalendar-hover-navBtn,
.DynarchCalendar-hover-bottomBar-today,
.DynarchCalendar-menu table td div.DynarchCalendar-hover-navBtn {
background: #dde url("coolbg.png") repeat-x 0 50%;
}
.DynarchCalendar-hover-title div,
.DynarchCalendar-hover-navBtn div { background-color: transparent; }
.DynarchCalendar-pressed-title,
.DynarchCalendar-pressed-navBtn,
.DynarchCalendar-pressed-bottomBar-today,
.DynarchCalendar-menu table td div.DynarchCalendar-pressed-navBtn {
background: #445 url("coolbg.png") repeat-x 0 50%;
}
.DynarchCalendar-pressed-title div,
.DynarchCalendar-pressed-navBtn div { background-color: transparent; }
.DynarchCalendar-hover-week,
.DynarchCalendar-focused .DynarchCalendar-hover-week {
background: #ddd url("coolbg.png") repeat-x 0 50%;
}
.DynarchCalendar {
background: url("steel.jpg") no-repeat 50% 30px;
}
.DynarchCalendar-day-selected {
background-color: #1864fc;
color: #fff !important;
background-image: url("coolbg.png");
background-position: 0 50%;
background-repeat: repeat-x;
}
.DynarchCalendar-day-today.DynarchCalendar-day-selected {
background-color: #1864fc;
color: #fff !important;
}
.DynarchCalendar-focused .DynarchCalendar-body {
background: url("../shadow-b.png") repeat-x 0 0;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/steel/steel.css | CSS | asf20 | 1,522 |
.DynarchCalendar, .DynarchCalendar-focused {
background-color: #242;
}
.DynarchCalendar-focused { border-color: #0f0; }
.DynarchCalendar-topBar,
.DynarchCalendar-bottomBar {
background-color: #242;
color: #0f0;
border-color: #080;
}
.DynarchCalendar-focused .DynarchCalendar-topBar,
.DynarchCalendar-focused .DynarchCalendar-bottomBar {
background-color: #020;
color: #0f0;
border-color: #0f0;
}
.DynarchCalendar-title div {
color: #0f0;
text-shadow: 1px 1px 1px #fa0;
}
.DynarchCalendar-pressed-title div {
text-shadow: 1px 1px 1px #000;
}
.DynarchCalendar-dayNames div { color: #0f0; }
.DynarchCalendar-dayNames .DynarchCalendar-weekend { color: #fa0; }
.DynarchCalendar-hover-navBtn div,
.DynarchCalendar-hover-title div,
.DynarchCalendar-hover-bottomBar-today {
border-color: #0f0;
background-color: #000;
color: #fa0;
}
.DynarchCalendar-menu table td div.DynarchCalendar-hover-navBtn {
border-color: #0f0;
background-color: #000;
color: #fa0;
}
.DynarchCalendar-menu-year {
background-color: #000;
color: #0f0;
border: 1px solid #000;
}
.DynarchCalendar-pressed-navBtn div,
.DynarchCalendar-pressed-title div,
.DynarchCalendar-pressed-bottomBar-today,
.DynarchCalendar-menu table td div.DynarchCalendar-pressed-navBtn {
border-color: #000 #0c0 #0c0 #000;
background-color: #464;
color: #fff;
}
.DynarchCalendar-hover-date {
border-color: #070;
color: #0f0 !important;
background-color: #000;
}
.DynarchCalendar-day-othermonth.DynarchCalendar-hover-date { border-color: #040; color: #2a2; }
.DynarchCalendar-day {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.DynarchCalendar-day-disabled {}
.DynarchCalendar-hover-week { background-color: #131 !important; }
.DynarchCalendar-menu {
background-color: #040;
color: #8f8;
}
.DynarchCalendar-menu-sep {
border-color: #000;
background-color: #080;
}
.DynarchCalendar-day-selected {
background-color: #000;
border: 1px solid #a90;
margin: 0;
color: #8f4 !important;
}
.DynarchCalendar-weekNumber { border-color: #272; color: #0c0; }
.DynarchCalendar-day { color: #0c0; }
.DynarchCalendar-weekend { color: #fa0; }
.DynarchCalendar-day-othermonth { color: #070; }
.DynarchCalendar-day-othermonth.DynarchCalendar-weekend { color: #850; }
.DynarchCalendar-day-today { color: #ff0; }
.DynarchCalendar-day-today.DynarchCalendar-day-selected { background-color: #000; }
.DynarchCalendar-prevMonth div {
background-image: url("nav-left.gif");
}
.DynarchCalendar-nextMonth div {
background-image: url("nav-right.gif");
}
.DynarchCalendar-prevYear div {
background-image: url("nav-left-x2.gif");
}
.DynarchCalendar-nextYear div {
background-image: url("nav-right-x2.gif");
}
.DynarchCalendar-tooltipCont { background: #242; color: #9bf; }
.DynarchCalendar-focused .DynarchCalendar-tooltipCont { background: #020; }
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/matrix/matrix.css | CSS | asf20 | 2,876 |
/* CSS */
.DynarchCalendar {
border: 1px solid #aaa;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
background: #e8e8e8;
font: 11px "lucida grande",tahoma,verdana,sans-serif;
line-height: 14px;
position: relative;
cursor: default;
}
.DynarchCalendar table {
border-collapse: collapse;
font: 11px "lucida grande",tahoma,verdana,sans-serif;
line-height: 14px;
}
.DynarchCalendar-topBar {
border-bottom: 1px solid #aaa;
background: #ddd;
padding: 5px 0 0 0;
}
table.DynarchCalendar-titleCont {
font-size: 130%; font-weight: bold;
color: #444;
text-align: center;
z-index: 9;
position: relative;
margin-top: -6px;
}
.DynarchCalendar-title div {
padding: 5px 17px;
text-shadow: 1px 1px 1px #777;
}
.DynarchCalendar-hover-title div {
background-color: #fff;
border: 1px solid #000;
padding: 4px 16px;
background-image: url("img/drop-down.gif");
background-repeat: no-repeat;
background-position: 100% 50%;
}
.DynarchCalendar-pressed-title div {
border: 1px solid #000;
padding: 4px 16px;
background-color: #777;
color: #fff;
background-image: url("img/drop-up.gif");
background-repeat: no-repeat;
background-position: 100% 50%;
}
.DynarchCalendar-bottomBar {
border-top: 1px solid #aaa;
background: #ddd;
padding: 2px;
position: relative;
text-align: center;
}
.DynarchCalendar-bottomBar-today {
padding: 2px 15px;
}
.DynarchCalendar-hover-bottomBar-today {
border: 1px solid #000;
background-color: #fff;
padding: 1px 14px;
}
.DynarchCalendar-pressed-bottomBar-today {
border: 1px solid #000;
background-color: #777;
color: #fff;
padding: 1px 14px;
}
.DynarchCalendar-body {
position: relative;
overflow: hidden;
padding-top: 5px;
padding-bottom: 5px;
}
.DynarchCalendar-first-col { padding-left: 5px; }
.DynarchCalendar-last-col { padding-right: 5px; }
.DynarchCalendar-animBody-backYear {
position: absolute;
top: -100%;
left: 0;
}
.DynarchCalendar-animBody-back {
position: absolute;
top: 5px;
left: -100%;
}
.DynarchCalendar-animBody-fwd {
position: absolute;
top: 5px;
left: 100%;
}
.DynarchCalendar-animBody-now {
position: absolute;
top: 5px;
left: 0;
}
.DynarchCalendar-animBody-fwdYear {
position: absolute;
top: 100%;
left: 0;
}
.DynarchCalendar-dayNames {
padding-left: 5px;
padding-right: 5px;
}
.DynarchCalendar-dayNames div { font-weight: bold; color: #444; text-shadow: 1px 1px 1px #777; }
.DynarchCalendar-navBtn {
position: absolute;
top: 5px;
z-index: 10;
}
.DynarchCalendar-navBtn div {
background-repeat: no-repeat;
background-position: 50% 50%;
height: 15px;
width: 16px;
padding: 1px;
}
.DynarchCalendar-hover-navBtn div {
border: 1px solid #000;
padding: 0;
background-color: #fff;
}
.DynarchCalendar-navDisabled {
opacity: 0.3;
filter: alpha(opacity=30);
}
.DynarchCalendar-pressed-navBtn div {
border: 1px solid #000;
padding: 0;
background-color: #777;
color: #fff;
}
.DynarchCalendar-prevMonth {
left: 25px;
}
.DynarchCalendar-nextMonth {
left: 100%;
margin-left: -43px;
}
.DynarchCalendar-prevYear {
left: 5px;
}
.DynarchCalendar-nextYear {
left: 100%;
margin-left: -23px;
}
.DynarchCalendar-prevMonth div {
background-image: url("img/nav-left.gif");
}
.DynarchCalendar-nextMonth div {
background-image: url("img/nav-right.gif");
}
.DynarchCalendar-prevYear div {
background-image: url("img/nav-left-x2.gif");
}
.DynarchCalendar-nextYear div {
background-image: url("img/nav-right-x2.gif");
}
.DynarchCalendar-menu {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #ddd;
overflow: hidden;
opacity: 0.85;
filter: alpha(opacity=85);
}
.DynarchCalendar-menu table td div {
text-align: center;
font-weight: bold;
padding: 3px 5px;
}
.DynarchCalendar-menu table td div.DynarchCalendar-menu-month {
width: 4em;
text-align: center;
}
.DynarchCalendar-menu table td div.DynarchCalendar-hover-navBtn {
border: 1px solid #000;
padding: 2px 4px;
background-color: #fff;
color: #000;
}
.DynarchCalendar-menu table td div.DynarchCalendar-pressed-navBtn {
border: 1px solid #000;
padding: 2px 4px;
background-color: #777;
color: #fff !important;
}
.DynarchCalendar-menu-year {
text-align: center;
font: 16px "lucida grande",tahoma,verdana,sans-serif;
font-weight: bold;
}
.DynarchCalendar-menu-sep {
height: 1px; font-size: 1px; line-height: 1px;
overflow: hidden;
border-top: 1px solid #888;
background: #fff;
margin-top: 4px; margin-bottom: 3px;
}
.DynarchCalendar-time td { font-weight: bold; font-size: 120%; }
.DynarchCalendar-time-hour, .DynarchCalendar-time-minute { padding: 1px 3px; }
.DynarchCalendar-time-down { background: url("img/time-down.png") no-repeat 50% 50%; width: 11px; height: 8px; opacity: 0.5; }
.DynarchCalendar-time-up { background: url("img/time-up.png") no-repeat 50% 50%; width: 11px; height: 8px; opacity: 0.5; }
.DynarchCalendar-time-sep { padding: 0 2px; }
.DynarchCalendar-hover-time { background-color: #444; color: #fff; opacity: 1; }
.DynarchCalendar-pressed-time { background-color: #000; color: #fff; opacity: 1; }
.DynarchCalendar-time-am { padding: 1px; width: 2.5em; text-align: center; }
/* body */
.DynarchCalendar-hover-week { background-color: #ddd; }
.DynarchCalendar-dayNames div, .DynarchCalendar-day, .DynarchCalendar-weekNumber {
width: 1.7em;
padding: 3px 4px;
text-align: center;
}
.DynarchCalendar-weekNumber {
border-right: 1px solid #aaa;
margin-right: 4px;
width: 2em !important;
padding-right: 8px !important;
}
.DynarchCalendar-day {
text-align: right; color: #222;
}
.DynarchCalendar-day-othermonth { color: #888; }
.DynarchCalendar-weekend { color: #c22; }
.DynarchCalendar-day-today { color: #00f; font-weight: bold; }
.DynarchCalendar-day-disabled {
opacity: 0.5;
text-shadow: 2px 1px 1px #fff;
}
.DynarchCalendar-hover-date {
padding: 2px 3px;
background-color: #eef;
border: 1px solid #88c;
margin: 0 !important;
color: #000;
}
.DynarchCalendar-day-othermonth.DynarchCalendar-hover-date { border-color: #aaa; color: #888; }
.DynarchCalendar-dayNames .DynarchCalendar-weekend { color: #c22; }
.DynarchCalendar-day-othermonth.DynarchCalendar-weekend { color: #d88; }
.DynarchCalendar-day-selected {
padding: 2px 3px;
margin: 1px;
background-color: #aaa;
color: #000 !important;
}
.DynarchCalendar-day-today.DynarchCalendar-day-selected { background-color: #999; }
/* focus */
.DynarchCalendar-focusLink {
position: absolute;
opacity: 0;
filter: alpha(opacity=0);
}
.DynarchCalendar-focused {
border-color: #000;
}
.DynarchCalendar-focused .DynarchCalendar-topBar, .DynarchCalendar-focused .DynarchCalendar-bottomBar {
background-color: #ccc;
border-color: #336;
}
.DynarchCalendar-focused .DynarchCalendar-hover-week {
background-color: #ccc;
}
.DynarchCalendar-tooltip {
position: absolute;
top: 100%;
width: 100%;
}
.DynarchCalendar-tooltipCont {
margin: 0 5px 0 5px;
border: 1px solid #aaa;
border-top: 0;
padding: 3px 6px;
background: #ddd;
}
.DynarchCalendar-focused .DynarchCalendar-tooltipCont {
background: #ccc;
border-color: #000;
}
@media print {
.DynarchCalendar-day-selected {
padding: 2px 3px;
border: 1px solid #000;
margin: 0 !important;
}
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/jscal2.css | CSS | asf20 | 7,385 |
.DynarchCalendar, .DynarchCalendar table {
font-size: 10px;
}
.DynarchCalendar-dayNames { padding: 0; }
.DynarchCalendar-body { padding: 0; }
.DynarchCalendar-animBody-back { top: 0; }
.DynarchCalendar-animBody-fwd { top: 0; }
.DynarchCalendar-animBody-now { top: 0; }
.DynarchCalendar-first-col { padding-left: 0; }
.DynarchCalendar-last-col { padding-right: 0; }
.DynarchCalendar-weekNumber {
margin-right: 0;
padding-right: 4px !important;
}
.DynarchCalendar-dayNames div, .DynarchCalendar-day, .DynarchCalendar-weekNumber {
padding: 1px 2px;
}
.DynarchCalendar-menu-year { font-size: 12px; }
.DynarchCalendar-hover-date {
padding: 0px 1px;
}
.DynarchCalendar-day-selected {
padding: 0px 1px;
}
.DynarchCalendar-menu table td div {
padding: 2px 4px;
}
.DynarchCalendar-menu table td div.DynarchCalendar-hover-navBtn {
padding: 1px 3px;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/JSCal2-1.7/src/css/reduce-spacing.css | CSS | asf20 | 858 |
var makelist = {
listid : '' ,
listname : '',
init:function(id, name)
{
this.listid = listid ;
this.listname = listname ;
},
add : function (id)
{
//list proid
var listid = document.getElementById("proid").value ;
if(listid=='')
listid = id ;
else
listid = listid + "," + id ;
document.getElementById("proid").value = listid;
},
remove:function (items)
{
var listid = document.getElementById("proid").value ;
var arrID = listid.split(",") ;
arrID.splice(items,1);
listid = arrID.toString();
document.getElementById("proid").value = listid;
},
chkid : function (id)
{
var listid = document.getElementById("proid").value ;
var arrID = listid.split(",") ;
for(var i =0; i<arrID.length;i++)
{
if(arrID[i]==id) return true;
}
return false ;
},
render:function ()
{
var lsid = document.getElementById('proid').value;
if(lsid=='') return ;
document.getElementById('proid').value = '';
var xmlhttp = ajax.isdom("get_product.php?mode=proname&lsid="+lsid);
var proname = xmlhttp.responseText ;
var arr = proname.split("~");
for(var i=0;i<arr.length;i++)
{
var pro = arr[i].split("|");
appendOptionLast(pro[1], pro[0]);
add_proid(pro[0]) ;
}
} ,
add_product:function (url)
{
var obj = showpopup(url) ;
if (obj == null) return ;
if(ckhexist(obj.orgid))
alert("Product is exist") ;
else
{
add_proid(obj.orgid) ;
appendOptionLast(obj.orgname, obj.orgid) ;
}
},
remove_product:function ()
{
var items = removeOptionSelected();
remove_proid(items) ;
}
};
var count1 = 0;
var count2 = 0;
var opts = {} ;
var insertOptionBefore = function (num)
{
var elSel = document.getElementById('product_name');
if (elSel.selectedIndex >= 0) {
var elOptNew = document.createElement('option');
elOptNew.text = 'Insert' + num;
elOptNew.value = 'insert' + num;
var elOptOld = elSel.options[elSel.selectedIndex];
try {
elSel.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE
}
catch(ex) {
elSel.add(elOptNew, elSel.selectedIndex); // IE only
}
}
}
var removeOptionSelected = function ()
{
var elSel = document.getElementById('product_name');
for (var i = elSel.length - 1; i>=0; i--) {
if (elSel.options[i].selected) {
elSel.remove(i);
return i ;
}
}
return;
}
var appendOptionLast = function (text, value)
{
var elOptNew = document.createElement('option');
elOptNew.text = text ;
elOptNew.value = value ;
var elSel = document.getElementById('product_name');
try {
elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
}
catch(ex) {
elSel.add(elOptNew); // IE only
}
}
var removeOptionLast = function ()
{
var elSel = document.getElementById('product_name');
if (elSel.length > 0)
{
elSel.remove(elSel.length - 1);
}
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/get_list_id.js | JavaScript | asf20 | 2,960 |
/*
* jQuery Autocomplete plugin 1.1
*
* Copyright (c) 2009 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
*/
;(function($) {
$.fn.extend({
autocomplete: function(urlOrData, options) {
var isUrl = typeof urlOrData == "string";
options = $.extend({}, $.Autocompleter.defaults, {
url: isUrl ? urlOrData : null,
data: isUrl ? null : urlOrData,
delay: isUrl ? $.Autocompleter.defaults.delay : 10,
max: options && !options.scroll ? 10 : 150
}, options);
// if highlight is set to false, replace it with a do-nothing function
options.highlight = options.highlight || function(value) { return value; };
// if the formatMatch option is not specified, then use formatItem for backwards compatibility
options.formatMatch = options.formatMatch || options.formatItem;
return this.each(function() {
new $.Autocompleter(this, options);
});
},
result: function(handler) {
return this.bind("result", handler);
},
search: function(handler) {
return this.trigger("search", [handler]);
},
flushCache: function() {
return this.trigger("flushCache");
},
setOptions: function(options){
return this.trigger("setOptions", [options]);
},
unautocomplete: function() {
return this.trigger("unautocomplete");
}
});
$.Autocompleter = function(input, options) {
var KEY = {
UP: 38,
DOWN: 40,
DEL: 46,
TAB: 9,
RETURN: 13,
ESC: 27,
COMMA: 188,
PAGEUP: 33,
PAGEDOWN: 34,
BACKSPACE: 8
};
// Create $ object for input element
var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
var timeout;
var previousValue = "";
var cache = $.Autocompleter.Cache(options);
var hasFocus = 0;
var lastKeyPressCode;
var config = {
mouseDownOnSelect: false
};
var select = $.Autocompleter.Select(options, input, selectCurrent, config);
var blockSubmit;
// prevent form submit in opera when selecting with return key
$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
if (blockSubmit) {
blockSubmit = false;
return false;
}
});
// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
// a keypress means the input has focus
// avoids issue where input had focus before the autocomplete was applied
hasFocus = 1;
// track last key pressed
lastKeyPressCode = event.keyCode;
switch(event.keyCode) {
case KEY.UP:
event.preventDefault();
if ( select.visible() ) {
select.prev();
} else {
onChange(0, true);
}
break;
case KEY.DOWN:
event.preventDefault();
if ( select.visible() ) {
select.next();
} else {
onChange(0, true);
}
break;
case KEY.PAGEUP:
event.preventDefault();
if ( select.visible() ) {
select.pageUp();
} else {
onChange(0, true);
}
break;
case KEY.PAGEDOWN:
event.preventDefault();
if ( select.visible() ) {
select.pageDown();
} else {
onChange(0, true);
}
break;
// matches also semicolon
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
case KEY.TAB:
case KEY.RETURN:
if( selectCurrent() ) {
// stop default to prevent a form submit, Opera needs special handling
event.preventDefault();
blockSubmit = true;
return false;
}
break;
case KEY.ESC:
select.hide();
break;
default:
clearTimeout(timeout);
timeout = setTimeout(onChange, options.delay);
break;
}
}).focus(function(){
// track whether the field has focus, we shouldn't process any
// results if the field no longer has focus
hasFocus++;
}).blur(function() {
hasFocus = 0;
if (!config.mouseDownOnSelect) {
hideResults();
}
}).click(function() {
// show select when clicking in a focused field
if ( hasFocus++ > 1 && !select.visible() ) {
onChange(0, true);
}
}).bind("search", function() {
// TODO why not just specifying both arguments?
var fn = (arguments.length > 1) ? arguments[1] : null;
function findValueCallback(q, data){
var result;
if( data && data.length ) {
for (var i=0; i < data.length; i++) {
if( data[i].result.toLowerCase() == q.toLowerCase() ) {
result = data[i];
break;
}
}
}
if( typeof fn == "function" ) fn(result);
else $input.trigger("result", result && [result.data, result.value]);
}
$.each(trimWords($input.val()), function(i, value) {
request(value, findValueCallback, findValueCallback);
});
}).bind("flushCache", function() {
cache.flush();
}).bind("setOptions", function() {
$.extend(options, arguments[1]);
// if we've updated the data, repopulate
if ( "data" in arguments[1] )
cache.populate();
}).bind("unautocomplete", function() {
select.unbind();
$input.unbind();
$(input.form).unbind(".autocomplete");
});
function selectCurrent() {
var selected = select.selected();
if( !selected )
return false;
var v = selected.result;
//var id = selected.value;
previousValue = v;
if ( options.multiple ) {
var words = trimWords($input.val());
if ( words.length > 1 ) {
var seperator = options.multipleSeparator.length;
var cursorAt = $(input).selection().start;
var wordAt, progress = 0;
$.each(words, function(i, word) {
progress += word.length;
if (cursorAt <= progress) {
wordAt = i;
return false;
}
progress += seperator;
});
words[wordAt] = v;
// TODO this should set the cursor to the right position, but it gets overriden somewhere
//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
v = words.join( options.multipleSeparator );
}
v += options.multipleSeparator;
//id += options.multipleSeparator;
}
$input.val(v);
//$("#"+ options.fieldID).val(id) ;
hideResultsNow();
$input.trigger("result", [selected.data, selected.value]);
return true;
}
function onChange(crap, skipPrevCheck) {
if( lastKeyPressCode == KEY.DEL ) {
select.hide();
return;
}
var currentValue = $input.val();
if ( !skipPrevCheck && currentValue == previousValue )
return;
previousValue = currentValue;
currentValue = lastWord(currentValue);
if ( currentValue.length >= options.minChars) {
$input.addClass(options.loadingClass);
if (!options.matchCase)
currentValue = currentValue.toLowerCase();
request(currentValue, receiveData, hideResultsNow);
} else {
stopLoading();
select.hide();
}
};
function trimWords(value) {
if (!value)
return [""];
if (!options.multiple)
return [$.trim(value)];
return $.map(value.split(options.multipleSeparator), function(word) {
return $.trim(value).length ? $.trim(word) : null;
});
}
function lastWord(value) {
if ( !options.multiple )
return value;
var words = trimWords(value);
if (words.length == 1)
return words[0];
var cursorAt = $(input).selection().start;
if (cursorAt == value.length) {
words = trimWords(value)
} else {
words = trimWords(value.replace(value.substring(cursorAt), ""));
}
return words[words.length - 1];
}
// fills in the input box w/the first match (assumed to be the best match)
// q: the term entered
// sValue: the first matching result
function autoFill(q, sValue){
// autofill in the complete box w/the first match as long as the user hasn't entered in more data
// if the last user key pressed was backspace, don't autofill
if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
// fill in the value (keep the case the user has typed)
$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
// select the portion of the value not typed by the user (so the next character will erase)
$(input).selection(previousValue.length, previousValue.length + sValue.length);
}
};
function hideResults() {
clearTimeout(timeout);
timeout = setTimeout(hideResultsNow, 200);
};
function hideResultsNow() {
var wasVisible = select.visible();
select.hide();
clearTimeout(timeout);
stopLoading();
if (options.mustMatch) {
// call search and run callback
$input.search(
function (result){
// if no value found, clear the input box
if( !result ) {
if (options.multiple) {
var words = trimWords($input.val()).slice(0, -1);
$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
}
else {
$input.val( "" );
$input.trigger("result", null);
}
}
}
);
}
};
function receiveData(q, data) {
if ( data && data.length && hasFocus ) {
stopLoading();
select.display(data, q);
autoFill(q, data[0].value);
select.show();
} else {
hideResultsNow();
}
};
function request(term, success, failure)
{
if (!options.matchCase)
term = term.toLowerCase();
var data = cache.load(term);
// recieve the cached data
if (data && data.length) {
success(term, data);
// if an AJAX url has been supplied, try loading the data now
} else if( (typeof options.url == "string") && (options.url.length > 0) ){
var extraParams = {
timestamp: +new Date()
};
$.each(options.extraParams, function(key, param) {
extraParams[key] = typeof param == "function" ? param() : param;
});
$.ajax({
// try to leverage ajaxQueue plugin to abort previous requests
mode: "abort",
// limit abortion to this input
port: "autocomplete" + input.name,
dataType: options.dataType,
url: options.url,
type: 'POST',
data: $.extend({
q: lastWord(term),
limit: options.max
}, extraParams),
success: function(data) {
var parsed = options.parse && options.parse(data) || parse(data);
cache.add(term, parsed);
success(term, parsed);
}
});
} else {
// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
select.emptyList();
failure(term);
}
};
function parse(data) {
var parsed = [];
var rows = data.split("\n");
for (var i=0; i < rows.length; i++) {
var row = $.trim(rows[i]);
if (row) {
row = row.split("|");
parsed[parsed.length] = {
data: row,
value: row[0],
result: options.formatResult && options.formatResult(row, row[0]) || row[0]
};
}
}
return parsed;
};
function stopLoading() {
$input.removeClass(options.loadingClass);
};
};
$.Autocompleter.defaults = {
inputClass: "ac_input",
resultsClass: "ac_results",
loadingClass: "ac_loading",
minChars: 1,
delay: 400,
matchCase: false,
matchSubset: true,
matchContains: false,
cacheLength: 10,
max: 100,
mustMatch: false,
extraParams: {},
selectFirst: true,
formatItem: function(row) { return row[0]; },
formatMatch: null,
autoFill: false,
width: 0,
multiple: false,
multipleSeparator: ", ",
highlight: function(value, term) {
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
},
scroll: true,
scrollHeight: 180
};
$.Autocompleter.Cache = function(options) {
var data = {};
var length = 0;
function matchSubset(s, sub) {
if (!options.matchCase)
s = s.toLowerCase();
var i = s.indexOf(sub);
if (options.matchContains == "word"){
i = s.toLowerCase().search("\\b" + sub.toLowerCase());
}
if (i == -1) return false;
return i == 0 || options.matchContains;
};
function add(q, value) {
if (length > options.cacheLength){
flush();
}
if (!data[q]){
length++;
}
data[q] = value;
}
function populate(){
if( !options.data ) return false;
// track the matches
var stMatchSets = {},
nullData = 0;
// no url was specified, we need to adjust the cache length to make sure it fits the local data store
if( !options.url ) options.cacheLength = 1;
// track all options for minChars = 0
stMatchSets[""] = [];
// loop through the array and create a lookup structure
for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
var rawValue = options.data[i];
// if rawValue is a string, make an array otherwise just reference the array
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
var value = options.formatMatch(rawValue, i+1, options.data.length);
if ( value === false )
continue;
var firstChar = value.charAt(0).toLowerCase();
// if no lookup array for this character exists, look it up now
if( !stMatchSets[firstChar] )
stMatchSets[firstChar] = [];
// if the match is a string
var row = {
value: value,
data: rawValue,
result: options.formatResult && options.formatResult(rawValue) || value
};
// push the current match into the set list
stMatchSets[firstChar].push(row);
// keep track of minChars zero items
if ( nullData++ < options.max ) {
stMatchSets[""].push(row);
}
};
// add the data items to the cache
$.each(stMatchSets, function(i, value) {
// increase the cache size
options.cacheLength++;
// add to the cache
add(i, value);
});
}
// populate any existing data
setTimeout(populate, 25);
function flush(){
data = {};
length = 0;
}
return {
flush: flush,
add: add,
populate: populate,
load: function(q) {
if (!options.cacheLength || !length)
return null;
/*
* if dealing w/local data and matchContains than we must make sure
* to loop through all the data collections looking for matches
*/
if( !options.url && options.matchContains ){
// track all matches
var csub = [];
// loop through all the data grids for matches
for( var k in data ){
// don't search through the stMatchSets[""] (minChars: 0) cache
// this prevents duplicates
if( k.length > 0 ){
var c = data[k];
$.each(c, function(i, x) {
// if we've got a match, add it to the array
if (matchSubset(x.value, q)) {
csub.push(x);
}
});
}
}
return csub;
} else
// if the exact item exists, use it
if (data[q]){
return data[q];
} else
if (options.matchSubset) {
for (var i = q.length - 1; i >= options.minChars; i--) {
var c = data[q.substr(0, i)];
if (c) {
var csub = [];
$.each(c, function(i, x) {
if (matchSubset(x.value, q)) {
csub[csub.length] = x;
}
});
return csub;
}
}
}
return null;
}
};
};
$.Autocompleter.Select = function (options, input, select, config) {
var CLASSES = {
ACTIVE: "ac_over"
};
var listItems,
active = -1,
data,
term = "",
needsInit = true,
element,
list;
// Create results
function init() {
if (!needsInit)
return;
element = $("<div/>")
.hide()
.addClass(options.resultsClass)
.css("position", "absolute")
.appendTo(document.body);
list = $("<ul/>").appendTo(element).mouseover( function(event) {
if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI'){
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
$(target(event)).addClass(CLASSES.ACTIVE);
}
}).click(function(event) {
$(target(event)).addClass(CLASSES.ACTIVE);
select();
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
input.focus();
return false;
}).mousedown(function() {
config.mouseDownOnSelect = true;
}).mouseup(function() {
config.mouseDownOnSelect = false;
});
if( options.width > 0 )
element.css("width", options.width);
needsInit = false;
}
function target(event) {
var element = event.target;
while(element && element.tagName != "LI")
element = element.parentNode;
// more fun with IE, sometimes event.target is empty, just ignore it then
if(!element)
return [];
return element;
}
function moveSelect(step)
{
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
movePosition(step);
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
if(options.scroll) {
var offset = 0;
listItems.slice(0, active).each(function() {
offset += this.offsetHeight;
});
if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
} else if(offset < list.scrollTop()) {
list.scrollTop(offset);
}
}
};
function movePosition(step) {
active += step;
if (active < 0) {
active = listItems.size() - 1;
} else if (active >= listItems.size()) {
active = 0;
}
}
function limitNumberOfItems(available)
{
return options.max && options.max < available
? options.max
: available;
}
function fillList()
{
list.empty();
var max = limitNumberOfItems(data.length);
for (var i=0; i < max; i++) {
if (!data[i])
continue;
var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
if ( formatted === false )
continue;
var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
$.data(li, "ac_data", data[i]);
}
listItems = list.find("li");
if ( options.selectFirst ) {
listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
active = 0;
}
// apply bgiframe if available
if ( $.fn.bgiframe )
list.bgiframe();
}
return {
display: function(d, q) {
init();
data = d;
term = q;
fillList();
},
next: function() {
moveSelect(1);
},
prev: function() {
moveSelect(-1);
},
pageUp: function() {
if (active != 0 && active - 8 < 0) {
moveSelect( -active );
} else {
moveSelect(-8);
}
},
pageDown: function() {
if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
moveSelect( listItems.size() - 1 - active );
} else {
moveSelect(8);
}
},
hide: function() {
element && element.hide();
listItems && listItems.removeClass(CLASSES.ACTIVE);
active = -1;
},
visible : function() {
return element && element.is(":visible");
},
current: function() {
return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
},
show: function() {
var offset = $(input).offset();
element.css({
width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
top: offset.top + input.offsetHeight,
left: offset.left
}).show();
if(options.scroll) {
list.scrollTop(0);
list.css({
maxHeight: options.scrollHeight,
overflow: 'auto'
});
if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
var listHeight = 0;
listItems.each(function() {
listHeight += this.offsetHeight;
});
var scrollbarsVisible = listHeight > options.scrollHeight;
list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
if (!scrollbarsVisible) {
// IE doesn't recalculate width when scrollbar disappears
listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
}
}
}
},
selected: function() {
var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
return selected && selected.length && $.data(selected[0], "ac_data");
},
emptyList: function (){
list && list.empty();
},
unbind: function() {
element && element.remove();
}
};
};
$.fn.selection = function(start, end) {
if (start !== undefined) {
return this.each(function() {
if( this.createTextRange ){
var selRange = this.createTextRange();
if (end === undefined || start == end) {
selRange.move("character", start);
selRange.select();
} else {
selRange.collapse(true);
selRange.moveStart("character", start);
selRange.moveEnd("character", end);
selRange.select();
}
} else if( this.setSelectionRange ){
this.setSelectionRange(start, end);
} else if( this.selectionStart ){
this.selectionStart = start;
this.selectionEnd = end;
}
});
}
var field = this[0];
if ( field.createTextRange ) {
var range = document.selection.createRange(),
orig = field.value,
teststring = "<->",
textLength = range.text.length;
range.text = teststring;
var caretAt = field.value.indexOf(teststring);
field.value = orig;
this.selection(caretAt, caretAt + textLength);
return {
start: caretAt,
end: caretAt + textLength
}
} else if( field.selectionStart !== undefined ){
return {
start: field.selectionStart,
end: field.selectionEnd
}
}
};
})(jQuery); | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/jquery.autocomplete.js | JavaScript | asf20 | 22,224 |
/*
* Inline Form Validation Engine 2.0 Beta, jQuery plugin
*
* Copyright(c) 2010, Cedric Dugas
* http://www.position-absolute.com
*
* 2.0 Rewrite by Olivier Refalo
* http://www.crionics.com
*
* Form validation engine allowing custom regex rules to be added.
* Licensed under the MIT License
*/
(function($) {
var methods = {
/**
* Kind of the constructor, called before any action
* @param {Map} user options
*/
init: function(options) {
var form = this;
if (form.data('jqv') === undefined || form.data('jqv') == null ) {
methods._saveOptions(form, options);
// bind all formError elements to close on click
$(".formError").live("click", function() {
$(this).fadeOut(150, function() {
// remove prompt once invisible
$(this).remove();
});
});
}
},
/**
* Attachs jQuery.validationEngine to form.submit and field.blur events
* Takes an optional params: a list of options
* ie. jQuery("#formID1").validationEngine('attach', {promptPosition : "centerRight"});
*/
attach: function(userOptions) {
var form = this;
var options;
if(userOptions)
options = methods._saveOptions(form, userOptions);
else
options = form.data('jqv');
if (!options.binded) {
if(options.bindMethod == "bind"){
// bind fields
form.find("[class*=validate]").not("[type=checkbox]").bind(options.validationEventTrigger, methods._onFieldEvent);
form.find("[class*=validate][type=checkbox]").bind("click", methods._onFieldEvent);
// bind form.submit
form.bind("submit", methods._onSubmitEvent);
}else if(options.bindMethod == "live"){
// bind fields with LIVE (for persistant state)
form.find("[class*=validate]").not("[type=checkbox]").live(options.validationEventTrigger, methods._onFieldEvent);
form.find("[class*=validate][type=checkbox]").live("click", methods._onFieldEvent);
// bind form.submit
form.live("submit", methods._onSubmitEvent);
}
options.binded = true;
}
},
/**
* Unregisters any bindings that may point to jQuery.validaitonEngine
*/
detach: function() {
var form = this;
var options = form.data('jqv');
if (options.binded) {
// unbind fields
form.find("[class*=validate]").not("[type=checkbox]").unbind(options.validationEventTrigger, methods._onFieldEvent);
form.find("[class*=validate][type=checkbox]").unbind("click", methods._onFieldEvent);
// unbind form.submit
form.unbind("submit", methods.onAjaxFormComplete);
// unbind live fields (kill)
form.find("[class*=validate]").not("[type=checkbox]").die(options.validationEventTrigger, methods._onFieldEvent);
form.find("[class*=validate][type=checkbox]").die("click", methods._onFieldEvent);
// unbind form.submit
form.die("submit", methods.onAjaxFormComplete);
form.removeData('jqv');
}
},
/**
* Validates the form fields, shows prompts accordingly.
* Note: There is no ajax form validation with this method, only field ajax validation are evaluated
*
* @return true if the form validates, false if it fails
*/
validate: function() {
return methods._validateFields(this);
},
/**
* Validates one field, shows prompt accordingly.
* Note: There is no ajax form validation with this method, only field ajax validation are evaluated
*
* @return true if the form validates, false if it fails
*/
validateField: function(el) {
var options = $(this).data('jqv');
return methods._validateField($(el), options);
},
/**
* Validates the form fields, shows prompts accordingly.
* Note: this methods performs fields and form ajax validations(if setup)
*
* @return true if the form validates, false if it fails, undefined if ajax is used for form validation
*/
validateform: function() {
return methods._onSubmitEvent(this);
},
/**
* Displays a prompt on a element.
* Note that the element needs an id!
*
* @param {String} promptText html text to display type
* @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red)
* @param {String} possible values topLeft, topRight, bottomLeft, centerRight, bottomRight
*/
showPrompt: function(promptText, type, promptPosition, showArrow) {
var form = this.closest('form');
var options = form.data('jqv');
// No option, take default one
if(!options) options = methods._saveOptions(this, options);
if(promptPosition)
options.promptPosition=promptPosition;
options.showArrow = showArrow===true;
methods._showPrompt(this, promptText, type, false, options);
},
/**
* Closes all error prompts on the page
*/
hidePrompt: function() {
var promptClass = "."+ $(this).attr("id").replace(":","_") + "formError"
$(promptClass).fadeTo("fast", 0.3, function() {
$(this).remove();
});
},
/**
* Closes form error prompts, CAN be invidual
*/
hide: function() {
if($(this).is("form")){
var closingtag = "parentForm"+$(this).attr('id');
}else{
var closingtag = $(this).attr('id') +"formError"
}
$('.'+closingtag).fadeTo("fast", 0.3, function() {
$(this).remove();
});
},
/**
* Closes all error prompts on the page
*/
hideAll: function() {
$('.formError').fadeTo("fast", 0.3, function() {
$(this).remove();
});
},
/**
* Typically called when user exists a field using tab or a mouse click, triggers a field
* validation
*/
_onFieldEvent: function() {
var field = $(this);
var form = field.closest('form');
var options = form.data('jqv');
// validate the current field
methods._validateField(field, options);
},
/**
* Called when the form is submited, shows prompts accordingly
*
* @param {jqObject}
* form
* @return false if form submission needs to be cancelled
*/
_onSubmitEvent: function() {
var form = $(this);
// validate each field (- skip field ajax validation, no necessary since we will perform an ajax form validation)
var r=methods._validateFields(form, true);
var options = form.data('jqv');
// validate the form using AJAX
if (r && options.ajaxFormValidation) {
methods._validateFormWithAjax(form, options);
return false;
}
if(options.onValidationComplete) {
options.onValidationComplete(form, r);
return false;
}
return r;
},
/**
* Return true if the ajax field validations passed so far
* @param {Object} options
* @return true, is all ajax validation passed so far (remember ajax is async)
*/
_checkAjaxStatus: function(options) {
var status = true;
$.each(options.ajaxValidCache, function(key, value) {
if (value === false) {
status = false;
// break the each
return false;
}
});
return status;
},
/**
* Validates form fields, shows prompts accordingly
*
* @param {jqObject}
* form
* @param {skipAjaxFieldValidation}
* boolean - when set to true, ajax field validation is skipped, typically used when the submit button is clicked
*
* @return true if form is valid, false if not, undefined if ajax form validation is done
*/
_validateFields: function(form, skipAjaxFieldValidation) {
var options = form.data('jqv');
// this variable is set to true if an error is found
var errorFound = false;
// first, evaluate status of non ajax fields
form.find('[class*=validate]').not(':hidden').each( function() {
var field = $(this);
// fields being valiated though ajax are marked with 'ajaxed',
// skip them
if (!field.hasClass("ajaxed"))
errorFound |= methods._validateField(field, options, skipAjaxFieldValidation);
});
// second, check to see if all ajax calls completed ok
errorFound |= !methods._checkAjaxStatus(options);
// thrird, check status and scroll the container accordingly
if (errorFound) {
if (options.scroll) {
// get the position of the first error, there should be at least one, no need to check this
//var destination = form.find(".formError:not('.greenPopup'):first").offset().top;
// look for the visually top prompt
var destination = Number.MAX_VALUE;
var lst = $(".formError:not('.greenPopup')");
for (var i = 0; i < lst.length; i++) {
var d = $(lst[i]).offset().top;
if (d < destination)
destination = d;
}
if (!options.isOverflown)
$("html:not(:animated),body:not(:animated)").animate({
scrollTop: destination
}, 1100);
else {
var overflowDIV = $(options.overflownDIV);
var scrollContainerScroll = overflowDIV.scrollTop();
var scrollContainerPos = -parseInt(overflowDIV.offset().top);
destination += scrollContainerScroll + scrollContainerPos - 5;
var scrollContainer = $(options.overflownDIV + ":not(:animated)");
scrollContainer.animate({
scrollTop: destination
}, 1100);
}
}
return false;
}
return true;
},
/**
* This method is called to perform an ajax form validation.
* During this process all the (field, value) pairs are sent to the server which returns a list of invalid fields or true
*
* @param {jqObject} form
* @param {Map} options
*/
_validateFormWithAjax: function(form, options) {
var data = form.serialize();
$.ajax({
type: "GET",
url: form.attr("action"),
cache: false,
dataType: "json",
data: data,
form: form,
methods: methods,
options: options,
beforeSend: function() {
return options.onBeforeAjaxFormValidation(form, options);
},
error: function(data, transport) {
methods._ajaxError(data, transport);
},
success: function(json) {
if (json !== true) {
// getting to this case doesn't necessary means that the form is invalid
// the server may return green or closing prompt actions
// this flag helps figuring it out
var errorInForm=false;
for (var i = 0; i < json.length; i++) {
var value = json[i];
var errorFieldId = value[0];
var errorField = $($("#" + errorFieldId)[0]);
// make sure we found the element
if (errorField.length == 1) {
// promptText or selector
var msg = value[2];
if (value[1] === true) {
if (msg == "")
// if for some reason, status==true and error="", just close the prompt
methods._closePrompt(errorField);
else {
// the field is valid, but we are displaying a green prompt
if (options.allrules[msg]) {
var txt = options.allrules[msg].alertTextOk;
if (txt)
msg = txt;
}
methods._showPrompt(errorField, msg, "pass", false, options);
}
} else {
// the field is invalid, show the red error prompt
errorInForm|=true;
if (options.allrules[msg]) {
var txt = options.allrules[msg].alertText;
if (txt)
msg = txt;
}
methods._showPrompt(errorField, msg, "", false, options);
}
}
}
options.onAjaxFormComplete(!errorInForm, form, json, options);
} else
options.onAjaxFormComplete(true, form, "", options);
}
});
},
/**
* Validates field, shows prompts accordingly
*
* @param {jqObject}
* field
* @param {Array[String]}
* field's validation rules
* @param {Map}
* user options
* @return true if field is valid
*/
_validateField: function(field, options, skipAjaxFieldValidation) {
if (!field.attr("id"))
$.error("jQueryValidate: an ID attribute is required for this field: " + field.attr("name") + " class:" +
field.attr("class"));
var rulesParsing = field.attr('class');
var getRules = /validate\[(.*)\]/.exec(rulesParsing);
if (getRules === null)
return false;
var str = getRules[1];
var rules = str.split(/\[|,|\]/);
// true if we ran the ajax validation, tells the logic to stop messing with prompts
var isAjaxValidator = false;
var fieldName = field.attr("name");
var promptText = "";
var required = false;
options.isError = false;
options.showArrow = true;
optional = false;
for (var i = 0; i < rules.length; i++) {
var errorMsg = undefined;
switch (rules[i]) {
case "optional":
optional = true;
break;
case "required":
required = true;
errorMsg = methods._required(field, rules, i, options);
break;
case "custom":
errorMsg = methods._customRegex(field, rules, i, options);
break;
case "ajax":
if(skipAjaxFieldValidation===false) {
// ajax has its own prompts handling technique
methods._ajax(field, rules, i, options);
isAjaxValidator = true;
}
break;
case "minSize":
errorMsg = methods._minSize(field, rules, i, options);
break;
case "maxSize":
errorMsg = methods._maxSize(field, rules, i, options);
break;
case "min":
errorMsg = methods._min(field, rules, i, options);
break;
case "max":
errorMsg = methods._max(field, rules, i, options);
break;
case "past":
errorMsg = methods._past(field, rules, i, options);
break;
case "future":
errorMsg = methods._future(field, rules, i, options);
break;
case "maxCheckbox":
errorMsg = methods._maxCheckbox(field, rules, i, options);
field = $($("input[name='" + fieldName + "']"));
break;
case "minCheckbox":
errorMsg = methods._minCheckbox(field, rules, i, options);
field = $($("input[name='" + fieldName + "']"));
break;
case "equals":
errorMsg = methods._equals(field, rules, i, options);
break;
case "funcCall":
errorMsg = methods._funcCall(field, rules, i, options);
break;
default:
//$.error("jQueryValidator rule not found"+rules[i]);
}
if (errorMsg !== undefined) {
promptText += errorMsg + "<br/>";
options.isError = true;
}
}
// If the rules required is not added, an empty field is not validated
if(!required && !optional ){
if(field.val() == "") options.isError = false;
}
// Hack for radio/checkbox group button, the validation go into the
// first radio/checkbox of the group
var fieldType = field.attr("type");
if ((fieldType == "radio" || fieldType == "checkbox") && $("input[name='" + fieldName + "']").size() > 1) {
field = $($("input[name='" + fieldName + "'][type!=hidden]:first"));
options.showArrow = false;
}
if (!isAjaxValidator) {
if (options.isError)
methods._showPrompt(field, promptText, "", false, options);
else
methods._closePrompt(field);
}
return options.isError;
},
/**
* Required validation
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_required: function(field, rules, i, options) {
switch (field.attr("type")) {
case "text":
case "password":
case "textarea":
case "file":
default:
if (!field.val())
return options.allrules[rules[i]].alertText;
break;
case "radio":
case "checkbox":
var name = field.attr("name");
if ($("input[name='" + name + "']:checked").size() === 0) {
if ($("input[name='" + name + "']").size() === 1)
return options.allrules[rules[i]].alertTextCheckboxe;
else
return options.allrules[rules[i]].alertTextCheckboxMultiple;
}
break;
// required for <select>
case "select-one":
// added by paul@kinetek.net for select boxes, Thank you
if (!field.val())
return options.allrules[rules[i]].alertText;
break;
case "select-multiple":
// added by paul@kinetek.net for select boxes, Thank you
if (!field.find("option:selected").val())
return options.allrules[rules[i]].alertText;
break;
}
},
/**
* Validate Regex rules
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_customRegex: function(field, rules, i, options) {
var customRule = rules[i + 1];
var rule = options.allrules[customRule];
if(rule===undefined) {
alert("jqv:custom rule not found "+customRule);
return;
}
var ex=rule.regex;
if(ex===undefined) {
alert("jqv:custom regex not found "+customRule);
return;
}
var pattern = new RegExp(ex);
if (!pattern.test(field.attr('value')))
return options.allrules[customRule].alertText;
},
/**
* Validate custom function outside of the engine scope
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_funcCall: function(field, rules, i, options) {
var functionName = rules[i + 1];
var fn = window[functionName];
if (typeof(fn) === 'function')
return fn(field, rules, i, options);
},
/**
* Field match
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_equals: function(field, rules, i, options) {
var equalsField = rules[i + 1];
if (field.attr('value') != $("#" + equalsField).attr('value'))
return options.allrules.equals.alertText;
},
/**
* Check the maximum size (in characters)
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_maxSize: function(field, rules, i, options) {
var max = rules[i + 1];
var len = field.attr('value').length;
if (len > max) {
var rule = options.allrules.maxSize;
return rule.alertText + max + rule.alertText2;
}
},
/**
* Check the minimum size (in characters)
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_minSize: function(field, rules, i, options) {
var min = rules[i + 1];
var len = field.attr('value').length;
if (len < min) {
var rule = options.allrules.minSize;
return rule.alertText + min + rule.alertText2;
}
},
/**
* Check number minimum value
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_min: function(field, rules, i, options) {
var min = parseFloat(rules[i + 1]);
var len = parseFloat(field.attr('value'));
if (len < min) {
var rule = options.allrules.min;
if (rule.alertText2) return rule.alertText + min + rule.alertText2;
return rule.alertText + min;
}
},
/**
* Check number maximum value
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_max: function(field, rules, i, options) {
var max = parseFloat(rules[i + 1]);
var len = parseFloat(field.attr('value'));
if (len >max ) {
var rule = options.allrules.max;
if (rule.alertText2) return rule.alertText + max + rule.alertText2;
//orefalo: to review, also do the translations
return rule.alertText + max;
}
},
/**
* Checks date is in the past
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_past: function(field, rules, i, options) {
var p=rules[i + 1];
var pdate = (p.toLowerCase() == "now")? new Date():methods._parseDate(p);
var vdate = methods._parseDate(field.attr('value'));
if (vdate > pdate ) {
var rule = options.allrules.past;
if (rule.alertText2) return rule.alertText + methods._dateToString(pdate) + rule.alertText2;
return rule.alertText + methods._dateToString(pdate);
}
},
/**
* Checks date is in the past
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_future: function(field, rules, i, options) {
var p=rules[i + 1];
var pdate = (p.toLowerCase() == "now")? new Date():methods._parseDate(p);
var vdate = methods._parseDate(field.attr('value'));
if (vdate < pdate ) {
var rule = options.allrules.future;
if (rule.alertText2) return rule.alertText + methods._dateToString(pdate) + rule.alertText2;
return rule.alertText + methods._dateToString(pdate);
}
},
/**
* Max number of checkbox selected
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_maxCheckbox: function(field, rules, i, options) {
var nbCheck = rules[i + 1];
var groupname = field.attr("name");
var groupSize = $("input[name='" + groupname + "']:checked").size();
if (groupSize > nbCheck) {
options.showArrow = false;
return options.allrules.maxCheckbox.alertText;
}
},
/**
* Min number of checkbox selected
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return an error string if validation failed
*/
_minCheckbox: function(field, rules, i, options) {
var nbCheck = rules[i + 1];
var groupname = field.attr("name");
var groupSize = $("input[name='" + groupname + "']:checked").size();
if (groupSize < nbCheck) {
options.showArrow = false;
return options.allrules.minCheckbox.alertText + " " + nbCheck + " " +
options.allrules.minCheckbox.alertText2;
}
},
/**
* Ajax field validation
*
* @param {jqObject} field
* @param {Array[String]} rules
* @param {int} i rules index
* @param {Map}
* user options
* @return nothing! the ajax validator handles the prompts itself
*/
_ajax: function(field, rules, i, options) {
var errorSelector = rules[i + 1];
var rule = options.allrules[errorSelector];
var extraData = rule.extraData;
if (!extraData)
extraData = "";
if (!options.isError) {
$.ajax({
type: "GET",
url: rule.url,
cache: false,
dataType: "json",
data: "fieldId=" + field.attr("id") + "&fieldValue=" + field.attr("value") + "&extraData=" + extraData,
field: field,
rule: rule,
methods: methods,
options: options,
beforeSend: function() {
// build the loading prompt
var loadingText = rule.alertTextLoad;
if (loadingText)
methods._showPrompt(field, loadingText, "load", true, options);
},
error: function(data, transport) {
methods._ajaxError(data, transport);
},
success: function(json) {
// asynchronously called on success, data is the json answer from the server
var errorFieldId = json[0];
var errorField = $($("#" + errorFieldId)[0]);
// make sure we found the element
if (errorField.length == 1) {
var status = json[1];
if (status === false) {
// Houston we got a problem
options.ajaxValidCache[errorFieldId] = false;
options.isError = true;
var promptText = rule.alertText;
methods._showPrompt(errorField, promptText, "", true, options);
} else {
if (options.ajaxValidCache[errorFieldId] !== undefined)
options.ajaxValidCache[errorFieldId] = true;
// see if we should display a green prompt
var alertTextOk = rule.alertTextOk;
if (alertTextOk)
methods._showPrompt(errorField, alertTextOk, "pass", true, options);
else
methods._closePrompt(errorField);
}
}
}
});
}
},
/**
* Common method to handle ajax errors
*
* @param {Object} data
* @param {Object} transport
*/
_ajaxError: function(data, transport) {
if(data.status === 0 && transport === null)
alert("The page is not served from a server! ajax call failed");
else if(console)
console.log("Ajax error: " + data.status + " " + transport);
},
/**
* date -> string
*
* @param {Object} date
*/
_dateToString: function(date) {
return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
},
/**
* Parses an ISO date
* @param {String} d
*/
_parseDate: function(d) {
var dateParts = d.split("-");
if(dateParts!==d)
dateParts = d.split("/");
return new Date(dateParts[0], (dateParts[1] - 1) ,dateParts[2]);
},
/**
* Builds or updates a prompt with the given information
*
* @param {jqObject} field
* @param {String} promptText html text to display type
* @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red)
* @param {boolean} ajaxed - use to mark fields than being validated with ajax
* @param {Map} options user options
*/
_showPrompt: function(field, promptText, type, ajaxed, options) {
var prompt = methods._getPrompt(field);
if (prompt)
methods._updatePrompt(field, prompt, promptText, type, ajaxed, options);
else
methods._buildPrompt(field, promptText, type, ajaxed, options);
},
/**
* Builds and shades a prompt for the given field.
*
* @param {jqObject} field
* @param {String} promptText html text to display type
* @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red)
* @param {boolean} ajaxed - use to mark fields than being validated with ajax
* @param {Map} options user options
*/
_buildPrompt: function(field, promptText, type, ajaxed, options) {
// create the prompt
var prompt = $('<div>');
prompt.addClass(field.attr("id").replace(":","_") + "formError");
// add a class name to identify the parent form of the prompt
if(field.is(":input")) prompt.addClass("parentForm"+field.parents('form').attr("id").replace(":","_"));
prompt.addClass("formError");
switch (type) {
case "pass":
prompt.addClass("greenPopup");
break;
case "load":
prompt.addClass("blackPopup");
}
if (ajaxed)
prompt.addClass("ajaxed");
// create the prompt content
var promptContent = $('<div>').addClass("formErrorContent").html(promptText).appendTo(prompt);
// create the css arrow pointing at the field
// note that there is no triangle on max-checkbox and radio
if (options.showArrow) {
var arrow = $('<div>').addClass("formErrorArrow");
switch (options.promptPosition) {
case "bottomLeft":
case "bottomRight":
prompt.find(".formErrorContent").before(arrow);
arrow.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');
break;
case "topLeft":
case "topRight":
arrow.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>');
prompt.append(arrow);
break;
}
}
//Cedric: Needed if a container is in position:relative
// insert prompt in the form or in the overflown container?
if (options.isOverflown)
field.before(prompt);
else
$("body").append(prompt);
var pos = methods._calculatePosition(field, prompt, options);
prompt.css({
"top": pos.callerTopPosition,
"left": pos.callerleftPosition,
"marginTop": pos.marginTopSize,
"opacity": 0
});
return prompt.animate({
"opacity": 0.87
});
},
/**
* Updates the prompt text field - the field for which the prompt
* @param {jqObject} field
* @param {String} promptText html text to display type
* @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red)
* @param {boolean} ajaxed - use to mark fields than being validated with ajax
* @param {Map} options user options
*/
_updatePrompt: function(field, prompt, promptText, type, ajaxed, options) {
if (prompt) {
if (type == "pass")
prompt.addClass("greenPopup");
else
prompt.removeClass("greenPopup");
if (type == "load")
prompt.addClass("blackPopup");
else
prompt.removeClass("blackPopup");
if (ajaxed)
prompt.addClass("ajaxed");
else
prompt.removeClass("ajaxed");
prompt.find(".formErrorContent").html(promptText);
var pos = methods._calculatePosition(field, prompt, options);
prompt.animate({
"top": pos.callerTopPosition,
"marginTop": pos.marginTopSize
});
}
},
/**
* Closes the prompt associated with the given field
*
* @param {jqObject}
* field
*/
_closePrompt: function(field) {
var prompt = methods._getPrompt(field);
if (prompt)
prompt.fadeTo("fast", 0, function() {
prompt.remove();
});
},
closePrompt: function(field) {
return methods._closePrompt(field);
},
/**
* Returns the error prompt matching the field if any
*
* @param {jqObject}
* field
* @return undefined or the error prompt (jqObject)
*/
_getPrompt: function(field) {
var className = "." + field.attr("id").replace(":","_") + "formError";
var match = $(className)[0];
if (match)
return $(match);
},
/**
* Calculates prompt position
*
* @param {jqObject}
* field
* @param {jqObject}
* the prompt
* @param {Map}
* options
* @return positions
*/
_calculatePosition: function(field, promptElmt, options) {
var promptTopPosition, promptleftPosition, marginTopSize;
var fieldWidth = field.width();
var promptHeight = promptElmt.height();
var overflow = options.isOverflown;
if (overflow) {
// is the form contained in an overflown container?
promptTopPosition = promptleftPosition = 0;
// compensation for the arrow
marginTopSize = -promptHeight;
} else {
var offset = field.offset();
promptTopPosition = offset.top;
promptleftPosition = offset.left;
marginTopSize = 0;
}
switch (options.promptPosition) {
default:
case "topRight":
if (overflow)
// Is the form contained in an overflown container?
promptleftPosition += fieldWidth - 30;
else {
promptleftPosition += fieldWidth - 30;
promptTopPosition += -promptHeight;
}
break;
case "topLeft":
promptTopPosition += -promptHeight - 10;
break;
case "centerRight":
promptleftPosition += fieldWidth + 13;
break;
case "bottomLeft":
promptTopPosition = promptTopPosition + field.height() + 15;
break;
case "bottomRight":
promptleftPosition += fieldWidth - 30;
promptTopPosition += field.height() + 5;
}
return {
"callerTopPosition": promptTopPosition + "px",
"callerleftPosition": promptleftPosition + "px",
"marginTopSize": marginTopSize + "px"
};
},
/**
* Saves the user options and variables in the form.data
*
* @param {jqObject}
* form - the form where the user option should be saved
* @param {Map}
* options - the user options
* @return the user options (extended from the defaults)
*/
_saveOptions: function(form, options) {
// is there a language localisation ?
if ($.validationEngineLanguage)
var allRules = $.validationEngineLanguage.allRules;
else
$.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page");
var userOptions = $.extend({
// Name of the event triggering field validation
validationEventTrigger: "blur",
// Automatically scroll viewport to the first error
scroll: true,
// Opening box position, possible locations are: topLeft,
// topRight, bottomLeft, centerRight, bottomRight
promptPosition: "topRight",
bindMethod:"bind",
// if set to true, the form data is sent asynchronously via ajax to the form.action url (get)
ajaxFormValidation: false,
// Ajax form validation callback method: boolean onComplete(form, status, errors, options)
// retuns false if the form.submit event needs to be canceled.
onAjaxFormComplete: $.noop,
// called right before the ajax call, may return false to cancel
onBeforeAjaxFormValidation: $.noop,
// Stops form from submitting and execute function assiciated with it
onValidationComplete: false,
// Used when the form is displayed within a scrolling DIV
isOverflown: false,
overflownDIV: "",
// --- Internals DO NOT TOUCH or OVERLOAD ---
// validation rules and i18
allrules: allRules,
// true when form and fields are binded
binded: false,
// set to true, when the prompt arrow needs to be displayed
showArrow: true,
// did one of the validation fail ? kept global to stop further ajax validations
isError: false,
// Caches field validation status, typically only bad status are created.
// the array is used during ajax form validation to detect issues early and prevent an expensive submit
ajaxValidCache: {}
}, options);
form.data('jqv', userOptions);
return userOptions;
}
};
/**
* Plugin entry point.
* You may pass an action as a parameter or a list of options.
* if none, the init and attach methods are being called.
* Remember: if you pass options, the attached method is NOT called automatically
*
* @param {String}
* method (optional) action
*/
$.fn.validationEngine = function(method) {
var form = $(this);
if(!form[0]) return false; // stop here if the form does not exist
if (typeof(method) === 'string' && method.charAt(0) != '_' && methods[method]) {
// make sure init is called once
if(method != "showPrompt" && method != "hidePrompt" && method != "hide" && method != "hideAll")
methods.init.apply(form);
return methods[method].apply(form, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
// default constructor with or without arguments
methods.init.apply(form, arguments);
return methods.attach.apply(form);
} else {
$.error('Method ' + method + ' does not exist in jQuery.validationEngine');
}
};
})(jQuery);
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/jquery.validationEngine.js | JavaScript | asf20 | 46,236 |
/**
* jquery.Jcrop.js v0.9.12
* jQuery Image Cropping Plugin - released under MIT License
* Author: Kelly Hallman <khallman@gmail.com>
* http://github.com/tapmodo/Jcrop
* Copyright (c) 2008-2013 Tapmodo Interactive LLC {{{
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* }}}
*/
(function ($) {
$.Jcrop = function (obj, opt) {
var options = $.extend({}, $.Jcrop.defaults),
docOffset,
_ua = navigator.userAgent.toLowerCase(),
is_msie = /msie/.test(_ua),
ie6mode = /msie [1-6]\./.test(_ua);
// Internal Methods {{{
function px(n) {
return Math.round(n) + 'px';
}
function cssClass(cl) {
return options.baseClass + '-' + cl;
}
function supportsColorFade() {
return $.fx.step.hasOwnProperty('backgroundColor');
}
function getPos(obj) //{{{
{
var pos = $(obj).offset();
return [pos.left, pos.top];
}
//}}}
function mouseAbs(e) //{{{
{
return [(e.pageX - docOffset[0]), (e.pageY - docOffset[1])];
}
//}}}
function setOptions(opt) //{{{
{
if (typeof(opt) !== 'object') opt = {};
options = $.extend(options, opt);
$.each(['onChange','onSelect','onRelease','onDblClick'],function(i,e) {
if (typeof(options[e]) !== 'function') options[e] = function () {};
});
}
//}}}
function startDragMode(mode, pos, touch) //{{{
{
docOffset = getPos($img);
Tracker.setCursor(mode === 'move' ? mode : mode + '-resize');
if (mode === 'move') {
return Tracker.activateHandlers(createMover(pos), doneSelect, touch);
}
var fc = Coords.getFixed();
var opp = oppLockCorner(mode);
var opc = Coords.getCorner(oppLockCorner(opp));
Coords.setPressed(Coords.getCorner(opp));
Coords.setCurrent(opc);
Tracker.activateHandlers(dragmodeHandler(mode, fc), doneSelect, touch);
}
//}}}
function dragmodeHandler(mode, f) //{{{
{
return function (pos) {
if (!options.aspectRatio) {
switch (mode) {
case 'e':
pos[1] = f.y2;
break;
case 'w':
pos[1] = f.y2;
break;
case 'n':
pos[0] = f.x2;
break;
case 's':
pos[0] = f.x2;
break;
}
} else {
switch (mode) {
case 'e':
pos[1] = f.y + 1;
break;
case 'w':
pos[1] = f.y + 1;
break;
case 'n':
pos[0] = f.x + 1;
break;
case 's':
pos[0] = f.x + 1;
break;
}
}
Coords.setCurrent(pos);
Selection.update();
};
}
//}}}
function createMover(pos) //{{{
{
var lloc = pos;
KeyManager.watchKeys();
return function (pos) {
Coords.moveOffset([pos[0] - lloc[0], pos[1] - lloc[1]]);
lloc = pos;
Selection.update();
};
}
//}}}
function oppLockCorner(ord) //{{{
{
switch (ord) {
case 'n':
return 'sw';
case 's':
return 'nw';
case 'e':
return 'nw';
case 'w':
return 'ne';
case 'ne':
return 'sw';
case 'nw':
return 'se';
case 'se':
return 'nw';
case 'sw':
return 'ne';
}
}
//}}}
function createDragger(ord) //{{{
{
return function (e) {
if (options.disabled) {
return false;
}
if ((ord === 'move') && !options.allowMove) {
return false;
}
// Fix position of crop area when dragged the very first time.
// Necessary when crop image is in a hidden element when page is loaded.
docOffset = getPos($img);
btndown = true;
startDragMode(ord, mouseAbs(e));
e.stopPropagation();
e.preventDefault();
return false;
};
}
//}}}
function presize($obj, w, h) //{{{
{
var nw = $obj.width(),
nh = $obj.height();
if ((nw > w) && w > 0) {
nw = w;
nh = (w / $obj.width()) * $obj.height();
}
if ((nh > h) && h > 0) {
nh = h;
nw = (h / $obj.height()) * $obj.width();
}
xscale = $obj.width() / nw;
yscale = $obj.height() / nh;
$obj.width(nw).height(nh);
}
//}}}
function unscale(c) //{{{
{
return {
x: c.x * xscale,
y: c.y * yscale,
x2: c.x2 * xscale,
y2: c.y2 * yscale,
w: c.w * xscale,
h: c.h * yscale
};
}
//}}}
function doneSelect(pos) //{{{
{
var c = Coords.getFixed();
if ((c.w > options.minSelect[0]) && (c.h > options.minSelect[1])) {
Selection.enableHandles();
Selection.done();
} else {
Selection.release();
}
Tracker.setCursor(options.allowSelect ? 'crosshair' : 'default');
}
//}}}
function newSelection(e) //{{{
{
if (options.disabled) {
return false;
}
if (!options.allowSelect) {
return false;
}
btndown = true;
docOffset = getPos($img);
Selection.disableHandles();
Tracker.setCursor('crosshair');
var pos = mouseAbs(e);
Coords.setPressed(pos);
Selection.update();
Tracker.activateHandlers(selectDrag, doneSelect, e.type.substring(0,5)==='touch');
KeyManager.watchKeys();
e.stopPropagation();
e.preventDefault();
return false;
}
//}}}
function selectDrag(pos) //{{{
{
Coords.setCurrent(pos);
Selection.update();
}
//}}}
function newTracker() //{{{
{
var trk = $('<div></div>').addClass(cssClass('tracker'));
if (is_msie) {
trk.css({
opacity: 0,
backgroundColor: 'white'
});
}
return trk;
}
//}}}
// }}}
// Initialization {{{
// Sanitize some options {{{
if (typeof(obj) !== 'object') {
obj = $(obj)[0];
}
if (typeof(opt) !== 'object') {
opt = {};
}
// }}}
setOptions(opt);
// Initialize some jQuery objects {{{
// The values are SET on the image(s) for the interface
// If the original image has any of these set, they will be reset
// However, if you destroy() the Jcrop instance the original image's
// character in the DOM will be as you left it.
var img_css = {
border: 'none',
visibility: 'visible',
margin: 0,
padding: 0,
position: 'absolute',
top: 0,
left: 0
};
var $origimg = $(obj),
img_mode = true;
if (obj.tagName == 'IMG') {
// Fix size of crop image.
// Necessary when crop image is within a hidden element when page is loaded.
if ($origimg[0].width != 0 && $origimg[0].height != 0) {
// Obtain dimensions from contained img element.
$origimg.width($origimg[0].width);
$origimg.height($origimg[0].height);
} else {
// Obtain dimensions from temporary image in case the original is not loaded yet (e.g. IE 7.0).
var tempImage = new Image();
tempImage.src = $origimg[0].src;
$origimg.width(tempImage.width);
$origimg.height(tempImage.height);
}
var $img = $origimg.clone().removeAttr('id').css(img_css).show();
$img.width($origimg.width());
$img.height($origimg.height());
$origimg.after($img).hide();
} else {
$img = $origimg.css(img_css).show();
img_mode = false;
if (options.shade === null) { options.shade = true; }
}
presize($img, options.boxWidth, options.boxHeight);
var boundx = $img.width(),
boundy = $img.height(),
$div = $('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({
position: 'relative',
backgroundColor: options.bgColor
}).insertAfter($origimg).append($img);
if (options.addClass) {
$div.addClass(options.addClass);
}
var $img2 = $('<div />'),
$img_holder = $('<div />')
.width('100%').height('100%').css({
zIndex: 310,
position: 'absolute',
overflow: 'hidden'
}),
$hdl_holder = $('<div />')
.width('100%').height('100%').css('zIndex', 320),
$sel = $('<div />')
.css({
position: 'absolute',
zIndex: 600
}).dblclick(function(){
var c = Coords.getFixed();
options.onDblClick.call(api,c);
}).insertBefore($img).append($img_holder, $hdl_holder);
if (img_mode) {
$img2 = $('<img />')
.attr('src', $img.attr('src')).css(img_css).width(boundx).height(boundy),
$img_holder.append($img2);
}
if (ie6mode) {
$sel.css({
overflowY: 'hidden'
});
}
var bound = options.boundary;
var $trk = newTracker().width(boundx + (bound * 2)).height(boundy + (bound * 2)).css({
position: 'absolute',
top: px(-bound),
left: px(-bound),
zIndex: 290
}).mousedown(newSelection);
/* }}} */
// Set more variables {{{
var bgcolor = options.bgColor,
bgopacity = options.bgOpacity,
xlimit, ylimit, xmin, ymin, xscale, yscale, enabled = true,
btndown, animating, shift_down;
docOffset = getPos($img);
// }}}
// }}}
// Internal Modules {{{
// Touch Module {{{
var Touch = (function () {
// Touch support detection function adapted (under MIT License)
// from code by Jeffrey Sambells - http://github.com/iamamused/
function hasTouchSupport() {
var support = {}, events = ['touchstart', 'touchmove', 'touchend'],
el = document.createElement('div'), i;
try {
for(i=0; i<events.length; i++) {
var eventName = events[i];
eventName = 'on' + eventName;
var isSupported = (eventName in el);
if (!isSupported) {
el.setAttribute(eventName, 'return;');
isSupported = typeof el[eventName] == 'function';
}
support[events[i]] = isSupported;
}
return support.touchstart && support.touchend && support.touchmove;
}
catch(err) {
return false;
}
}
function detectSupport() {
if ((options.touchSupport === true) || (options.touchSupport === false)) return options.touchSupport;
else return hasTouchSupport();
}
return {
createDragger: function (ord) {
return function (e) {
if (options.disabled) {
return false;
}
if ((ord === 'move') && !options.allowMove) {
return false;
}
docOffset = getPos($img);
btndown = true;
startDragMode(ord, mouseAbs(Touch.cfilter(e)), true);
e.stopPropagation();
e.preventDefault();
return false;
};
},
newSelection: function (e) {
return newSelection(Touch.cfilter(e));
},
cfilter: function (e){
e.pageX = e.originalEvent.changedTouches[0].pageX;
e.pageY = e.originalEvent.changedTouches[0].pageY;
return e;
},
isSupported: hasTouchSupport,
support: detectSupport()
};
}());
// }}}
// Coords Module {{{
var Coords = (function () {
var x1 = 0,
y1 = 0,
x2 = 0,
y2 = 0,
ox, oy;
function setPressed(pos) //{{{
{
pos = rebound(pos);
x2 = x1 = pos[0];
y2 = y1 = pos[1];
}
//}}}
function setCurrent(pos) //{{{
{
pos = rebound(pos);
ox = pos[0] - x2;
oy = pos[1] - y2;
x2 = pos[0];
y2 = pos[1];
}
//}}}
function getOffset() //{{{
{
return [ox, oy];
}
//}}}
function moveOffset(offset) //{{{
{
var ox = offset[0],
oy = offset[1];
if (0 > x1 + ox) {
ox -= ox + x1;
}
if (0 > y1 + oy) {
oy -= oy + y1;
}
if (boundy < y2 + oy) {
oy += boundy - (y2 + oy);
}
if (boundx < x2 + ox) {
ox += boundx - (x2 + ox);
}
x1 += ox;
x2 += ox;
y1 += oy;
y2 += oy;
}
//}}}
function getCorner(ord) //{{{
{
var c = getFixed();
switch (ord) {
case 'ne':
return [c.x2, c.y];
case 'nw':
return [c.x, c.y];
case 'se':
return [c.x2, c.y2];
case 'sw':
return [c.x, c.y2];
}
}
//}}}
function getFixed() //{{{
{
if (!options.aspectRatio) {
return getRect();
}
// This function could use some optimization I think...
var aspect = options.aspectRatio,
min_x = options.minSize[0] / xscale,
//min_y = options.minSize[1]/yscale,
max_x = options.maxSize[0] / xscale,
max_y = options.maxSize[1] / yscale,
rw = x2 - x1,
rh = y2 - y1,
rwa = Math.abs(rw),
rha = Math.abs(rh),
real_ratio = rwa / rha,
xx, yy, w, h;
if (max_x === 0) {
max_x = boundx * 10;
}
if (max_y === 0) {
max_y = boundy * 10;
}
if (real_ratio < aspect) {
yy = y2;
w = rha * aspect;
xx = rw < 0 ? x1 - w : w + x1;
if (xx < 0) {
xx = 0;
h = Math.abs((xx - x1) / aspect);
yy = rh < 0 ? y1 - h : h + y1;
} else if (xx > boundx) {
xx = boundx;
h = Math.abs((xx - x1) / aspect);
yy = rh < 0 ? y1 - h : h + y1;
}
} else {
xx = x2;
h = rwa / aspect;
yy = rh < 0 ? y1 - h : y1 + h;
if (yy < 0) {
yy = 0;
w = Math.abs((yy - y1) * aspect);
xx = rw < 0 ? x1 - w : w + x1;
} else if (yy > boundy) {
yy = boundy;
w = Math.abs(yy - y1) * aspect;
xx = rw < 0 ? x1 - w : w + x1;
}
}
// Magic %-)
if (xx > x1) { // right side
if (xx - x1 < min_x) {
xx = x1 + min_x;
} else if (xx - x1 > max_x) {
xx = x1 + max_x;
}
if (yy > y1) {
yy = y1 + (xx - x1) / aspect;
} else {
yy = y1 - (xx - x1) / aspect;
}
} else if (xx < x1) { // left side
if (x1 - xx < min_x) {
xx = x1 - min_x;
} else if (x1 - xx > max_x) {
xx = x1 - max_x;
}
if (yy > y1) {
yy = y1 + (x1 - xx) / aspect;
} else {
yy = y1 - (x1 - xx) / aspect;
}
}
if (xx < 0) {
x1 -= xx;
xx = 0;
} else if (xx > boundx) {
x1 -= xx - boundx;
xx = boundx;
}
if (yy < 0) {
y1 -= yy;
yy = 0;
} else if (yy > boundy) {
y1 -= yy - boundy;
yy = boundy;
}
return makeObj(flipCoords(x1, y1, xx, yy));
}
//}}}
function rebound(p) //{{{
{
if (p[0] < 0) p[0] = 0;
if (p[1] < 0) p[1] = 0;
if (p[0] > boundx) p[0] = boundx;
if (p[1] > boundy) p[1] = boundy;
return [Math.round(p[0]), Math.round(p[1])];
}
//}}}
function flipCoords(x1, y1, x2, y2) //{{{
{
var xa = x1,
xb = x2,
ya = y1,
yb = y2;
if (x2 < x1) {
xa = x2;
xb = x1;
}
if (y2 < y1) {
ya = y2;
yb = y1;
}
return [xa, ya, xb, yb];
}
//}}}
function getRect() //{{{
{
var xsize = x2 - x1,
ysize = y2 - y1,
delta;
if (xlimit && (Math.abs(xsize) > xlimit)) {
x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);
}
if (ylimit && (Math.abs(ysize) > ylimit)) {
y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);
}
if (ymin / yscale && (Math.abs(ysize) < ymin / yscale)) {
y2 = (ysize > 0) ? (y1 + ymin / yscale) : (y1 - ymin / yscale);
}
if (xmin / xscale && (Math.abs(xsize) < xmin / xscale)) {
x2 = (xsize > 0) ? (x1 + xmin / xscale) : (x1 - xmin / xscale);
}
if (x1 < 0) {
x2 -= x1;
x1 -= x1;
}
if (y1 < 0) {
y2 -= y1;
y1 -= y1;
}
if (x2 < 0) {
x1 -= x2;
x2 -= x2;
}
if (y2 < 0) {
y1 -= y2;
y2 -= y2;
}
if (x2 > boundx) {
delta = x2 - boundx;
x1 -= delta;
x2 -= delta;
}
if (y2 > boundy) {
delta = y2 - boundy;
y1 -= delta;
y2 -= delta;
}
if (x1 > boundx) {
delta = x1 - boundy;
y2 -= delta;
y1 -= delta;
}
if (y1 > boundy) {
delta = y1 - boundy;
y2 -= delta;
y1 -= delta;
}
return makeObj(flipCoords(x1, y1, x2, y2));
}
//}}}
function makeObj(a) //{{{
{
return {
x: a[0],
y: a[1],
x2: a[2],
y2: a[3],
w: a[2] - a[0],
h: a[3] - a[1]
};
}
//}}}
return {
flipCoords: flipCoords,
setPressed: setPressed,
setCurrent: setCurrent,
getOffset: getOffset,
moveOffset: moveOffset,
getCorner: getCorner,
getFixed: getFixed
};
}());
//}}}
// Shade Module {{{
var Shade = (function() {
var enabled = false,
holder = $('<div />').css({
position: 'absolute',
zIndex: 240,
opacity: 0
}),
shades = {
top: createShade(),
left: createShade().height(boundy),
right: createShade().height(boundy),
bottom: createShade()
};
function resizeShades(w,h) {
shades.left.css({ height: px(h) });
shades.right.css({ height: px(h) });
}
function updateAuto()
{
return updateShade(Coords.getFixed());
}
function updateShade(c)
{
shades.top.css({
left: px(c.x),
width: px(c.w),
height: px(c.y)
});
shades.bottom.css({
top: px(c.y2),
left: px(c.x),
width: px(c.w),
height: px(boundy-c.y2)
});
shades.right.css({
left: px(c.x2),
width: px(boundx-c.x2)
});
shades.left.css({
width: px(c.x)
});
}
function createShade() {
return $('<div />').css({
position: 'absolute',
backgroundColor: options.shadeColor||options.bgColor
}).appendTo(holder);
}
function enableShade() {
if (!enabled) {
enabled = true;
holder.insertBefore($img);
updateAuto();
Selection.setBgOpacity(1,0,1);
$img2.hide();
setBgColor(options.shadeColor||options.bgColor,1);
if (Selection.isAwake())
{
setOpacity(options.bgOpacity,1);
}
else setOpacity(1,1);
}
}
function setBgColor(color,now) {
colorChangeMacro(getShades(),color,now);
}
function disableShade() {
if (enabled) {
holder.remove();
$img2.show();
enabled = false;
if (Selection.isAwake()) {
Selection.setBgOpacity(options.bgOpacity,1,1);
} else {
Selection.setBgOpacity(1,1,1);
Selection.disableHandles();
}
colorChangeMacro($div,0,1);
}
}
function setOpacity(opacity,now) {
if (enabled) {
if (options.bgFade && !now) {
holder.animate({
opacity: 1-opacity
},{
queue: false,
duration: options.fadeTime
});
}
else holder.css({opacity:1-opacity});
}
}
function refreshAll() {
options.shade ? enableShade() : disableShade();
if (Selection.isAwake()) setOpacity(options.bgOpacity);
}
function getShades() {
return holder.children();
}
return {
update: updateAuto,
updateRaw: updateShade,
getShades: getShades,
setBgColor: setBgColor,
enable: enableShade,
disable: disableShade,
resize: resizeShades,
refresh: refreshAll,
opacity: setOpacity
};
}());
// }}}
// Selection Module {{{
var Selection = (function () {
var awake,
hdep = 370,
borders = {},
handle = {},
dragbar = {},
seehandles = false;
// Private Methods
function insertBorder(type) //{{{
{
var jq = $('<div />').css({
position: 'absolute',
opacity: options.borderOpacity
}).addClass(cssClass(type));
$img_holder.append(jq);
return jq;
}
//}}}
function dragDiv(ord, zi) //{{{
{
var jq = $('<div />').mousedown(createDragger(ord)).css({
cursor: ord + '-resize',
position: 'absolute',
zIndex: zi
}).addClass('ord-'+ord);
if (Touch.support) {
jq.bind('touchstart.jcrop', Touch.createDragger(ord));
}
$hdl_holder.append(jq);
return jq;
}
//}}}
function insertHandle(ord) //{{{
{
var hs = options.handleSize,
div = dragDiv(ord, hdep++).css({
opacity: options.handleOpacity
}).addClass(cssClass('handle'));
if (hs) { div.width(hs).height(hs); }
return div;
}
//}}}
function insertDragbar(ord) //{{{
{
return dragDiv(ord, hdep++).addClass('jcrop-dragbar');
}
//}}}
function createDragbars(li) //{{{
{
var i;
for (i = 0; i < li.length; i++) {
dragbar[li[i]] = insertDragbar(li[i]);
}
}
//}}}
function createBorders(li) //{{{
{
var cl,i;
for (i = 0; i < li.length; i++) {
switch(li[i]){
case'n': cl='hline'; break;
case's': cl='hline bottom'; break;
case'e': cl='vline right'; break;
case'w': cl='vline'; break;
}
borders[li[i]] = insertBorder(cl);
}
}
//}}}
function createHandles(li) //{{{
{
var i;
for (i = 0; i < li.length; i++) {
handle[li[i]] = insertHandle(li[i]);
}
}
//}}}
function moveto(x, y) //{{{
{
if (!options.shade) {
$img2.css({
top: px(-y),
left: px(-x)
});
}
$sel.css({
top: px(y),
left: px(x)
});
}
//}}}
function resize(w, h) //{{{
{
$sel.width(Math.round(w)).height(Math.round(h));
}
//}}}
function refresh() //{{{
{
var c = Coords.getFixed();
Coords.setPressed([c.x, c.y]);
Coords.setCurrent([c.x2, c.y2]);
updateVisible();
}
//}}}
// Internal Methods
function updateVisible(select) //{{{
{
if (awake) {
return update(select);
}
}
//}}}
function update(select) //{{{
{
var c = Coords.getFixed();
resize(c.w, c.h);
moveto(c.x, c.y);
if (options.shade) Shade.updateRaw(c);
awake || show();
if (select) {
options.onSelect.call(api, unscale(c));
} else {
options.onChange.call(api, unscale(c));
}
}
//}}}
function setBgOpacity(opacity,force,now) //{{{
{
if (!awake && !force) return;
if (options.bgFade && !now) {
$img.animate({
opacity: opacity
},{
queue: false,
duration: options.fadeTime
});
} else {
$img.css('opacity', opacity);
}
}
//}}}
function show() //{{{
{
$sel.show();
if (options.shade) Shade.opacity(bgopacity);
else setBgOpacity(bgopacity,true);
awake = true;
}
//}}}
function release() //{{{
{
disableHandles();
$sel.hide();
if (options.shade) Shade.opacity(1);
else setBgOpacity(1);
awake = false;
options.onRelease.call(api);
}
//}}}
function showHandles() //{{{
{
if (seehandles) {
$hdl_holder.show();
}
}
//}}}
function enableHandles() //{{{
{
seehandles = true;
if (options.allowResize) {
$hdl_holder.show();
return true;
}
}
//}}}
function disableHandles() //{{{
{
seehandles = false;
$hdl_holder.hide();
}
//}}}
function animMode(v) //{{{
{
if (v) {
animating = true;
disableHandles();
} else {
animating = false;
enableHandles();
}
}
//}}}
function done() //{{{
{
animMode(false);
refresh();
}
//}}}
// Insert draggable elements {{{
// Insert border divs for outline
if (options.dragEdges && $.isArray(options.createDragbars))
createDragbars(options.createDragbars);
if ($.isArray(options.createHandles))
createHandles(options.createHandles);
if (options.drawBorders && $.isArray(options.createBorders))
createBorders(options.createBorders);
//}}}
// This is a hack for iOS5 to support drag/move touch functionality
$(document).bind('touchstart.jcrop-ios',function(e) {
if ($(e.currentTarget).hasClass('jcrop-tracker')) e.stopPropagation();
});
var $track = newTracker().mousedown(createDragger('move')).css({
cursor: 'move',
position: 'absolute',
zIndex: 360
});
if (Touch.support) {
$track.bind('touchstart.jcrop', Touch.createDragger('move'));
}
$img_holder.append($track);
disableHandles();
return {
updateVisible: updateVisible,
update: update,
release: release,
refresh: refresh,
isAwake: function () {
return awake;
},
setCursor: function (cursor) {
$track.css('cursor', cursor);
},
enableHandles: enableHandles,
enableOnly: function () {
seehandles = true;
},
showHandles: showHandles,
disableHandles: disableHandles,
animMode: animMode,
setBgOpacity: setBgOpacity,
done: done
};
}());
//}}}
// Tracker Module {{{
var Tracker = (function () {
var onMove = function () {},
onDone = function () {},
trackDoc = options.trackDocument;
function toFront(touch) //{{{
{
$trk.css({
zIndex: 450
});
if (touch)
$(document)
.bind('touchmove.jcrop', trackTouchMove)
.bind('touchend.jcrop', trackTouchEnd);
else if (trackDoc)
$(document)
.bind('mousemove.jcrop',trackMove)
.bind('mouseup.jcrop',trackUp);
}
//}}}
function toBack() //{{{
{
$trk.css({
zIndex: 290
});
$(document).unbind('.jcrop');
}
//}}}
function trackMove(e) //{{{
{
onMove(mouseAbs(e));
return false;
}
//}}}
function trackUp(e) //{{{
{
e.preventDefault();
e.stopPropagation();
if (btndown) {
btndown = false;
onDone(mouseAbs(e));
if (Selection.isAwake()) {
options.onSelect.call(api, unscale(Coords.getFixed()));
}
toBack();
onMove = function () {};
onDone = function () {};
}
return false;
}
//}}}
function activateHandlers(move, done, touch) //{{{
{
btndown = true;
onMove = move;
onDone = done;
toFront(touch);
return false;
}
//}}}
function trackTouchMove(e) //{{{
{
onMove(mouseAbs(Touch.cfilter(e)));
return false;
}
//}}}
function trackTouchEnd(e) //{{{
{
return trackUp(Touch.cfilter(e));
}
//}}}
function setCursor(t) //{{{
{
$trk.css('cursor', t);
}
//}}}
if (!trackDoc) {
$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);
}
$img.before($trk);
return {
activateHandlers: activateHandlers,
setCursor: setCursor
};
}());
//}}}
// KeyManager Module {{{
var KeyManager = (function () {
var $keymgr = $('<input type="radio" />').css({
position: 'fixed',
left: '-120px',
width: '12px'
}).addClass('jcrop-keymgr'),
$keywrap = $('<div />').css({
position: 'absolute',
overflow: 'hidden'
}).append($keymgr);
function watchKeys() //{{{
{
if (options.keySupport) {
$keymgr.show();
$keymgr.focus();
}
}
//}}}
function onBlur(e) //{{{
{
$keymgr.hide();
}
//}}}
function doNudge(e, x, y) //{{{
{
if (options.allowMove) {
Coords.moveOffset([x, y]);
Selection.updateVisible(true);
}
e.preventDefault();
e.stopPropagation();
}
//}}}
function parseKey(e) //{{{
{
if (e.ctrlKey || e.metaKey) {
return true;
}
shift_down = e.shiftKey ? true : false;
var nudge = shift_down ? 10 : 1;
switch (e.keyCode) {
case 37:
doNudge(e, -nudge, 0);
break;
case 39:
doNudge(e, nudge, 0);
break;
case 38:
doNudge(e, 0, -nudge);
break;
case 40:
doNudge(e, 0, nudge);
break;
case 27:
if (options.allowSelect) Selection.release();
break;
case 9:
return true;
}
return false;
}
//}}}
if (options.keySupport) {
$keymgr.keydown(parseKey).blur(onBlur);
if (ie6mode || !options.fixedSupport) {
$keymgr.css({
position: 'absolute',
left: '-20px'
});
$keywrap.append($keymgr).insertBefore($img);
} else {
$keymgr.insertBefore($img);
}
}
return {
watchKeys: watchKeys
};
}());
//}}}
// }}}
// API methods {{{
function setClass(cname) //{{{
{
$div.removeClass().addClass(cssClass('holder')).addClass(cname);
}
//}}}
function animateTo(a, callback) //{{{
{
var x1 = a[0] / xscale,
y1 = a[1] / yscale,
x2 = a[2] / xscale,
y2 = a[3] / yscale;
if (animating) {
return;
}
var animto = Coords.flipCoords(x1, y1, x2, y2),
c = Coords.getFixed(),
initcr = [c.x, c.y, c.x2, c.y2],
animat = initcr,
interv = options.animationDelay,
ix1 = animto[0] - initcr[0],
iy1 = animto[1] - initcr[1],
ix2 = animto[2] - initcr[2],
iy2 = animto[3] - initcr[3],
pcent = 0,
velocity = options.swingSpeed;
x1 = animat[0];
y1 = animat[1];
x2 = animat[2];
y2 = animat[3];
Selection.animMode(true);
var anim_timer;
function queueAnimator() {
window.setTimeout(animator, interv);
}
var animator = (function () {
return function () {
pcent += (100 - pcent) / velocity;
animat[0] = Math.round(x1 + ((pcent / 100) * ix1));
animat[1] = Math.round(y1 + ((pcent / 100) * iy1));
animat[2] = Math.round(x2 + ((pcent / 100) * ix2));
animat[3] = Math.round(y2 + ((pcent / 100) * iy2));
if (pcent >= 99.8) {
pcent = 100;
}
if (pcent < 100) {
setSelectRaw(animat);
queueAnimator();
} else {
Selection.done();
Selection.animMode(false);
if (typeof(callback) === 'function') {
callback.call(api);
}
}
};
}());
queueAnimator();
}
//}}}
function setSelect(rect) //{{{
{
setSelectRaw([rect[0] / xscale, rect[1] / yscale, rect[2] / xscale, rect[3] / yscale]);
options.onSelect.call(api, unscale(Coords.getFixed()));
Selection.enableHandles();
}
//}}}
function setSelectRaw(l) //{{{
{
Coords.setPressed([l[0], l[1]]);
Coords.setCurrent([l[2], l[3]]);
Selection.update();
}
//}}}
function tellSelect() //{{{
{
return unscale(Coords.getFixed());
}
//}}}
function tellScaled() //{{{
{
return Coords.getFixed();
}
//}}}
function setOptionsNew(opt) //{{{
{
setOptions(opt);
interfaceUpdate();
}
//}}}
function disableCrop() //{{{
{
options.disabled = true;
Selection.disableHandles();
Selection.setCursor('default');
Tracker.setCursor('default');
}
//}}}
function enableCrop() //{{{
{
options.disabled = false;
interfaceUpdate();
}
//}}}
function cancelCrop() //{{{
{
Selection.done();
Tracker.activateHandlers(null, null);
}
//}}}
function destroy() //{{{
{
$div.remove();
$origimg.show();
$origimg.css('visibility','visible');
$(obj).removeData('Jcrop');
}
//}}}
function setImage(src, callback) //{{{
{
Selection.release();
disableCrop();
var img = new Image();
img.onload = function () {
var iw = img.width;
var ih = img.height;
var bw = options.boxWidth;
var bh = options.boxHeight;
$img.width(iw).height(ih);
$img.attr('src', src);
$img2.attr('src', src);
presize($img, bw, bh);
boundx = $img.width();
boundy = $img.height();
$img2.width(boundx).height(boundy);
$trk.width(boundx + (bound * 2)).height(boundy + (bound * 2));
$div.width(boundx).height(boundy);
Shade.resize(boundx,boundy);
enableCrop();
if (typeof(callback) === 'function') {
callback.call(api);
}
};
img.src = src;
}
//}}}
function colorChangeMacro($obj,color,now) {
var mycolor = color || options.bgColor;
if (options.bgFade && supportsColorFade() && options.fadeTime && !now) {
$obj.animate({
backgroundColor: mycolor
}, {
queue: false,
duration: options.fadeTime
});
} else {
$obj.css('backgroundColor', mycolor);
}
}
function interfaceUpdate(alt) //{{{
// This method tweaks the interface based on options object.
// Called when options are changed and at end of initialization.
{
if (options.allowResize) {
if (alt) {
Selection.enableOnly();
} else {
Selection.enableHandles();
}
} else {
Selection.disableHandles();
}
Tracker.setCursor(options.allowSelect ? 'crosshair' : 'default');
Selection.setCursor(options.allowMove ? 'move' : 'default');
if (options.hasOwnProperty('trueSize')) {
xscale = options.trueSize[0] / boundx;
yscale = options.trueSize[1] / boundy;
}
if (options.hasOwnProperty('setSelect')) {
setSelect(options.setSelect);
Selection.done();
delete(options.setSelect);
}
Shade.refresh();
if (options.bgColor != bgcolor) {
colorChangeMacro(
options.shade? Shade.getShades(): $div,
options.shade?
(options.shadeColor || options.bgColor):
options.bgColor
);
bgcolor = options.bgColor;
}
if (bgopacity != options.bgOpacity) {
bgopacity = options.bgOpacity;
if (options.shade) Shade.refresh();
else Selection.setBgOpacity(bgopacity);
}
xlimit = options.maxSize[0] || 0;
ylimit = options.maxSize[1] || 0;
xmin = options.minSize[0] || 0;
ymin = options.minSize[1] || 0;
if (options.hasOwnProperty('outerImage')) {
$img.attr('src', options.outerImage);
delete(options.outerImage);
}
Selection.refresh();
}
//}}}
//}}}
if (Touch.support) $trk.bind('touchstart.jcrop', Touch.newSelection);
$hdl_holder.hide();
interfaceUpdate(true);
var api = {
setImage: setImage,
animateTo: animateTo,
setSelect: setSelect,
setOptions: setOptionsNew,
tellSelect: tellSelect,
tellScaled: tellScaled,
setClass: setClass,
disable: disableCrop,
enable: enableCrop,
cancel: cancelCrop,
release: Selection.release,
destroy: destroy,
focus: KeyManager.watchKeys,
getBounds: function () {
return [boundx * xscale, boundy * yscale];
},
getWidgetSize: function () {
return [boundx, boundy];
},
getScaleFactor: function () {
return [xscale, yscale];
},
getOptions: function() {
// careful: internal values are returned
return options;
},
ui: {
holder: $div,
selection: $sel
}
};
if (is_msie) $div.bind('selectstart', function () { return false; });
$origimg.data('Jcrop', api);
return api;
};
$.fn.Jcrop = function (options, callback) //{{{
{
var api;
// Iterate over each object, attach Jcrop
this.each(function () {
// If we've already attached to this object
if ($(this).data('Jcrop')) {
// The API can be requested this way (undocumented)
if (options === 'api') return $(this).data('Jcrop');
// Otherwise, we just reset the options...
else $(this).data('Jcrop').setOptions(options);
}
// If we haven't been attached, preload and attach
else {
if (this.tagName == 'IMG')
$.Jcrop.Loader(this,function(){
$(this).css({display:'block',visibility:'hidden'});
api = $.Jcrop(this, options);
if ($.isFunction(callback)) callback.call(api);
});
else {
$(this).css({display:'block',visibility:'hidden'});
api = $.Jcrop(this, options);
if ($.isFunction(callback)) callback.call(api);
}
}
});
// Return "this" so the object is chainable (jQuery-style)
return this;
};
//}}}
// $.Jcrop.Loader - basic image loader {{{
$.Jcrop.Loader = function(imgobj,success,error){
var $img = $(imgobj), img = $img[0];
function completeCheck(){
if (img.complete) {
$img.unbind('.jcloader');
if ($.isFunction(success)) success.call(img);
}
else window.setTimeout(completeCheck,50);
}
$img
.bind('load.jcloader',completeCheck)
.bind('error.jcloader',function(e){
$img.unbind('.jcloader');
if ($.isFunction(error)) error.call(img);
});
if (img.complete && $.isFunction(success)){
$img.unbind('.jcloader');
success.call(img);
}
};
//}}}
// Global Defaults {{{
$.Jcrop.defaults = {
// Basic Settings
allowSelect: true,
allowMove: true,
allowResize: true,
trackDocument: true,
// Styling Options
baseClass: 'jcrop',
addClass: null,
bgColor: 'black',
bgOpacity: 0.6,
bgFade: false,
borderOpacity: 0.4,
handleOpacity: 0.5,
handleSize: null,
aspectRatio: 0,
keySupport: true,
createHandles: ['n','s','e','w','nw','ne','se','sw'],
createDragbars: ['n','s','e','w'],
createBorders: ['n','s','e','w'],
drawBorders: true,
dragEdges: true,
fixedSupport: true,
touchSupport: null,
shade: null,
boxWidth: 0,
boxHeight: 0,
boundary: 2,
fadeTime: 400,
animationDelay: 20,
swingSpeed: 3,
minSelect: [0, 0],
maxSize: [0, 0],
minSize: [0, 0],
// Callbacks / Event Handlers
onChange: function () {},
onSelect: function () {},
onDblClick: function () {},
onRelease: function () {}
};
// }}}
}(jQuery));
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/jcrop/jquery.Jcrop.js | JavaScript | asf20 | 42,434 |
/* jquery.Jcrop.css v0.9.12 - MIT License */
/*
The outer-most container in a typical Jcrop instance
If you are having difficulty with formatting related to styles
on a parent element, place any fixes here or in a like selector
You can also style this element if you want to add a border, etc
A better method for styling can be seen below with .jcrop-light
(Add a class to the holder and style elements for that extended class)
*/
.jcrop-holder {
direction: ltr;
text-align: left;
}
/* Selection Border */
.jcrop-vline,
.jcrop-hline {
background: #ffffff url("Jcrop.gif");
font-size: 0;
position: absolute;
}
.jcrop-vline {
height: 100%;
width: 1px !important;
}
.jcrop-vline.right {
right: 0;
}
.jcrop-hline {
height: 1px !important;
width: 100%;
}
.jcrop-hline.bottom {
bottom: 0;
}
/* Invisible click targets */
.jcrop-tracker {
height: 100%;
width: 100%;
/* "turn off" link highlight */
-webkit-tap-highlight-color: transparent;
/* disable callout, image save panel */
-webkit-touch-callout: none;
/* disable cut copy paste */
-webkit-user-select: none;
}
/* Selection Handles */
.jcrop-handle {
background-color: #333333;
border: 1px #eeeeee solid;
width: 7px;
height: 7px;
font-size: 1px;
}
.jcrop-handle.ord-n {
left: 50%;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-s {
bottom: 0;
left: 50%;
margin-bottom: -4px;
margin-left: -4px;
}
.jcrop-handle.ord-e {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 50%;
}
.jcrop-handle.ord-w {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 50%;
}
.jcrop-handle.ord-nw {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-ne {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 0;
}
.jcrop-handle.ord-se {
bottom: 0;
margin-bottom: -4px;
margin-right: -4px;
right: 0;
}
.jcrop-handle.ord-sw {
bottom: 0;
left: 0;
margin-bottom: -4px;
margin-left: -4px;
}
/* Dragbars */
.jcrop-dragbar.ord-n,
.jcrop-dragbar.ord-s {
height: 7px;
width: 100%;
}
.jcrop-dragbar.ord-e,
.jcrop-dragbar.ord-w {
height: 100%;
width: 7px;
}
.jcrop-dragbar.ord-n {
margin-top: -4px;
}
.jcrop-dragbar.ord-s {
bottom: 0;
margin-bottom: -4px;
}
.jcrop-dragbar.ord-e {
margin-right: -4px;
right: 0;
}
.jcrop-dragbar.ord-w {
margin-left: -4px;
}
/* The "jcrop-light" class/extension */
.jcrop-light .jcrop-vline,
.jcrop-light .jcrop-hline {
background: #ffffff;
filter: alpha(opacity=70) !important;
opacity: .70!important;
}
.jcrop-light .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #000000;
border-color: #ffffff;
border-radius: 3px;
}
/* The "jcrop-dark" class/extension */
.jcrop-dark .jcrop-vline,
.jcrop-dark .jcrop-hline {
background: #000000;
filter: alpha(opacity=70) !important;
opacity: 0.7 !important;
}
.jcrop-dark .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #ffffff;
border-color: #000000;
border-radius: 3px;
}
/* Simple macro to turn off the antlines */
.solid-line .jcrop-vline,
.solid-line .jcrop-hline {
background: #ffffff;
}
/* Fix for twitter bootstrap et al. */
.jcrop-holder img,
img.jcrop-preview {
max-width: none;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/jcrop/css/jquery.Jcrop.css | CSS | asf20 | 3,280 |
/*!
* jQuery UI Widget 1.8.5
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Widget
*/
(function( $, undefined ) {
// jQuery 1.4+
if ( $.cleanData ) {
var _cleanData = $.cleanData;
$.cleanData = function( elems ) {
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
$( elem ).triggerHandler( "remove" );
}
_cleanData( elems );
};
} else {
var _remove = $.fn.remove;
$.fn.remove = function( selector, keepData ) {
return this.each(function() {
if ( !keepData ) {
if ( !selector || $.filter( selector, [ this ] ).length ) {
$( "*", this ).add( [ this ] ).each(function() {
$( this ).triggerHandler( "remove" );
});
}
}
return _remove.call( $(this), selector, keepData );
});
};
}
$.widget = function( name, base, prototype ) {
var namespace = name.split( "." )[ 0 ],
fullName;
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName ] = function( elem ) {
return !!$.data( elem, name );
};
$[ namespace ] = $[ namespace ] || {};
$[ namespace ][ name ] = function( options, element ) {
// allow instantiation without initializing for simple inheritance
if ( arguments.length ) {
this._createWidget( options, element );
}
};
var basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
// $.each( basePrototype, function( key, val ) {
// if ( $.isPlainObject(val) ) {
// basePrototype[ key ] = $.extend( {}, val );
// }
// });
basePrototype.options = $.extend( true, {}, basePrototype.options );
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
namespace: namespace,
widgetName: name,
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
widgetBaseClass: fullName
}, prototype );
$.widget.bridge( name, $[ namespace ][ name ] );
};
$.widget.bridge = function( name, object ) {
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = Array.prototype.slice.call( arguments, 1 ),
returnValue = this;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.extend.apply( null, [ true, options ].concat(args) ) :
options;
// prevent calls to internal methods
if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
return returnValue;
}
if ( isMethodCall ) {
this.each(function() {
var instance = $.data( this, name );
if ( !instance ) {
throw "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'";
}
if ( !$.isFunction( instance[options] ) ) {
throw "no such method '" + options + "' for " + name + " widget instance";
}
var methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue;
return false;
}
});
} else {
this.each(function() {
var instance = $.data( this, name );
if ( instance ) {
instance.option( options || {} )._init();
} else {
$.data( this, name, new object( options, this ) );
}
});
}
return returnValue;
};
};
$.Widget = function( options, element ) {
// allow instantiation without initializing for simple inheritance
if ( arguments.length ) {
this._createWidget( options, element );
}
};
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
options: {
disabled: false
},
_createWidget: function( options, element ) {
// $.widget.bridge stores the plugin instance, but we do it anyway
// so that it's stored even before the _create function runs
$.data( element, this.widgetName, this );
this.element = $( element );
this.options = $.extend( true, {},
this.options,
$.metadata && $.metadata.get( element )[ this.widgetName ],
options );
var self = this;
this.element.bind( "remove." + this.widgetName, function() {
self.destroy();
});
this._create();
this._init();
},
_create: function() {},
_init: function() {},
destroy: function() {
this.element
.unbind( "." + this.widgetName )
.removeData( this.widgetName );
this.widget()
.unbind( "." + this.widgetName )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetBaseClass + "-disabled " +
"ui-state-disabled" );
},
widget: function() {
return this.element;
},
option: function( key, value ) {
var options = key,
self = this;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.extend( {}, self.options );
}
if (typeof key === "string" ) {
if ( value === undefined ) {
return this.options[ key ];
}
options = {};
options[ key ] = value;
}
$.each( options, function( key, value ) {
self._setOption( key, value );
});
return self;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if ( key === "disabled" ) {
this.widget()
[ value ? "addClass" : "removeClass"](
this.widgetBaseClass + "-disabled" + " " +
"ui-state-disabled" )
.attr( "aria-disabled", value );
}
return this;
},
enable: function() {
return this._setOption( "disabled", false );
},
disable: function() {
return this._setOption( "disabled", true );
},
_trigger: function( type, event, data ) {
var callback = this.options[ type ];
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
data = data || {};
// copy original event properties over to the new event
// this would happen if we could call $.event.fix instead of $.Event
// but we don't have a way to force an event to be fixed multiple times
if ( event.originalEvent ) {
for ( var i = $.event.props.length, prop; i; ) {
prop = $.event.props[ --i ];
event[ prop ] = event.originalEvent[ prop ];
}
}
this.element.trigger( event, data );
return !( $.isFunction(callback) &&
callback.call( this.element[0], event, data ) === false ||
event.isDefaultPrevented() );
}
};
})( jQuery );
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/widget.js | JavaScript | asf20 | 6,456 |
function setCheckboxes(the_form, id, do_check)
{
var elts = (typeof(document.forms[the_form].elements[id]) != 'undefined')
? document.forms[the_form].elements[id]
: 0;
var elts_cnt = (typeof(elts.length) != 'undefined')
? elts.length
: 0;
if (elts_cnt) {
for (var i = 0; i < elts_cnt; i++) {
elts[i].checked = do_check;
}
} else {
elts.checked = do_check;
}
return true;
}
function setCheckboxesRight(the_form, total_num, do_check)
{
var form = document.forms[the_form];
for(var i=0;i<total_num;i++){
form.elements['fc_'+i].checked=do_check;
for(x in arr_pm_code){
form.elements['arr_permission['+i+']['+arr_pm_code[x]+']'].checked=do_check;
}
/*form.elements['arr_right['+i+'][right_add]'].checked=do_check;
form.elements['arr_right['+i+'][right_modify]'].checked=do_check;
form.elements['arr_right['+i+'][right_delete]'].checked=do_check;
form.elements['arr_right['+i+'][right_remove]'].checked=do_check;
form.elements['arr_right['+i+'][right_restore]'].checked=do_check;
form.elements['arr_right['+i+'][right_search]'].checked=do_check;
form.elements['arr_right['+i+'][right_exp_pdf]'].checked=do_check;
form.elements['arr_right['+i+'][right_exp_exl]'].checked=do_check;*/
}
return true;
}
function setCheckboxesFunction(the_form,row,do_check)
{
var form = document.forms[the_form];
for(x in arr_pm_code){
form.elements['arr_permission['+row+']['+arr_pm_code[x]+']'].checked=do_check;
}
/*form.elements['arr_right['+row+'][right_read]'].checked=do_check;
form.elements['arr_right['+row+'][right_add]'].checked=do_check;
form.elements['arr_right['+row+'][right_modify]'].checked=do_check;
form.elements['arr_right['+row+'][right_delete]'].checked=do_check;
form.elements['arr_right['+row+'][right_remove]'].checked=do_check;
form.elements['arr_right['+row+'][right_restore]'].checked=do_check;
form.elements['arr_right['+row+'][right_search]'].checked=do_check;
form.elements['arr_right['+row+'][right_exp_pdf]'].checked=do_check;
form.elements['arr_right['+row+'][right_exp_exl]'].checked=do_check;*/
return true;
}
function check_chose(id, arid, the_form)
{
var n = $('#'+id+':checked').val();
if(n)
setCheckboxes(the_form, arid, true);
else
setCheckboxes(the_form, arid, false);
}
function get_check_chose(id,the_form){
var arr_value = new Array();
var elts = (typeof(document.forms[the_form].elements[id]) != 'undefined')
? document.forms[the_form].elements[id]
: 0;
var elts_cnt = (typeof(elts.length) != 'undefined')
? elts.length
: 0;
if (elts_cnt) {
for (var i = 0; i < elts_cnt; i++) {
if(elts[i].checked == true){
arr_value.push(elts[i].value);
}
}
}
return arr_value;
}
function check_chose_right(id,total_num,the_form){
var n = $('#'+id+':checked').val();
if(n)
{
setCheckboxesRight(the_form,total_num, true);
}
else{
setCheckboxesRight(the_form,total_num, false);
}
}
function check_chose_function(id,row,the_form){
var n = $('#'+id+':checked').val();
if(n)
{
setCheckboxesFunction(the_form,row, true);
}
else{
setCheckboxesFunction(the_form,row, false);
}
}
function verify_del()
{
return window.confirm("Bạn có muốn xóa các mục này không?\nVui lòng xác nhận.");
}
function verify_delpage()
{
return window.confirm("Bạn muốn xóa trang này?\nVui lòng xác nhận.");
}
function setCheckboxValue(id)
{
if(id.checked)
{
id.value = 1;
}else{
id.value = 0;
}
}
function set_action(form_name,action){
document.forms[form_name].action=action;
}
function verify_copy(str)
{
return window.confirm(str);
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/set_check_box.js | JavaScript | asf20 | 4,186 |
/*
* jQuery Iframe Transport Plugin 1.7
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint unparam: true, nomen: true */
/*global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts three additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
$.ajaxTransport('iframe', function (options) {
if (options.async) {
var form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6.
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="javascript:false;" name="iframe-transport-' +
counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="javascript:false;"></iframe>')
.appendTo(form);
window.setTimeout(function () {
// Removing the form in a setTimeout call
// allows Chrome's developer tools to display
// the response result
form.remove();
}, 0);
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if (options.formData) {
$.each(options.formData, function (index, field) {
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
return fileInputClones[index];
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
});
}
// Appending the file input fields to the hidden form
// removes them from their original location:
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
// enctype must be set as encoding for IE:
.prop('encoding', 'multipart/form-data');
}
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
if (fileInputClones && fileInputClones.length) {
options.fileInput.each(function (index, input) {
var clone = $(fileInputClones[index]);
$(input).prop('name', clone.prop('name'));
clone.replaceWith(input);
});
}
});
form.append(iframe).appendTo(document.body);
},
abort: function () {
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', 'javascript'.concat(':false;'));
}
if (form) {
form.remove();
}
}
};
}
});
// The iframe transport returns the iframe content document as response.
// The following adds converters from iframe to text, json, html, xml
// and script.
// Please note that the Content-Type for JSON responses has to be text/plain
// or text/html, if the browser doesn't include application/json in the
// Accept header, else IE will show a download dialog.
// The Content-Type for XML responses on the other hand has to be always
// application/xml or text/xml, so IE properly parses the XML response.
// See also
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
return iframe && $(iframe[0].body).html();
},
'iframe xml': function (iframe) {
var xmlDoc = iframe && iframe[0];
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html());
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/jquery.iframe-transport.js | JavaScript | asf20 | 10,049 |
/*
* jQuery Iframe Transport Plugin 1.8.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts four additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
// options.initialIframeSrc: the URL of the initial iframe src,
// by default set to "javascript:false;"
$.ajaxTransport('iframe', function (options) {
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="' + initialIframeSrc + '"></iframe>')
.appendTo(form);
window.setTimeout(function () {
// Removing the form in a setTimeout call
// allows Chrome's developer tools to display
// the response result
form.remove();
}, 0);
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if (options.formData) {
$.each(options.formData, function (index, field) {
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
return fileInputClones[index];
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
});
}
// Appending the file input fields to the hidden form
// removes them from their original location:
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
// enctype must be set as encoding for IE:
.prop('encoding', 'multipart/form-data');
// Remove the HTML5 form attribute from the input(s):
options.fileInput.removeAttr('form');
}
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
if (fileInputClones && fileInputClones.length) {
options.fileInput.each(function (index, input) {
var clone = $(fileInputClones[index]);
// Restore the original name and form properties:
$(input)
.prop('name', clone.prop('name'))
.attr('form', clone.attr('form'));
clone.replaceWith(input);
});
}
});
form.append(iframe).appendTo(document.body);
},
abort: function () {
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', initialIframeSrc);
}
if (form) {
form.remove();
}
}
};
}
});
// The iframe transport returns the iframe content document as response.
// The following adds converters from iframe to text, json, html, xml
// and script.
// Please note that the Content-Type for JSON responses has to be text/plain
// or text/html, if the browser doesn't include application/json in the
// Accept header, else IE will show a download dialog.
// The Content-Type for XML responses on the other hand has to be always
// application/xml or text/xml, so IE properly parses the XML response.
// See also
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
return iframe && $(iframe[0].body).html();
},
'iframe xml': function (iframe) {
var xmlDoc = iframe && iframe[0];
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html());
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/js/jquery.iframe-transport.js | JavaScript | asf20 | 10,612 |
/*
* jQuery File Upload Plugin JS Example 8.9.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global $, window */
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/js/main.js | JavaScript | asf20 | 270 |
/*
* jQuery File Upload Plugin Angular JS Example 1.2.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global window, angular */
(function () {
'use strict';
var isOnGitHub = window.location.hostname === 'blueimp.github.io',
url = isOnGitHub ? '//jquery-file-upload.appspot.com/' : 'server/php/';
angular.module('demo', [
'blueimp.fileupload'
])
.config([
'$httpProvider', 'fileUploadProvider',
function ($httpProvider, fileUploadProvider) {
delete $httpProvider.defaults.headers.common['X-Requested-With'];
fileUploadProvider.defaults.redirect = window.location.href.replace(
/\/[^\/]*$/,
'/cors/result.html?%s'
);
if (isOnGitHub) {
// Demo settings:
angular.extend(fileUploadProvider.defaults, {
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
maxFileSize: 5000000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
}
}
])
.controller('DemoFileUploadController', [
'$scope', '$http', '$filter', '$window',
function ($scope, $http) {
$scope.options = {
url: url
};
if (!isOnGitHub) {
$scope.loadingFiles = true;
$http.get(url)
.then(
function (response) {
$scope.loadingFiles = false;
$scope.queue = response.data.files || [];
},
function () {
$scope.loadingFiles = false;
}
);
}
}
])
.controller('FileDestroyController', [
'$scope', '$http',
function ($scope, $http) {
var file = $scope.file,
state;
if (file.url) {
file.$state = function () {
return state;
};
file.$destroy = function () {
state = 'pending';
return $http({
url: file.deleteUrl,
method: file.deleteType
}).then(
function () {
state = 'resolved';
$scope.clear(file);
},
function () {
state = 'rejected';
}
);
};
} else if (!file.$cancel && !file._index) {
file.$cancel = function () {
$scope.clear(file);
};
}
}
]);
}());
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/js/app.js | JavaScript | asf20 | 3,588 |
/*
* jQuery File Upload jQuery UI Plugin 8.7.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery', './jquery.fileupload-ui'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
processdone: function (e, data) {
data.context.find('.start').button('enable');
},
progress: function (e, data) {
if (data.context) {
data.context.find('.progress').progressbar(
'option',
'value',
parseInt(data.loaded / data.total * 100, 10)
);
}
},
progressall: function (e, data) {
var $this = $(this);
$this.find('.fileupload-progress')
.find('.progress').progressbar(
'option',
'value',
parseInt(data.loaded / data.total * 100, 10)
).end()
.find('.progress-extended').each(function () {
$(this).html(
($this.data('blueimp-fileupload') ||
$this.data('fileupload'))
._renderExtendedProgress(data)
);
});
}
},
_renderUpload: function (func, files) {
var node = this._super(func, files),
showIconText = $(window).width() > 480;
node.find('.progress').empty().progressbar();
node.find('.start').button({
icons: {primary: 'ui-icon-circle-arrow-e'},
text: showIconText
});
node.find('.cancel').button({
icons: {primary: 'ui-icon-cancel'},
text: showIconText
});
if (node.hasClass('fade')) {
node.hide();
}
return node;
},
_renderDownload: function (func, files) {
var node = this._super(func, files),
showIconText = $(window).width() > 480;
node.find('.delete').button({
icons: {primary: 'ui-icon-trash'},
text: showIconText
});
if (node.hasClass('fade')) {
node.hide();
}
return node;
},
_startHandler: function (e) {
$(e.currentTarget).button('disable');
this._super(e);
},
_transition: function (node) {
var deferred = $.Deferred();
if (node.hasClass('fade')) {
node.fadeToggle(
this.options.transitionDuration,
this.options.transitionEasing,
function () {
deferred.resolveWith(node);
}
);
} else {
deferred.resolveWith(node);
}
return deferred;
},
_create: function () {
this._super();
this.element
.find('.fileupload-buttonbar')
.find('.fileinput-button').each(function () {
var input = $(this).find('input:file').detach();
$(this)
.button({icons: {primary: 'ui-icon-plusthick'}})
.append(input);
})
.end().find('.start')
.button({icons: {primary: 'ui-icon-circle-arrow-e'}})
.end().find('.cancel')
.button({icons: {primary: 'ui-icon-cancel'}})
.end().find('.delete')
.button({icons: {primary: 'ui-icon-trash'}})
.end().find('.progress').progressbar();
},
_destroy: function () {
this.element
.find('.fileupload-buttonbar')
.find('.fileinput-button').each(function () {
var input = $(this).find('input:file').detach();
$(this)
.button('destroy')
.append(input);
})
.end().find('.start')
.button('destroy')
.end().find('.cancel')
.button('destroy')
.end().find('.delete')
.button('destroy')
.end().find('.progress').progressbar('destroy');
this._super();
}
});
}));
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/js/jquery.fileupload-jquery-ui.js | JavaScript | asf20 | 5,060 |
/*
* jQuery postMessage Transport Plugin 1.1.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
var counter = 0,
names = [
'accepts',
'cache',
'contents',
'contentType',
'crossDomain',
'data',
'dataType',
'headers',
'ifModified',
'mimeType',
'password',
'processData',
'timeout',
'traditional',
'type',
'url',
'username'
],
convert = function (p) {
return p;
};
$.ajaxSetup({
converters: {
'postmessage text': convert,
'postmessage json': convert,
'postmessage html': convert
}
});
$.ajaxTransport('postmessage', function (options) {
if (options.postMessage && window.postMessage) {
var iframe,
loc = $('<a>').prop('href', options.postMessage)[0],
target = loc.protocol + '//' + loc.host,
xhrUpload = options.xhr().upload;
return {
send: function (_, completeCallback) {
counter += 1;
var message = {
id: 'postmessage-transport-' + counter
},
eventName = 'message.' + message.id;
iframe = $(
'<iframe style="display:none;" src="' +
options.postMessage + '" name="' +
message.id + '"></iframe>'
).bind('load', function () {
$.each(names, function (i, name) {
message[name] = options[name];
});
message.dataType = message.dataType.replace('postmessage ', '');
$(window).bind(eventName, function (e) {
e = e.originalEvent;
var data = e.data,
ev;
if (e.origin === target && data.id === message.id) {
if (data.type === 'progress') {
ev = document.createEvent('Event');
ev.initEvent(data.type, false, true);
$.extend(ev, data);
xhrUpload.dispatchEvent(ev);
} else {
completeCallback(
data.status,
data.statusText,
{postmessage: data.result},
data.headers
);
iframe.remove();
$(window).unbind(eventName);
}
}
});
iframe[0].contentWindow.postMessage(
message,
target
);
}).appendTo(document.body);
},
abort: function () {
if (iframe) {
iframe.remove();
}
}
};
}
});
}));
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/js/cors/jquery.postmessage-transport.js | JavaScript | asf20 | 3,991 |
/*
* jQuery XDomainRequest Transport Plugin 1.1.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Based on Julian Aubourg's ajaxHooks xdr.js:
* https://github.com/jaubourg/ajaxHooks/
*/
/* global define, window, XDomainRequest */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
if (window.XDomainRequest && !$.support.cors) {
$.ajaxTransport(function (s) {
if (s.crossDomain && s.async) {
if (s.timeout) {
s.xdrTimeout = s.timeout;
delete s.timeout;
}
var xdr;
return {
send: function (headers, completeCallback) {
var addParamChar = /\?/.test(s.url) ? '&' : '?';
function callback(status, statusText, responses, responseHeaders) {
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
xdr = null;
completeCallback(status, statusText, responses, responseHeaders);
}
xdr = new XDomainRequest();
// XDomainRequest only supports GET and POST:
if (s.type === 'DELETE') {
s.url = s.url + addParamChar + '_method=DELETE';
s.type = 'POST';
} else if (s.type === 'PUT') {
s.url = s.url + addParamChar + '_method=PUT';
s.type = 'POST';
} else if (s.type === 'PATCH') {
s.url = s.url + addParamChar + '_method=PATCH';
s.type = 'POST';
}
xdr.open(s.type, s.url);
xdr.onload = function () {
callback(
200,
'OK',
{text: xdr.responseText},
'Content-Type: ' + xdr.contentType
);
};
xdr.onerror = function () {
callback(404, 'Not Found');
};
if (s.xdrTimeout) {
xdr.ontimeout = function () {
callback(0, 'timeout');
};
xdr.timeout = s.xdrTimeout;
}
xdr.send((s.hasContent && s.data) || null);
},
abort: function () {
if (xdr) {
xdr.onerror = $.noop();
xdr.abort();
}
}
};
}
});
}
}));
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/js/cors/jquery.xdr-transport.js | JavaScript | asf20 | 3,305 |
@charset "UTF-8";
/*
* jQuery File Upload Plugin CSS 1.3.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileinput-button {
position: relative;
overflow: hidden;
}
.fileinput-button input {
position: absolute;
top: 0;
right: 0;
margin: 0;
opacity: 0;
-ms-filter: 'alpha(opacity=0)';
font-size: 200px;
direction: ltr;
cursor: pointer;
}
/* Fixes for IE < 8 */
@media screen\9 {
.fileinput-button input {
filter: alpha(opacity=0);
font-size: 100%;
height: 100%;
}
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/css/jquery.fileupload.css | CSS | asf20 | 655 |
@charset "UTF-8";
/*
* jQuery File Upload UI Plugin CSS 9.0.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileupload-buttonbar .btn,
.fileupload-buttonbar .toggle {
margin-bottom: 5px;
}
.progress-animated .progress-bar,
.progress-animated .bar {
background: url("../img/progressbar.gif") !important;
filter: none;
}
.fileupload-process {
float: right;
display: none;
}
.fileupload-processing .fileupload-process,
.files .processing .preview {
display: block;
width: 32px;
height: 32px;
background: url("../img/loading.gif") center no-repeat;
background-size: contain;
}
.files audio,
.files video {
max-width: 300px;
}
@media (max-width: 767px) {
.fileupload-buttonbar .toggle,
.files .toggle,
.files .btn span {
display: none;
}
.files .name {
width: 80px;
word-wrap: break-word;
}
.files audio,
.files video {
max-width: 80px;
}
.files img,
.files canvas {
max-width: 100%;
}
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/css/jquery.fileupload-ui.css | CSS | asf20 | 1,102 |
@charset "UTF-8";
/*
* jQuery File Upload Demo CSS Fixes for IE<9 1.0.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.navigation {
list-style: none;
padding: 0;
margin: 1em 0;
}
.navigation li {
display: inline;
margin-right: 10px;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/css/demo-ie8.css | CSS | asf20 | 396 |
@charset "UTF-8";
/*
* jQuery File Upload UI Plugin NoScript CSS 8.8.5
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileinput-button i,
.fileupload-buttonbar .delete,
.fileupload-buttonbar .toggle {
display: none;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/css/jquery.fileupload-ui-noscript.css | CSS | asf20 | 371 |
@charset "UTF-8";
/*
* jQuery File Upload Demo CSS 1.1.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
body {
max-width: 750px;
margin: 0 auto;
padding: 1em;
font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif;
font-size: 1em;
line-height: 1.4em;
background: #222;
color: #fff;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a {
color: orange;
text-decoration: none;
}
img {
border: 0;
vertical-align: middle;
}
h1 {
line-height: 1em;
}
blockquote {
padding: 0 0 0 15px;
margin: 0 0 20px;
border-left: 5px solid #eee;
}
table {
width: 100%;
margin: 10px 0;
}
.fileupload-progress {
margin: 10px 0;
}
.fileupload-progress .progress-extended {
margin-top: 5px;
}
.error {
color: red;
}
@media (min-width: 481px) {
.navigation {
list-style: none;
padding: 0;
}
.navigation li {
display: inline-block;
}
.navigation li:not(:first-child):before {
content: "| ";
}
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/css/demo.css | CSS | asf20 | 1,124 |
@charset "UTF-8";
/*
* jQuery File Upload Plugin NoScript CSS 1.2.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileinput-button input {
position: static;
opacity: 1;
filter: none;
font-size: inherit;
direction: inherit;
}
.fileinput-button span {
display: none;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/fileupload/css/jquery.fileupload-noscript.css | CSS | asf20 | 431 |
var the_form = window.document.frmUser;
function check_All(status)
{
for (i = 0; i < the_form.length; i++) {
the_form.elements[i].checked = status;
}
}
function delConfrim()
{
return confirm("Ban co muon xoa ko")
}
function submit_list(flag)
{
if (selected_item()){
the_form.factive.value = flag;
the_form.submit();
}
}
function delete_list(the_url) {
if (selected_item()){
question = confirm("Ban co muon xoa khong ?")
if (question != "0"){
the_form.action = the_url;
the_form.submit();
}
}
}
function selected_item(){
var name_count = the_form.length;
for (i=0;i<name_count;i++){
if (the_form.elements[i].checked){
return true;
}
}
alert('Hay chon 1 user');
return false;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/checkbox.js | JavaScript | asf20 | 755 |
var imgLib = {
configdefault:{
url:url,
url_lib:url+'mod_file_manager/image_manager',
dir_img:'',
width: 0,
height:0,
method:'imglib',
action:'',
callback:'',
return_tag:''
},
config:{},
openLib :function (option)
{
this.config = $.extend({},this.configdefault,option);
this.config.url_lib = this.config.url_lib+'/index/'+this.config.return_tag+'/'+this.config.width+'/'+this.config.height ;
if(this.config.method=='imgcrop')
{
this.config.url_lib = url+'mod_file_manager/image_manager/cropimage';
}
$.colorbox({href:this.config.url_lib,iframe:true, innerWidth:"980px", innerHeight:"600px"});
},
insert:function(data)
{
if(this.config.callback!= '' )
{
this.config.callback(data);
}
else
{
if(this.config.action=='imgcrop')
{
var rt_data = data[0];
var file = rt_data.lb_dir+'/'+rt_data.lb_name;
var rt_html = "";
rt_html += '<input type="hidden" name="'+this.config.return_tag+'" value="images/'+file+'" id="'+this.config.return_tag+'"/>';
//rt_html += '<a href="'+url+'mod_file_manager/image_manager/cropimage/'+this.config.return_tag+'/'+this.config.width+'/'+this.config.height+'" class="cboxElement" title="Image Crop"><img src="'+urlsite+'uploads/images/'+file+'" width="100px"/></a>';
rt_html += '<a href="javascript:imgLib.openLib({dir_img:\'images/'+file+'\',width:\''+this.config.width+'\',height:\''+this.config.height+'\',method:\'imgcrop\',return_tag:\''+this.config.return_tag+'\',action:\'imgcrop\'});"> <img src="'+urlsite+'uploads/images/'+file+'" width="100px"/></a>';
$("."+this.config.return_tag).html(rt_html);
$(".cboxElement").colorbox({width:"985px", height:"600px",iframe:true});
}
else if(this.config.action=='editor')
{
}
}
},
crop:function(data)
{
if(this.config.callback!= '' ){
this.config.callback(data);
}else{
if(this.config.action=='imgcrop'){
var rt_html = "";
rt_html += '<input type="hidden" name="'+this.config.return_tag+'" value="temp/'+data.file_name+'" id="'+this.config.return_tag+'"/>';
rt_html += '<a onclick="imgLib.openLib({dir_img:\'temp/'+data.file_name+'\',width:\''+this.config.width+'\',height:\''+this.config.height+'\',method:\'imgcrop\',return_tag:\''+this.config.return_tag+'\',action:\'imgcrop\'});" href="javascript:void(0);"> <img src="'+urlsite+'uploads/temp/'+data.file_name+'" width="100px"/></a>';
$("."+this.config.return_tag).html(rt_html);
$(".cboxElement").colorbox({width:"950", height:"650",iframe:true});
}
}
}
}; | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/filelib.js | JavaScript | asf20 | 2,911 |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
"alertText": "Vui lòng nhập đầy đủ thông tin",
"alertTextCheckboxMultiple": "Vui lòng chọn",
"alertTextCheckboxe": "* This checkbox is required"
},
"select-product-cat": {
"regex": /^[\-\+]?\d+$/,
"alertText": "Chọn danh mục sản phẩm"
},
"minSize": {
"regex": "none",
"alertText": "* Minimum ",
"alertText2": " characters allowed"
},
"maxSize": {
"regex": "none",
"alertText": "* Maximum ",
"alertText2": " characters allowed"
},
"min": {
"regex": "none",
"alertText": "* Minimum value is "
},
"max": {
"regex": "none",
"alertText": "* Maximum value is "
},
"past": {
"regex": "none",
"alertText": "* Date prior to "
},
"future": {
"regex": "none",
"alertText": "* Date past "
},
"maxCheckbox": {
"regex": "none",
"alertText": "* Checks allowed Exceeded"
},
"minCheckbox": {
"regex": "none",
"alertText": "* Please select ",
"alertText2": " options"
},
"equals": {
"regex": "none",
"alertText": "* Fields do not match"
},
"phone": {
// credit: jquery.h5validate.js / orefalo
"regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
"alertText": "* Invalid phone number"
},
"email": {
// Simplified, was not working in the Iphone browser
"regex": /^([A-Za-z0-9_\-\.\'])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,6})$/,
"alertText": "* Invalid email address"
},
"integer": {
"regex": /^[\-\+]?\d+$/,
"alertText": "Thông tin nhập vào phải là số"
},
"number": {
// Number, including positive, negative, and floating decimal. credit: orefalo
"regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
"alertText": "Thông tin nhập vào phải là số"
},
"date": {
// Date in ISO format. Credit: bassistance
"regex": /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
"alertText": "* Invalid date, must be in YYYY-MM-DD format"
},
"ipv4": {
"regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
"alertText": "* Invalid IP address"
},
"url": {
"regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/,
"alertText": "* Invalid URL"
},
"onlyNumberSp": {
"regex": /^[0-9\ ]+$/,
"alertText": "* Numbers only"
},
"onlyLetterSp": {
"regex": /^[a-zA-Z\ \']+$/,
"alertText": "* Letters only"
},
"onlyLetterNumber": {
"regex": /^[0-9a-zA-Z]+$/,
"alertText": "* No special characters allowed"
},
// --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
"ajaxUserCall": {
"url": "ajaxValidateFieldUser",
// you may want to pass extra data on the ajax call
"extraData": "name=eric",
"alertText": "* This user is already taken",
"alertTextLoad": "* Validating, please wait"
},
"ajaxNameCall": {
// remote json service location
"url": "ajaxValidateFieldName",
// error
"alertText": "* This name is already taken",
// if you provide an "alertTextOk", it will show as a green prompt when the field validates
"alertTextOk": "* This name is available",
// speaks by itself
"alertTextLoad": "* Validating, please wait"
},
"validate2fields": {
"alertText": "* Please input HELLO"
}
};
}
};
$.validationEngineLanguage.newLang();
})(jQuery); | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/jquery.validationEngine-en.js | JavaScript | asf20 | 6,651 |
jQuery(function($) {
$(".cboxElement").colorbox({
width:"730", height:"600", iframe:true
});
$("#addimages_avatar").colorbox({
width:"730", height:"600", iframe:true
});
$(".btnloadgroup").colorbox({
width:"730", height:"600", iframe:true
});
$(".btnloadshow").colorbox({
width:"730", height:"500", iframe:true
});
$(".colorbox").colorbox({iframe:true, fixed:true, width:"900", height:"600"});
});
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/ui.js | JavaScript | asf20 | 487 |
function mkselected(id, value)
{
var loca = document.getElementById(id).options ;
for(var i=0;i<loca.length;i++){
if(loca[i].value == value)
loca[i].selected = true ;
}
}
function changestatus(value,id)
{
$("#loadstatus"+id).html('<image src="'+url+'templates/images/loading1.gif">');
$.post(url+"order/changestatus",{'status':value,'id':id},function(data)
{
$("#loadstatus"+id).html('');
},'json');
}
function loadstatic()
{
$("#static").html('<image src="'+url+'templates/images/loading.gif">');
$.post(url+"ajax/thongke",{},function(data)
{
$("#static").html(data);
});
}
//Site config
function loadConfig()
{
$("#config").html('<image src="'+url+'templates/images/loading.gif">');
$.post(url+"siteconfig/config",{},function(data)
{
$("#config").html(data);
});
}
//Member
function updatemember(id){
$("#page").html('<image src="'+url+'templates/images/loading.gif">');
$.post(url+"member/update/",{'id':id},function(data)
{
$("#page").html(data);
});
}
//Publish
function publish(table,field,id,status)
{
$("#publish"+id).html('<image src="'+url+'templates/images/loading.gif">');
$.post(url+"ajax/publish",{'table':table,'field':field,'id':id,'status':status},function(data)
{
$("#publish"+id).html(data);
});
}
$(function(){
$("#title").keyup(function()
{
var word=$(this).val();
$.post(url+"ajax/getalias/",{'name':word},function(data)
{
$("#alias").val(data);
});
return false;
});
});
function kodau(str){
str= str.toLowerCase();
str= str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a");
str= str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e");
str= str.replace(/ì|í|ị|ỉ|ĩ/g,"i");
str= str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o");
str= str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u");
str= str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y");
str= str.replace(/đ/g,"d");
str= str.replace(/!|@|\$|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\'| |\"|\&|\#|\[|\]|~/g,"-");
str= str.replace(/-+-/g,"-"); //thay thế 2- thành 1-
str= str.replace(/^\-+|\-+$/g,"");//cắt bỏ ký tự - ở đầu và cuối chuỗi
return str;
}
function trit(a){
console.log(a) ;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/apps.js | JavaScript | asf20 | 2,712 |
// This file is part of the jQuery formatCurrency Plugin.
//
// The jQuery formatCurrency Plugin is free software: you can redistribute it
// and/or modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// The jQuery formatCurrency Plugin is distributed in the hope that it will
// be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the jQuery formatCurrency Plugin. If not, see <http://www.gnu.org/licenses/>.
(function($) {
$.formatCurrency = {};
$.formatCurrency.regions = [];
// default Region is en
$.formatCurrency.regions[''] = {
symbol: '',
positiveFormat: '%s%n',
negativeFormat: '(%s%n)',
decimalSymbol: '.',
digitGroupSymbol: ',',
groupDigits: true
};
$.fn.formatCurrency = function(destination, settings) {
if (arguments.length == 1 && typeof destination !== "string") {
settings = destination;
destination = false;
}
// initialize defaults
var defaults = {
name: "formatCurrency",
colorize: false,
region: '',
global: true,
roundToDecimalPlace: 2, // roundToDecimalPlace: -1; for no rounding; 0 to round to the dollar; 1 for one digit cents; 2 for two digit cents; 3 for three digit cents; ...
eventOnDecimalsEntered: false
};
// initialize default region
defaults = $.extend(defaults, $.formatCurrency.regions['']);
// override defaults with settings passed in
settings = $.extend(defaults, settings);
// check for region setting
if (settings.region.length > 0) {
settings = $.extend(settings, getRegionOrCulture(settings.region));
}
settings.regex = generateRegex(settings);
return this.each(function() {
$this = $(this);
// get number
var num = '0';
num = $this[$this.is('input, select, textarea') ? 'val' : 'html']();
//identify '(123)' as a negative number
if (num.search('\\(') >= 0) {
num = '-' + num;
}
if (num === '' || (num === '-' && settings.roundToDecimalPlace === -1)) {
return;
}
// if the number is valid use it, otherwise clean it
if (isNaN(num)) {
// clean number
num = num.replace(settings.regex, '');
if (num === '' || (num === '-' && settings.roundToDecimalPlace === -1)) {
return;
}
if (settings.decimalSymbol != '.') {
num = num.replace(settings.decimalSymbol, '.'); // reset to US decimal for arithmetic
}
if (isNaN(num)) {
num = '0';
}
}
// evalutate number input
var numParts = String(num).split('.');
var isPositive = (num == Math.abs(num));
var hasDecimals = (numParts.length > 1);
var decimals = (hasDecimals ? numParts[1].toString() : '0');
var originalDecimals = decimals;
// format number
num = Math.abs(numParts[0]);
num = isNaN(num) ? 0 : num;
if (settings.roundToDecimalPlace >= 0) {
decimals = parseFloat('1.' + decimals); // prepend "0."; (IE does NOT round 0.50.toFixed(0) up, but (1+0.50).toFixed(0)-1
decimals = decimals.toFixed(settings.roundToDecimalPlace); // round
if (decimals.substring(0, 1) == '2') {
num = Number(num) + 1;
}
decimals = decimals.substring(2); // remove "0."
}
num = String(num);
if (settings.groupDigits) {
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
num = num.substring(0, num.length - (4 * i + 3)) + settings.digitGroupSymbol + num.substring(num.length - (4 * i + 3));
}
}
if ((hasDecimals && settings.roundToDecimalPlace == -1) || settings.roundToDecimalPlace > 0) {
num += settings.decimalSymbol + decimals;
}
// format symbol/negative
var format = isPositive ? settings.positiveFormat : settings.negativeFormat;
var money = format.replace(/%s/g, settings.symbol);
money = money.replace(/%n/g, num);
// setup destination
var $destination = $([]);
if (!destination) {
$destination = $this;
} else {
$destination = $(destination);
}
// set destination
$destination[$destination.is('input, select, textarea') ? 'val' : 'html'](money);
if (
hasDecimals &&
settings.eventOnDecimalsEntered &&
originalDecimals.length > settings.roundToDecimalPlace
) {
$destination.trigger('decimalsEntered', originalDecimals);
}
// colorize
if (settings.colorize) {
$destination.css('color', isPositive ? 'black' : 'red');
}
});
};
// Remove all non numbers from text
$.fn.toNumber = function(settings) {
var defaults = $.extend({
name: "toNumber",
region: '',
global: true
}, $.formatCurrency.regions['']);
settings = jQuery.extend(defaults, settings);
if (settings.region.length > 0) {
settings = $.extend(settings, getRegionOrCulture(settings.region));
}
settings.regex = generateRegex(settings);
return this.each(function() {
var method = $(this).is('input, select, textarea') ? 'val' : 'html';
$(this)[method]($(this)[method]().replace('(', '(-').replace(settings.regex, ''));
});
};
// returns the value from the first element as a number
$.fn.asNumber = function(settings) {
var defaults = $.extend({
name: "asNumber",
region: '',
parse: true,
parseType: 'Float',
global: true
}, $.formatCurrency.regions['']);
settings = jQuery.extend(defaults, settings);
if (settings.region.length > 0) {
settings = $.extend(settings, getRegionOrCulture(settings.region));
}
settings.regex = generateRegex(settings);
settings.parseType = validateParseType(settings.parseType);
var method = $(this).is('input, select, textarea') ? 'val' : 'html';
var num = $(this)[method]();
num = num ? num : "";
num = num.replace('(', '(-');
num = num.replace(settings.regex, '');
if (!settings.parse) {
return num;
}
if (num.length == 0) {
num = '0';
}
if (settings.decimalSymbol != '.') {
num = num.replace(settings.decimalSymbol, '.'); // reset to US decimal for arthmetic
}
return window['parse' + settings.parseType](num);
};
function getRegionOrCulture(region) {
var regionInfo = $.formatCurrency.regions[region];
if (regionInfo) {
return regionInfo;
}
else {
if (/(\w+)-(\w+)/g.test(region)) {
var culture = region.replace(/(\w+)-(\w+)/g, "$1");
return $.formatCurrency.regions[culture];
}
}
// fallback to extend(null) (i.e. nothing)
return null;
}
function validateParseType(parseType) {
switch (parseType.toLowerCase()) {
case 'int':
return 'Int';
case 'float':
return 'Float';
default:
throw 'invalid parseType';
}
}
function generateRegex(settings) {
if (settings.symbol === '') {
return new RegExp("[^\\d" + settings.decimalSymbol + "-]", "g");
}
else {
var symbol = settings.symbol.replace('$', '\\$').replace('.', '\\.');
return new RegExp(symbol + "|[^\\d" + settings.decimalSymbol + "-]", "g");
}
}
})(jQuery); | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/price_format.js | JavaScript | asf20 | 8,766 |
/*
jQuery Tags Input Plugin 1.3.3
Copyright (c) 2011 XOXCO, Inc
Documentation for this plugin lives here:
http://xoxco.com/clickable/jquery-tags-input
Licensed under the MIT license:
http://www.opensource.org/licenses/mit-license.php
ben@xoxco.com
*/
;(function($) {
var delimiter = new Array();
var tags_callbacks = new Array();
$.fn.doAutosize = function(o){
var minWidth = $(this).data('minwidth'),
maxWidth = $(this).data('maxwidth'),
val = '',
input = $(this),
testSubject = $('#'+$(this).data('tester_id'));
if (val === (val = input.val())) {return;}
// Enter new content into testSubject
var escaped = val.replace(/&/g, '&').replace(/\s/g,' ').replace(/</g, '<').replace(/>/g, '>');
testSubject.html(escaped);
// Calculate new width + whether to change
var testerWidth = testSubject.width(),
newWidth = (testerWidth + o.comfortZone) >= minWidth ? testerWidth + o.comfortZone : minWidth,
currentWidth = input.width(),
isValidWidthChange = (newWidth < currentWidth && newWidth >= minWidth)
|| (newWidth > minWidth && newWidth < maxWidth);
// Animate width
if (isValidWidthChange) {
input.width(newWidth);
}
};
$.fn.resetAutosize = function(options){
// alert(JSON.stringify(options));
var minWidth = $(this).data('minwidth') || options.minInputWidth || $(this).width(),
maxWidth = $(this).data('maxwidth') || options.maxInputWidth || ($(this).closest('.tagsinput').width() - options.inputPadding),
val = '',
input = $(this),
testSubject = $('<tester/>').css({
position: 'absolute',
top: -9999,
left: -9999,
width: 'auto',
fontSize: input.css('fontSize'),
fontFamily: input.css('fontFamily'),
fontWeight: input.css('fontWeight'),
letterSpacing: input.css('letterSpacing'),
whiteSpace: 'nowrap'
}),
testerId = $(this).attr('id')+'_autosize_tester';
if(! $('#'+testerId).length > 0){
testSubject.attr('id', testerId);
testSubject.appendTo('body');
}
input.data('minwidth', minWidth);
input.data('maxwidth', maxWidth);
input.data('tester_id', testerId);
input.css('width', minWidth);
};
$.fn.addTag = function(value,options) {
options = jQuery.extend({focus:false,callback:true},options);
this.each(function() {
var id = $(this).attr('id');
var tagslist = $(this).val().split(delimiter[id]);
if (tagslist[0] == '') {
tagslist = new Array();
}
value = jQuery.trim(value);
if (options.unique) {
var skipTag = $(this).tagExist(value);
if(skipTag == true) {
//Marks fake input as not_valid to let styling it
$('#'+id+'_tag').addClass('not_valid');
}
} else {
var skipTag = false;
}
if (value !='' && skipTag != true) {
$('<span>').addClass('tag').append(
$('<span>').text(value).append(' '),
$('<a>', {
href : '#',
title : 'Removing tag',
text : 'x'
}).click(function () {
return $('#' + id).removeTag(escape(value));
})
).insertBefore('#' + id + '_addTag');
tagslist.push(value);
$('#'+id+'_tag').val('');
if (options.focus) {
$('#'+id+'_tag').focus();
} else {
$('#'+id+'_tag').blur();
}
$.fn.tagsInput.updateTagsField(this,tagslist);
if (options.callback && tags_callbacks[id] && tags_callbacks[id]['onAddTag']) {
var f = tags_callbacks[id]['onAddTag'];
f.call(this, value);
}
if(tags_callbacks[id] && tags_callbacks[id]['onChange'])
{
var i = tagslist.length;
var f = tags_callbacks[id]['onChange'];
f.call(this, $(this), tagslist[i-1]);
}
}
});
return false;
};
$.fn.removeTag = function(value) {
value = unescape(value);
this.each(function() {
var id = $(this).attr('id');
var old = $(this).val().split(delimiter[id]);
$('#'+id+'_tagsinput .tag').remove();
str = '';
for (i=0; i< old.length; i++) {
if (old[i]!=value) {
str = str + delimiter[id] +old[i];
}
}
$.fn.tagsInput.importTags(this,str);
if (tags_callbacks[id] && tags_callbacks[id]['onRemoveTag']) {
var f = tags_callbacks[id]['onRemoveTag'];
f.call(this, value);
}
});
return false;
};
$.fn.tagExist = function(val) {
var id = $(this).attr('id');
var tagslist = $(this).val().split(delimiter[id]);
return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
};
// clear all existing tags and import new ones from a string
$.fn.importTags = function(str) {
id = $(this).attr('id');
$('#'+id+'_tagsinput .tag').remove();
$.fn.tagsInput.importTags(this,str);
}
$.fn.tagsInput = function(options) {
var settings = jQuery.extend({
interactive:true,
defaultText:'từ khóa',
minChars:0,
width:'300px',
height:'28px',
autocomplete: {selectFirst: false },
'hide':true,
'delimiter':',',
'unique':true,
removeWithBackspace:true,
placeholderColor:'#666666',
autosize: true,
comfortZone: 20,
inputPadding: 6*2
},options);
this.each(function() {
if (settings.hide) {
$(this).hide();
}
var id = $(this).attr('id');
if (!id || delimiter[$(this).attr('id')]) {
id = $(this).attr('id', 'tags' + new Date().getTime()).attr('id');
}
var data = jQuery.extend({
pid:id,
real_input: '#'+id,
holder: '#'+id+'_tagsinput',
input_wrapper: '#'+id+'_addTag',
fake_input: '#'+id+'_tag'
},settings);
delimiter[id] = data.delimiter;
if (settings.onAddTag || settings.onRemoveTag || settings.onChange) {
tags_callbacks[id] = new Array();
tags_callbacks[id]['onAddTag'] = settings.onAddTag;
tags_callbacks[id]['onRemoveTag'] = settings.onRemoveTag;
tags_callbacks[id]['onChange'] = settings.onChange;
}
var markup = '<div id="'+id+'_tagsinput" class="tagsinput"><div id="'+id+'_addTag">';
if (settings.interactive) {
markup = markup + '<input id="'+id+'_tag" value="" data-default="'+settings.defaultText+'" />';
}
markup = markup + '</div><div class="tags_clear"></div></div>';
$(markup).insertAfter(this);
$(data.holder).css('width',settings.width);
$(data.holder).css('min-height',settings.height);
$(data.holder).css('height',settings.height);
if ($(data.real_input).val()!='') {
$.fn.tagsInput.importTags($(data.real_input),$(data.real_input).val());
}
if (settings.interactive) {
$(data.fake_input).val($(data.fake_input).attr('data-default'));
$(data.fake_input).css('color',settings.placeholderColor);
$(data.fake_input).resetAutosize(settings);
$(data.holder).bind('click',data,function(event) {
$(event.data.fake_input).focus();
});
$(data.fake_input).bind('focus',data,function(event) {
if ($(event.data.fake_input).val()==$(event.data.fake_input).attr('data-default')) {
$(event.data.fake_input).val('');
}
$(event.data.fake_input).css('color','#000000');
});
if (settings.autocomplete_url != undefined) {
autocomplete_options = {source: settings.autocomplete_url};
for (attrname in settings.autocomplete) {
autocomplete_options[attrname] = settings.autocomplete[attrname];
}
if (jQuery.Autocompleter !== undefined) {
$(data.fake_input).autocomplete(settings.autocomplete_url, settings.autocomplete);
$(data.fake_input).bind('result',data,function(event,data,formatted) {
if (data) {
$('#'+id).addTag(data[0] + "",{focus:true,unique:(settings.unique)});
}
});
} else if (jQuery.ui.autocomplete !== undefined) {
$(data.fake_input).autocomplete(autocomplete_options);
$(data.fake_input).bind('autocompleteselect',data,function(event,ui) {
$(event.data.real_input).addTag(ui.item.value,{focus:true,unique:(settings.unique)});
return false;
});
}
} else {
// if a user tabs out of the field, create a new tag
// this is only available if autocomplete is not used.
$(data.fake_input).bind('blur',data,function(event) {
var d = $(this).attr('data-default');
if ($(event.data.fake_input).val()!='' && $(event.data.fake_input).val()!=d) {
if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
$(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
} else {
$(event.data.fake_input).val($(event.data.fake_input).attr('data-default'));
$(event.data.fake_input).css('color',settings.placeholderColor);
}
return false;
});
}
// if user types a comma, create a new tag
$(data.fake_input).bind('keypress',data,function(event) {
if (event.which==event.data.delimiter.charCodeAt(0) || event.which==13 ) {
event.preventDefault();
if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
$(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
$(event.data.fake_input).resetAutosize(settings);
return false;
} else if (event.data.autosize) {
$(event.data.fake_input).doAutosize(settings);
}
});
//Delete last tag on backspace
data.removeWithBackspace && $(data.fake_input).bind('keydown', function(event)
{
if(event.keyCode == 8 && $(this).val() == '')
{
event.preventDefault();
var last_tag = $(this).closest('.tagsinput').find('.tag:last').text();
var id = $(this).attr('id').replace(/_tag$/, '');
last_tag = last_tag.replace(/[\s]+x$/, '');
$('#' + id).removeTag(escape(last_tag));
$(this).trigger('focus');
}
});
$(data.fake_input).blur();
//Removes the not_valid class when user changes the value of the fake input
if(data.unique) {
$(data.fake_input).keydown(function(event){
if(event.keyCode == 8 || String.fromCharCode(event.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)) {
$(this).removeClass('not_valid');
}
});
}
} // if settings.interactive
});
return this;
};
$.fn.tagsInput.updateTagsField = function(obj,tagslist) {
var id = $(obj).attr('id');
$(obj).val(tagslist.join(delimiter[id]));
};
$.fn.tagsInput.importTags = function(obj,val) {
$(obj).val('');
var id = $(obj).attr('id');
var tags = val.split(delimiter[id]);
for (i=0; i<tags.length; i++) {
$(obj).addTag(tags[i],{focus:false,callback:false});
}
if(tags_callbacks[id] && tags_callbacks[id]['onChange'])
{
var f = tags_callbacks[id]['onChange'];
f.call(obj, obj, tags[i]);
}
};
})(jQuery);
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/js/jquery.tagsinput.js | JavaScript | asf20 | 11,948 |
.icon-back{
background: url(../images/refresh.png) no-repeat;
width: 24px;
height: 24px;
}
.table_full{
margin: 0px;
padding: 0px;
}
.colum_left_small {
background: url("../images/bg_left.png") repeat-y scroll right center transparent;
width: 30px;
display: table-cell;
height: auto;
}
.colum_left_lage{
background: url("../images/bg_left.png") repeat-y scroll right center transparent;
width: 30px;
width: 220px;
}
.divclose {
background: url("../images/bgmenu.png") repeat-x scroll center center transparent;
border: 1px solid #EAEAEA;
line-height: 22px;
margin-bottom: 1px;
padding: 0 4px;
}
.small{
background: url("../images/small.png") no-repeat scroll right center transparent;
cursor: pointer;
display: block;
height: 100%;
padding-left: 16px;
}
.lage {
background: url("../images/lage.png") no-repeat scroll center center transparent;
cursor: pointer;
display: block;
height: 20px;
width: 20px;
margin-right: 10px;
}
.title-admin{
font-size: 14px;
color: #F7790A;
font-weight: bold;
padding: 5px 15px;
}
ul.click{
float: right;
}
ul.click li{
text-align: center;
float: right;
margin-left: 5px;
}
ul.click li a{
background-color: #FFFFFF;
border: 1px solid #DDDDDD;
color: #565656;
display: block;
float: left;
padding: 2px;
text-decoration: none;
vertical-align: middle;
border-radius: 5px 5px 5px 5px;
width: 50px;
height: 50px;
font-size: 11px;
}
ul.click li a:hover{
background: none repeat scroll 0 0 #FAEABB;
border: 1px solid #CCCCCC;
color: #025A8D;
}
ul.click li img{
padding-top: 3px;
margin: 0 auto;
}
#menu-left ul{
padding-bottom: 6px;
text-indent: 6px;
}
#menu-left ul li a{
background: url("../images/vertical_menu_bg.jpg") no-repeat scroll left 0px #F5FBFE;
border: 1px solid #C6C6C6;
color: #333333;
display: block;
font-size: 12px;
font-weight: bold;
line-height: 24px;
padding-left : 15px;
margin-bottom: 1px;
text-decoration: none;
}
#menu-left ul li a.select{
background: none repeat scroll 0 0 #FFD9D9;
color: #333333;
}
#menu-left ul li.sub-menu a{
background: url("../images/vertical_menu_bg.jpg") no-repeat scroll left -75px #F5FBFE;
color: #333333;
font-weight: normal;
padding-right: 5px;
text-align: right;
text-indent: 0;
}
table.info{
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #DADADA;
border-collapse: separate;
border-spacing: 1px;
caption-side: top;
color: #000000;
empty-cells: show;
width: 100%;
}
table.info thead th{
background:url("../images/h-box-white.jpg") repeat-x scroll left top #E8E8E8;
padding:7px;
color:#555555;
text-align:left;
font-weight: bold;
}
table.info tr.row1 td{
background-color: #EEEEEE;
padding: 7px;
text-align: left;
}
table.info tr.row0 td{
background-color: #F7F7F7;
padding: 7px;
text-align: left;
}
table.info tr.row1:hover td {
background-color: #FAEABB;
}
table.info tr.row0:hover td {
background-color: #FAEABB;
}
#footer{
border-top: 5px solid #FF0000;
overflow: hidden;
padding: 5px;
background-color: #000000;
color: #FFF;
text-align: center;
}
.libimg {
background:url(../images/header/icon-48-media.png) no-repeat;
width:48px;
height:48px;
display:block;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/styles.css | CSS | asf20 | 3,658 |
@charset "UTF-8";
/* CSS Document */
.flexigrid {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
position: relative;
border: 0px solid #eee;
overflow: hidden;
color: #000;
}
.flexigrid.hideBody {
height: 26px !important;
border-bottom: 1px solid #ccc;
}
.ie6fullwidthbug {
border-right: 0px solid #ccc;
padding-right: 2px;
}
.flexigrid div.nDiv {
background: #eee url(images/line.gif) repeat-y -1px top;
border: 1px solid #ccc;
border-top: 0px;
overflow: auto;
left: 0px;
position: absolute;
z-index: 999;
float: left;
}
.flexigrid div.nDiv table {
margin: 2px;
}
.flexigrid div.hDivBox {
float: left;
padding-right: 40px;
}
.flexigrid div.bDiv table {
margin-bottom: 10px;
}
.flexigrid div.bDiv table.autoht {
border-bottom: 0px;
margin-bottom: 0px;
}
.flexigrid div.nDiv td {
padding: 2px 3px;
border: 1px solid #eee;
cursor: default;
}
.flexigrid div.nDiv tr:hover td,.flexigrid div.nDiv tr.ndcolover td {
background: #d5effc url(images/hl.png) repeat-x top;
border: 1px solid #a8d8eb;
}
.flexigrid div.nDiv td.ndcol1 {
border-right: 1px solid #ccc;
}
.flexigrid div.nDiv td.ndcol2 {
border-left: 1px solid #fff;
padding-right: 10px;
}
.flexigrid div.nDiv tr:hover td.ndcol1,.flexigrid div.nDiv tr.ndcolover td.ndcol1
{
border-right: 1px solid #d2e3ec;
}
.flexigrid div.nDiv tr:hover td.ndcol2,.flexigrid div.nDiv tr.ndcolover td.ndcol2
{
border-left: 1px solid #eef8ff;
}
.flexigrid div.nBtn {
position: absolute;
height: 24px;
width: 14px;
z-index: 900;
background: #fafafa url(images/fhbg.gif) repeat-x bottom;
border: 0px solid #ccc;
border-left: 1px solid #ccc;
top: 0px;
left: 0px;
margin-top: 1px;
cursor: pointer;
display: none;
}
.flexigrid div.nBtn div {
height: 24px;
width: 12px;
border-left: 1px solid #fff;
float: left;
background: url(images/ddn.png) no-repeat center;
}
.flexigrid div.nBtn.srtd {
background: url(images/wbg.gif) repeat-x 0px -1px;
}
.flexigrid div.mDiv {
background: url(images/wbg.gif) repeat-x top;
border: 1px solid #ccc;
border-bottom: 0px;
border-top: 0px;
font-weight: bold;
display: block;
overflow: hidden;
white-space: nowrap;
position: relative;
}
.flexigrid div.mDiv div {
padding: 6px;
white-space: nowrap;
}
.flexigrid div.mDiv div.ptogtitle {
position: absolute;
top: 4px;
right: 3px;
padding: 0px;
height: 16px;
width: 16px;
overflow: hidden;
border: 1px solid #ccc;
cursor: pointer;
}
.flexigrid div.mDiv div.ptogtitle:hover {
background-position: left -2px;
border-color: #bbb;
}
.flexigrid div.mDiv div.ptogtitle span {
display: block;
border-left: 1px solid #eee;
border-top: 1px solid #fff;
border-bottom: 1px solid #ddd;
width: 14px;
height: 14px;
background: url(images/uup.png) no-repeat center;
}
.flexigrid div.mDiv div.ptogtitle.vsble span {
background: url(images/ddn.png) no-repeat center;
}
.flexigrid div.tDiv /*toolbar*/ {
background: #fafafa url(images/bg.gif) repeat-x top;
position: relative;
border: 1px solid #ccc;
border-bottom: 0px;
overflow: hidden;
}
.flexigrid div.tDiv2 {
float: left;
clear: both;
padding: 1px;
}
.flexigrid div.sDiv /*toolbar*/ {
background: #fafafa url(images/bg.gif) repeat-x top;
position: relative;
border: 1px solid #ccc;
border-top: 0px;
overflow: hidden;
display: none;
}
.flexigrid div.sDiv2 {
float: left;
clear: both;
padding: 5px;
padding-left: 5px;
width: 1024px;
}
.flexigrid div.sDiv2 input,.flexigrid div.sDiv2 select {
vertical-align: middle;
}
.flexigrid div.btnseparator {
float: left;
height: 22px;
border-left: 1px solid #ccc;
border-right: 1px solid #fff;
margin: 1px;
}
.flexigrid div.fbutton {
float: left;
display: block;
cursor: pointer;
padding: 1px;
}
.flexigrid div.fbutton div {
float: left;
padding: 1px 3px;
}
.flexigrid div.fbutton span {
float: left;
display: block;
padding: 3px;
}
.flexigrid div.fbutton:hover,.flexigrid div.fbutton.fbOver {
padding: 0px;
border: 1px solid #ccc;
}
.flexigrid div.fbutton:hover div,.flexigrid div.fbutton.fbOver div {
padding: 0px 2px;
border-left: 1px solid #fff;
border-top: 1px solid #fff;
border-right: 1px solid #eee;
border-bottom: 1px solid #eee;
}
/* end toolbar*/
.flexigrid div.hDiv {
background: #fafafa url(images/fhbg.gif) repeat-x bottom;
position: relative;
border: 1px solid #ccc;
border-bottom: 0px;
overflow: hidden;
}
.flexigrid div.hDiv table {
border-right: 1px solid #fff;
}
.flexigrid div.cDrag {
float: left;
position: absolute;
z-index: 2;
overflow: visible;
}
.flexigrid div.cDrag div {
float: left;
background: none;
display: block;
position: absolute;
height: 24px;
width: 5px;
cursor: col-resize;
}
.flexigrid div.cDrag div:hover,.flexigrid div.cDrag div.dragging {
background: url(images/line.gif) repeat-y 2px center;
}
.flexigrid div.iDiv {
border: 1px solid #316ac5;
position: absolute;
overflow: visible;
background: none;
}
.flexigrid div.iDiv input,.flexigrid div.iDiv select,.flexigrid div.iDiv textarea
{
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}
.flexigrid div.iDiv input.tb {
border: 0px;
padding: 0px;
width: 100%;
height: 100%;
padding: 0px;
background: none;
}
.flexigrid div.bDiv {
border: 1px solid #ccc;
border-top: 0px;
background: #fff;
overflow: auto;
position: relative;
}
.flexigrid div.bDiv table {
border-bottom: 1px solid #ccc;
}
.flexigrid div.hGrip {
position: absolute;
top: 0px;
right: 0px;
height: 5px;
width: 5px;
background: url(images/line.gif) repeat-x center;
margin-right: 1px;
cursor: col-resize;
}
.flexigrid div.hGrip:hover,.flexigrid div.hGrip.hgOver {
border-right: 1px solid #999;
margin-right: 0px;
}
.flexigrid div.vGrip {
height: 5px;
overflow: hidden;
position: relative;
background: #fafafa url(images/wbg.gif) repeat-x 0px -1px;
border: 1px solid #ccc;
border-top: 0px;
text-align: center;
cursor: row-resize;
}
.flexigrid div.vGrip span {
display: block;
margin: 1px auto;
width: 20px;
height: 1px;
overflow: hidden;
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
background: none;
}
.flexigrid div.hDiv th,.flexigrid div.bDiv td
/* common cell properties*/ {
text-align: left;
border-right: 1px solid #ddd;
border-left: 1px solid #fff;
overflow: hidden;
vertical-align: top !important;
padding-left: 0;
padding-right: 0;
}
.flexigrid div.hDiv th div,.flexigrid div.bDiv td div,div.colCopy div
/* common inner cell properties*/ {
padding: 5px;
border-left: 0px solid #fff;
}
.flexigrid div.hDiv th,div.colCopy {
font-weight: normal;
height: 24px;
cursor: default;
white-space: nowrap;
overflow: hidden;
}
div.colCopy {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
background: #fafafa url(images/fhbg.gif) repeat-x bottom;
border: 1px solid #ccc;
border-bottom: 0px;
overflow: hidden;
}
.flexigrid div.hDiv th.sorted {
background: url(images/wbg.gif) repeat-x 0px -1px;
border-bottom: 0px solid #ccc;
}
.flexigrid div.hDiv th.thOver {
}
.flexigrid div.hDiv th.thOver div,.flexigrid div.hDiv th.sorted.thOver div
{
border-bottom: 1px solid orange;
padding-bottom: 4px;
}
.flexigrid div.hDiv th.sorted div {
border-bottom: 0px solid #ccc;
padding-bottom: 5px;
}
.flexigrid div.hDiv th.thMove {
background: #fff;
color: #fff;
}
.flexigrid div.hDiv th.sorted.thMove div {
border-bottom: 1px solid #fff;
padding-bottom: 4px
}
.flexigrid div.hDiv th.thMove div {
background: #fff !important;
}
.flexigrid div.hDiv th div.sdesc {
background: url(images/dn.png) no-repeat center top;
}
.flexigrid div.hDiv th div.sasc {
background: url(images/up.png) no-repeat center top;
}
.flexigrid div.bDiv td {
border-bottom: 1px solid #fff;
vertical-align: top;
white-space: nowrap;
}
.flexigrid div.hDiv th div {
}
.flexigrid span.cdropleft {
display: block;
background: url(images/prev.gif) no-repeat -4px center;
width: 24px;
height: 24px;
position: relative;
top: -24px;
margin-bottom: -24px;
z-index: 3;
}
.flexigrid div.hDiv span.cdropright {
display: block;
background: url(images/next.gif) no-repeat 12px center;
width: 24px;
height: 24px;
float: right;
position: relative;
top: -24px;
margin-bottom: -24px;
}
.flexigrid div.bDiv td div {
border-top: 0px solid #fff;
padding-bottom: 4px;
}
.flexigrid tr td.sorted {
background: #f3f3f3;
border-right: 1px solid #ddd;
border-bottom: 1px solid #f3f3f3;
}
.flexigrid tr td.sorted div {
}
.flexigrid tr.erow td {
background: #f7f7f7;
border-bottom: 1px solid #f7f7f7;
}
.flexigrid tr.erow td.sorted {
background: #e3e3e3;
border-bottom: 1px solid #e3e3e3;
}
.flexigrid tr.erow td.sorted div {
}
.flexigrid div.bDiv tr:hover td,.flexigrid div.bDiv tr:hover td.sorted,.flexigrid div.bDiv tr.trOver td.sorted,.flexigrid div.bDiv tr.trOver td
{
background: #d9ebf5;
border-left: 1px solid #eef8ff;
border-bottom: 1px dotted #a8d8eb;
}
.flexigrid div.bDiv tr.trSelected:hover td,.flexigrid div.bDiv tr.trSelected:hover td.sorted,.flexigrid div.bDiv tr.trOver.trSelected td.sorted,.flexigrid div.bDiv tr.trOver.trSelected td,.flexigrid tr.trSelected td.sorted,.flexigrid tr.trSelected td
{
background: #d5effc url(images/hl.png) repeat-x top;
border-right: 1px solid #d2e3ec;
border-left: 1px solid #eef8ff;
border-bottom: 1px solid #a8d8eb;
}
/* novstripe adjustments */
.flexigrid.novstripe .bDiv table {
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
}
.flexigrid.novstripe div.bDiv td {
border-right-color: #fff;
}
.flexigrid.novstripe div.bDiv tr.erow td.sorted {
border-right-color: #e3e3e3;
}
.flexigrid.novstripe div.bDiv tr td.sorted {
border-right-color: #f3f3f3;
}
.flexigrid.novstripe div.bDiv tr.erow td {
border-right-color: #f7f7f7;
border-left-color: #f7f7f7;
}
.flexigrid.novstripe div.bDiv tr.trSelected:hover td,.flexigrid.novstripe div.bDiv tr.trSelected:hover td.sorted,.flexigrid.novstripe div.bDiv tr.trOver.trSelected td.sorted,.flexigrid.novstripe div.bDiv tr.trOver.trSelected td,.flexigrid.novstripe tr.trSelected td.sorted,.flexigrid.novstripe tr.trSelected td
{
border-right: 1px solid #0066FF;
border-left: 1px solid #0066FF;
}
.flexigrid.novstripe div.bDiv tr.trOver td,.flexigrid.novstripe div.bDiv tr:hover td
{
border-left-color: #d9ebf5;
border-right-color: #d9ebf5;
}
/* end novstripe */
.flexigrid div.pDiv {
background: url(images/wbg.gif) repeat-x 0 -1px;
border: 1px solid #ccc;
border-top: 0px;
overflow: hidden;
white-space: nowrap;
position: relative;
}
.flexigrid div.pDiv div.pDiv2 {
margin: 3px;
margin-left: -2px;
float: left;
width: 1024px;
}
div.pGroup {
float: left;
background: none;
height: 24px;
margin: 0px 5px;
}
.flexigrid div.pDiv .pPageStat,.flexigrid div.pDiv .pcontrol {
position: relative;
top: 5px;
overflow: visible;
}
.flexigrid div.pDiv input {
vertical-align: text-top;
position: relative;
top: -5px;
}
.flexigrid div.pDiv div.pButton {
float: left;
width: 22px;
height: 22px;
border: 0px;
cursor: pointer;
overflow: hidden;
}
.flexigrid div.pDiv div.pButton:hover,.flexigrid div.pDiv div.pButton.pBtnOver
{
width: 20px;
height: 20px;
border: 1px solid #ccc;
cursor: pointer;
}
.flexigrid div.pDiv div.pButton span {
width: 20px;
height: 20px;
display: block;
float: left;
}
.flexigrid div.pDiv div.pButton:hover span,.flexigrid div.pDiv div.pButton.pBtnOver span
{
width: 19px;
height: 19px;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
}
.flexigrid .pSearch {
background: url(images/magnifier.png) no-repeat center;
}
.flexigrid .pFirst {
background: url(images/first.gif) no-repeat center;
}
.flexigrid .pPrev {
background: url(images/prev.gif) no-repeat center;
}
.flexigrid .pNext {
background: url(images/next.gif) no-repeat center;
}
.flexigrid .pLast {
background: url(images/last.gif) no-repeat center;
}
.flexigrid .pReload {
background: url(images/load.png) no-repeat center;
}
.flexigrid .pReload.loading {
background: url(images/load.gif) no-repeat center;
}
/* ie adjustments */
.flexigrid.ie div.hDiv th div,.flexigrid.ie div.bDiv td div,div.colCopy.ie div
/* common inner cell properties*/ {
overflow: hidden;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/flexigrid.css | CSS | asf20 | 12,812 |
.ac_results {
padding: 0px;
border: 1px solid black;
background-color: white;
overflow: hidden;
z-index: 99999;
}
.ac_results ul {
width: 100%;
list-style-position: outside;
list-style: none;
padding: 0;
margin: 0;
}
.ac_results li {
margin: 0px;
padding: 2px 5px;
cursor: default;
display: block;
/*
if width will be 100% horizontal scrollbar will apear
when scroll mode will be used
*/
/*width: 100%;*/
font: menu;
font-size: 12px;
/*
it is very important, if line-height not setted or setted
in relative units scroll will be broken in firefox
*/
line-height: 16px;
overflow: hidden;
}
.ac_loading {
background: white url('indicator.gif') right center no-repeat;
}
.ac_odd {
background-color: #eee;
}
.ac_over {
background-color: #0A246A;
color: white;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/jquery.autocomplete.css | CSS | asf20 | 797 |
/*
* jQuery UI CSS Framework @VERSION
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
.ui-widget-content {display: none; border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
.ui-widget-content a { color: #222222/*{fcContent}*/; }
.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; border-radius: 4px/*{cornerRadius}*/; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/datetheme.css | CSS | asf20 | 19,410 |
.dongy, .thoat, .themmoi, .luu, .capnhat{
border: 0px;
margin: 10px 0px;
}
input.dongy{
background: url(../images/button.png) no-repeat scroll 0 0px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:87px;
cursor: pointer;
}
input.dongy:hover{
background: url(../images/button.png) no-repeat scroll 0 -30px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:87px;
cursor: pointer;
}
input.thoat{
background: url(../images/button.png) no-repeat scroll 0 -60px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:79px;
cursor: pointer;
}
input.thoat:hover{
background: url(../images/button.png) no-repeat scroll 0 -90px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:79px;
cursor: pointer;
}
input.themmoi{
background: url(../images/button.png) no-repeat scroll 0 -120px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:102px;
cursor: pointer;
}
input.themmoi:hover{
background: url(../images/button.png) no-repeat scroll 0 -150px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:102px;
cursor: pointer;
}
input.luu{
background: url(../images/button.png) no-repeat scroll 0 -180px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:67px;
cursor: pointer;
}
input.luu:hover{
background: url(../images/button.png) no-repeat scroll 0 -210px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:67px;
cursor: pointer;
}
input.capnhat{
background: url(../images/button.png) no-repeat scroll 0 -240px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:99px;
cursor: pointer;
}
input.capnhat:hover{
background: url(../images/button.png) no-repeat scroll 0 -270px transparent;
font-size:0 !important;
height:30px;
line-height:0 !important;
width:99px;
cursor: pointer;
}
/* -- ICON STYLES ----------------------------- */
.icon-16-archive { background-image: url(../images/menu/icon-16-archive.png); }
.icon-16-article { background-image: url(../images/menu/icon-16-article.png); }
.icon-16-banners { background-image: url(../images/menu/icon-16-banner.png); }
.icon-16-banners-clients { background-image: url(../images/menu/icon-16-banner-client.png); }
.icon-16-banners-tracks { background-image: url(../images/menu/icon-16-banner-tracks.png); }
.icon-16-banners-cat { background-image: url(../images/menu/icon-16-banner-categories.png); }
.icon-16-category { background-image: url(../images/menu/icon-16-category.png); }
.icon-16-checkin { background-image: url(../images/menu/icon-16-checkin.png); }
.icon-16-clear { background-image: url(../images/menu/icon-16-clear.png); }
.icon-16-component { background-image: url(../images/menu/icon-16-component.png); }
.icon-16-config { background-image: url(../images/menu/icon-16-config.png); }
.icon-16-content { background-image: url(../images/menu/icon-16-content.png); }
.icon-16-contact { background-image: url(../images/menu/icon-16-contacts.png); }
.icon-16-contact-cat { background-image: url(../images/menu/icon-16-contacts-categories.png); }
.icon-16-cpanel { background-image: url(../images/menu/icon-16-cpanel.png); }
.icon-16-default { background-image: url(../images/menu/icon-16-default.png); }
.icon-16-featured { background-image: url(../images/menu/icon-16-featured.png); }
.icon-16-groups { background-image: url(../images/menu/icon-16-groups.png); }
.icon-16-help { background-image: url(../images/menu/icon-16-help.png); }
.icon-16-help-this { background-image: url(../images/menu/icon-16-help-this.png); }
.icon-16-help-forum { background-image: url(../images/menu/icon-16-help-forum.png); }
.icon-16-help-docs { background-image: url(../images/menu/icon-16-help-docs.png); }
.icon-16-help-jed { background-image: url(../images/menu/icon-16-help-jed.png); }
.icon-16-help-jrd { background-image: url(../images/menu/icon-16-help-jrd.png); }
.icon-16-help-trans { background-image: url(../images/menu/icon-16-help-trans.png); }
.icon-16-help-community { background-image: url(../images/menu/icon-16-help-community.png); }
.icon-16-help-security { background-image: url(../images/menu/icon-16-help-security.png); }
.icon-16-help-dev { background-image: url(../images/menu/icon-16-help-dev.png); }
.icon-16-help-shop { background-image: url(../images/menu/icon-16-help-shop.png); }
.icon-16-info { background-image: url(../images/menu/icon-16-info.png); }
.icon-16-install { background-image: url(../images/menu/icon-16-install.png); }
.icon-16-language { background-image: url(../images/menu/icon-16-language.png); }
.icon-16-levels { background-image: url(../images/menu/icon-16-levels.png); }
.icon-16-logout { background-image: url(../images/menu/icon-16-logout.png); }
.icon-16-maintenance { background-image: url(../images/menu/icon-16-maintenance.png); }
.icon-16-massmail { background-image: url(../images/menu/icon-16-massmail.png); }
.icon-16-media { background-image: url(../images/menu/icon-16-media.png); }
.icon-16-menu { background-image: url(../images/menu/icon-16-menu.png); }
.icon-16-menumgr { background-image: url(../images/menu/icon-16-menumgr.png); }
.icon-16-messages { background-image: url(../images/menu/icon-16-messaging.png); }
.icon-16-messages-add { background-image: url(../images/menu/icon-16-new-privatemessage.png); }
.icon-16-messages-read { background-image: url(../images/menu/icon-16-messages.png); }
.icon-16-module { background-image: url(../images/menu/icon-16-module.png); }
.icon-16-newarticle { background-image: url(../images/menu/icon-16-newarticle.png); }
.icon-16-newcategory { background-image: url(../images/menu/icon-16-newcategory.png); }
.icon-16-newgroup { background-image: url(../images/menu/icon-16-newgroup.png); }
.icon-16-newlevel { background-image: url(../images/menu/icon-16-newlevel.png); }
.icon-16-newuser { background-image: url(../images/menu/icon-16-newuser.png); }
.icon-16-plugin { background-image: url(../images/menu/icon-16-plugin.png); }
.icon-16-purge { background-image: url(../images/menu/icon-16-purge.png); }
.icon-16-readmess { background-image: url(../images/menu/icon-16-readmess.png); }
.icon-16-redirect { background-image: url(../images/menu/icon-16-redirect.png); }
.icon-16-search { background-image: url(../images/menu/icon-16-search.png); }
.icon-16-section { background-image: url(../images/menu/icon-16-section.png); }
.icon-16-static { background-image: url(../images/menu/icon-16-static.png); }
.icon-16-stats { background-image: url(../images/menu/icon-16-stats.png); }
.icon-16-themes { background-image: url(../images/menu/icon-16-themes.png); }
.icon-16-trash { background-image: url(../images/menu/icon-16-trash.png); }
.icon-16-user { background-image: url(../images/menu/icon-16-user.png); }
.icon-16-writemess { background-image: url(../images/menu/icon-16-writemess.png); }
.icon-16-newsfeeds { background-image: url(../images/menu/icon-16-newsfeeds.png); }
.icon-16-newsfeeds-cat { background-image: url(../images/menu/icon-16-newsfeeds-cat.png); }
.icon-16-weblinks { background-image: url(../images/menu/icon-16-links.png); }
.icon-16-weblinks-cat { background-image: url(../images/menu/icon-16-links-cat.png); }
.icon-16-ebook { background-image: url(../images/menu/icon-16-ebook.png); }
.icon-16-photo { background-image: url(../images/menu/icon-16-photo.png); }
.icon-16-dienvien { background-image: url(../images/menu/icon-16-dienvien.png); }
.icon-16-phim { background-image: url(../images/menu/icon-16-phim.png); }
.icon-16-nhac { background-image: url(../images/menu/icon-16-nhac.png); }
/* -- TOOLBAR ICON STYLES ----------------------------- */
.icon-32-send { background-image: url(../images/toolbar/icon-32-send.png); }
.icon-32-delete { background-image: url(../images/toolbar/icon-32-delete.png); }
.icon-32-help { background-image: url(../images/toolbar/icon-32-help.png); }
.icon-32-cancel { background-image: url(../images/toolbar/icon-32-cancel.png); }
.icon-32-checkin { background-image: url(../images/toolbar/icon-32-checkin.png); }
.icon-32-options { background-image: url(../images/toolbar/icon-32-config.png); }
.icon-32-apply { background-image: url(../images/toolbar/icon-32-apply.png); }
.icon-32-back { background-image: url(../images/toolbar/icon-32-back.png); }
.icon-32-export { background-image: url(../images/toolbar/icon-32-export.png); }
.icon-32-forward { background-image: url(../images/toolbar/icon-32-forward.png); }
.icon-32-save { background-image: url(../images/toolbar/icon-32-save.png); }
.icon-32-edit { background-image: url(../images/toolbar/icon-32-edit.png); }
.icon-32-copy { background-image: url(../images/toolbar/icon-32-copy.png); }
.icon-32-move { background-image: url(../images/toolbar/icon-32-move.png); }
.icon-32-new { background-image: url(../images/toolbar/icon-32-new.png); }
.icon-32-upload { background-image: url(../images/toolbar/icon-32-upload.png); }
.icon-32-assign { background-image: url(../images/toolbar/icon-32-publish.png); }
.icon-32-html { background-image: url(../images/toolbar/icon-32-html.png); }
.icon-32-css { background-image: url(../images/toolbar/icon-32-css.png); }
.icon-32-menus { background-image: url(../images/toolbar/icon-32-menu.png); }
.icon-32-publish { background-image: url(../images/toolbar/icon-32-publish.png); }
.icon-32-unpublish { background-image: url(../images/toolbar/icon-32-unpublish.png); }
.icon-32-restore { background-image: url(../images/toolbar/icon-32-revert.png); }
.icon-32-trash { background-image: url(../images/toolbar/icon-32-trash.png); }
.icon-32-archive { background-image: url(../images/toolbar/icon-32-archive.png); }
.icon-32-unarchive { background-image: url(../images/toolbar/icon-32-unarchive.png); }
.icon-32-preview { background-image: url(../images/toolbar/icon-32-preview.png); }
.icon-32-default { background-image: url(../images/toolbar/icon-32-default.png); }
.icon-32-refresh { background-image: url(../images/toolbar/icon-32-refresh.png); }
.icon-32-save-new { background-image: url(../images/toolbar/icon-32-save-new.png); }
.icon-32-save-copy { background-image: url(../images/toolbar/icon-32-save-copy.png); }
.icon-32-error { background-image: url(../images/toolbar/icon-32-error.png); }
.icon-32-new-style { background-image: url(../images/toolbar/icon-32-new-style.png); }
.icon-32-delete-style { background-image: url(../images/toolbar/icon-32-delete-style.png); }
.icon-32-purge { background-image: url(../images/toolbar/icon-32-purge.png); }
.icon-32-remove { background-image: url(../images/toolbar/icon-32-remove.png); }
.toolbar-inactive { background-position: 0px 32px; }
/* -- HEADER ICON STYLES ----------------------------- */
.icon-48-generic { background-image: url(../images/header/icon-48-generic.png); }
.icon-48-banners { background-image: url(../images/header/icon-48-banner.png); }
.icon-48-banners-categories { background-image: url(../images/header/icon-48-banner-categories.png); }
.icon-48-banners-clients { background-image: url(../images/header/icon-48-banner-client.png); }
.icon-48-banners-tracks { background-image: url(../images/header/icon-48-banner-tracks.png); }
.icon-48-checkin { background-image: url(../images/header/icon-48-checkin.png); }
.icon-48-clear { background-image: url(../images/header/icon-48-clear.png); }
.icon-48-contact { background-image: url(../images/header/icon-48-contacts.png); }
.icon-48-contact-categories { background-image: url(../images/header/icon-48-contacts-categories.png); }
.icon-48-purge { background-image: url(../images/header/icon-48-purge.png); }
.icon-48-cpanel { background-image: url(../images/header/icon-48-cpanel.png); }
.icon-48-config { background-image: url(../images/header/icon-48-config.png); }
.icon-48-groups { background-image: url(../images/header/icon-48-groups.png); }
.icon-48-groups-add { background-image: url(../images/header/icon-48-groups-add.png); }
.icon-48-levels { background-image: url(../images/header/icon-48-levels.png); }
.icon-48-levels-add { background-image: url(../images/header/icon-48-levels-add.png); }
.icon-48-module { background-image: url(../images/header/icon-48-module.png); }
.icon-48-menu { background-image: url(../images/header/icon-48-menu.png); }
.icon-48-menu-add { background-image: url(../images/header/icon-48-menu-add.png); }
.icon-48-menumgr { background-image: url(../images/header/icon-48-menumgr.png); }
.icon-48-newsfeeds-categories { background-image: url(../images/header/icon-48-newsfeeds-cat.png); }
.icon-48-trash { background-image: url(../images/header/icon-48-trash.png); }
.icon-48-user { background-image: url(../images/header/icon-48-user.png); }
.icon-48-user-add { background-image: url(../images/header/icon-48-user-add.png); }
.icon-48-inbox { background-image: url(../images/header/icon-48-inbox.png); }
.icon-48-new-privatemessage { background-image: url(../images/header/icon-48-new-privatemessage.png); }
.icon-48-msgconfig { background-image: url(../images/header/icon-48-message_config.png); }
.icon-48-langmanager { background-image: url(../images/header/icon-48-language.png); }
.icon-48-mediamanager { background-image: url(../images/header/icon-48-media.png); }
.icon-48-plugin { background-image: url(../images/header/icon-48-plugin.png); }
.icon-48-help_header { background-image: url(../images/header/icon-48-help_header.png); }
.icon-48-impressions { background-image: url(../images/header/icon-48-stats.png); }
.icon-48-browser { background-image: url(../images/header/icon-48-stats.png); }
.icon-48-searchtext { background-image: url(../images/header/icon-48-stats.png); }
.icon-48-thememanager { background-image: url(../images/header/icon-48-themes.png); }
.icon-48-writemess { background-image: url(../images/header/icon-48-writemess.png); }
.icon-48-featured { background-image: url(../images/header/icon-48-featured.png); }
.icon-48-sections { background-image: url(../images/header/icon-48-section.png); }
.icon-48-article-add { background-image: url(../images/header/icon-48-article-add.png); }
.icon-48-article-edit { background-image: url(../images/header/icon-48-article-edit.png); }
.icon-48-article { background-image: url(../images/header/icon-48-article.png); }
.icon-48-categories { background-image: url(../images/header/icon-48-category.png); }
.icon-48-category-add { background-image: url(../images/header/icon-48-category-add.png); }
.icon-48-install { background-image: url(../images/header/icon-48-extension.png); }
.icon-48-dbbackup { background-image: url(../images/header/icon-48-backup.png); }
.icon-48-dbrestore { background-image: url(../images/header/icon-48-dbrestore.png); }
.icon-48-dbquery { background-image: url(../images/header/icon-48-query.png); }
.icon-48-systeminfo { background-image: url(../images/header/icon-48-info.png); }
.icon-48-massmail { background-image: url(../images/header/icon-48-massmail.png); }
.icon-48-redirect { background-image: url(../images/header/icon-48-redirect.png); }
.icon-48-search { background-image: url(../images/header/icon-48-search.png); }
.icon-48-newsfeeds { background-image: url(../images/header/icon-48-newsfeeds.png); }
.icon-48-newsfeeds-cat { background-image: url(../images/header/icon-48-newsfeeds-cat.png); }
.icon-48-weblinks { background-image: url(../images/header/icon-48-links.png); }
.icon-48-weblinks-categories { background-image: url(../images/header/icon-48-links-cat.png); }
.icon-48-nhac { background-image: url(../images/header/icon-48-nhac.png); }
.icon-48-tailieu { background-image: url(../images/header/icon-48-tailieu.png); }
.icon-48-phim { background-image: url(../images/header/icon-48-phim.png); }
/* Main toolbars */
div.toolbar-list {
float: left;
text-align: left;
padding: 0;
}
div.toolbar-list ul {
margin: 0;
padding: 0;
}
div.toolbar-list li {
padding: 1px 1px 3px 4px;
text-align: center;
color: #666;
height: 48px;
list-style: none;
float: left;
}
div.toolbar-list li.spacer {
width: 10px;
}
div.toolbar-list li.divider {
border-right: 1px solid #c7c7c7;
width: 2px;
}
div.toolbar-list span {
float: none;
width: 32px;
height: 32px;
margin: 0 auto;
display: block;
}
div.toolbar-list a {
display: block;
float: left;
white-space: nowrap;
border: 1px solid #F4F4F4;
padding: 1px 5px;
cursor: pointer;
text-decoration: none;
width: 40px;
}
div.toolbar-list a:hover {
border-left: 1px solid #eee;
border-top: 1px solid #eee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
text-decoration: none;
color: #0B55C4;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/icon.css | CSS | asf20 | 21,353 |
.p-title{
font-size: 16px;
font-weight: bold;
text-align: center;
margin:0 auto;
}
.title {
font-size: 13px;
font-weight: bold;
padding:10px 0;
}
.subcontent {
padding:5px;
}
.p-companyname{
font-weight: bold;
}
.p-date{
text-align: center;
}
table.printer{
margin-left: 20px;
width: 80%;
}
table.printer td{
font-size: 12px;
padding: 5px;
}
table.printer td.dot{
border-bottom: 1px dotted #e5e5e5;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/printer.css | CSS | asf20 | 487 |
.inputContainer {
position: relative;
float: left;
}
.formError {
position: absolute;
top: 300px;
left: 300px;
display: block;
z-index: 5000;
cursor: pointer;
}
.ajaxSubmit {
padding: 20px;
background: #55ea55;
border: 1px solid #999;
display: none
}
.formError .formErrorContent {
width: 100%;
background: #ee0101;
position:relative;
z-index:5001;
color: #fff;
width: 150px;
font-family: tahoma;
font-size: 11px;
border: 2px solid #ddd;
box-shadow: 0 0 6px #000;
-moz-box-shadow: 0 0 6px #000;
-webkit-box-shadow: 0 0 6px #000;
padding: 4px 10px 4px 10px;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}
.greenPopup .formErrorContent {
background: #33be40;
}
.blackPopup .formErrorContent {
background: #393939;
color: #FFF;
}
.formError .formErrorArrow {
width: 15px;
margin: -2px 0 0 13px;
position:relative;
z-index: 5006;
}
.formError .formErrorArrowBottom {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
margin: 0px 0 0 12px;
top:2px;
}
.formError .formErrorArrow div {
border-left: 2px solid #ddd;
border-right: 2px solid #ddd;
box-shadow: 0 2px 3px #444;
-moz-box-shadow: 0 2px 3px #444;
-webkit-box-shadow: 0 2px 3px #444;
font-size: 0px;
height: 1px;
background: #ee0101;
margin: 0 auto;
line-height: 0;
font-size: 0;
display: block;
}
.formError .formErrorArrowBottom div {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}
.greenPopup .formErrorArrow div {
background: #33be40;
}
.blackPopup .formErrorArrow div {
background: #393939;
color: #FFF;
}
.formError .formErrorArrow .line10 {
width: 15px;
border: none;
}
.formError .formErrorArrow .line9 {
width: 13px;
border: none;
}
.formError .formErrorArrow .line8 {
width: 11px;
}
.formError .formErrorArrow .line7 {
width: 9px;
}
.formError .formErrorArrow .line6 {
width: 7px;
}
.formError .formErrorArrow .line5 {
width: 5px;
}
.formError .formErrorArrow .line4 {
width: 3px;
}
.formError .formErrorArrow .line3 {
width: 1px;
border-left: 2px solid #ddd;
border-right: 2px solid #ddd;
border-bottom: 0 solid #ddd;
}
.formError .formErrorArrow .line2 {
width: 3px;
border: none;
background: #ddd;
}
.formError .formErrorArrow .line1 {
width: 1px;
border: none;
background: #ddd;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/validation.css | CSS | asf20 | 2,460 |
body{
padding: 0px;
margin: 0px;
font-family: Tahoma;
font-size: 12px;
}
img{
border: 0 none;
}
a{
text-decoration: none;
}
a:hover{
text-decoration: none;
}
.wrapper{
width: 100%;
margin: 0 auto;
padding: 0px;
}
.wrapper .header{
height: 27px;
background-color : #7A7878;
color: #FFFFFF;
}
.header .title{
width: 600px;
float: left;
}
.header .close{
width: 40px;
float: right;
}
.media-upload-header{
background-color:#F9F9F9;
border-bottom-color:#DFDFDF;
border-bottom-style:solid;
border-bottom-width:1px;
font-weight:bold;
margin:0;
padding:0 5px;
position:relative;
}
ul#menu{
bottom:-1px;
float:none;
font-weight:normal;
left:0;
margin:0 5px;
overflow:hidden;
}
#menu li{
display:inline;
line-height:200%;
list-style:none outside none;
margin:0;
padding:0;
text-align:center;
white-space:nowrap;
}
#menu a{
background-color:#F9F9F9;
border-color:#F9F9F9 #F9F9F9 #DFDFDF;
border-bottom-style:solid;
border-bottom-width:1px;
border-top-style:solid;
border-top-width:1px;
display:block;
float:left;
line-height:28px;
padding:0 7px;
}
#menu a.current {
background-color:#FFFFFF;
border-color:#DFDFDF #DFDFDF #FFFFFF;
color:#D54E21;-moz-border-radius:4px 4px 0 0;
border-style:solid;
border-width:1px;
font-weight:normal;
padding-left:6px;
padding-right:6px;
}
.media-items{
border-bottom:medium none;
border-style:solid solid none;
border-width:1px 1px medium;
width:623px;
border-bottom-color:#DFDFDF;
}
.media-items .media-item{
border-bottom-style:solid;
border-bottom-width:1px;
min-height:36px;
width:100%;
border-bottom-color:#DFDFDF;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/file.css | CSS | asf20 | 1,916 |
.btn_add_file {
background: url("../images/btn_add_file.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
cursor: pointer;
display: inline-block;
float: left;
height: 42px;
width: 120px;
}
.btn_add_file input {
cursor: pointer;
opacity: 0;
width: 100%;
}
.btn_start_upload {
background: url("../images/btn_start_upload.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
border: medium none;
cursor: pointer;
display: inline-block;
height: 42px;
width: 132px;
}
.progress_bar {
margin-top: 5px;
width: 300px;
}
.progress_bar .bar {
background: none repeat scroll 0 0 green;
border-radius: 3px;
height: 5px;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/button.css | CSS | asf20 | 705 |
/*
* jQuery UI Datepicker @VERSION
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/datepicker.css | CSS | asf20 | 4,102 |
body{
font-family: Tahoma;
font-size: 13px;
margin: 0px;
padding: 0px;
}
.wrapper{
padding: 0px;
margin: 0 auto;
}
body, textarea {
line-height:1.4em;
}
body, td, textarea, input, select {
font:12px "Tahoma",sans-serif;
font-size:13px;
}
a{
color:#222222;
text-decoration: none;
}
a:hover{
color:#F7933B;
text-decoration: none;
}
img{
border: 0px;
}
.full{
width: 98%;
}
.w200{
width: 200px;
}
.w250{
width: 250px;
}
.w300{
width: 300px;
}
.w350{
width: 350px;
}
.w400{
width: 400px;
}
.w500{
width: 500px;
}
.field{
-moz-border-radius:5px 5px 5px 5px;
background:none repeat scroll 0 0 transparent;
border:1px solid #C0C0C0;
color:black;
font-size:12px;
height:15px;
margin:0 0 12px;
padding:2px 0 2px 5px;
}
select{
-moz-border-radius:5px 5px 5px 5px;
background:none repeat scroll 0 0 transparent;
border:1px solid #C0C0C0;
color:black;
font-size:12px;
height:23px;
margin:0 0 12px;
padding:2px 5px 2px 5px;
}
select option{
height: 20px;
padding-left: 10px;
}
.field:focus {
-moz-box-shadow:0 2px 1px #E1E1E1;
border:1px solid #B5B5B5;
}
ul,dl {
list-style-type: none;
margin: 0;
padding: 0;
}
.wrapper .header{
height: 27px;
background-color : #7A7878;
color: #FFFFFF;
}
.header .title{
width: 600px;
float: left;
}
.header .close{
width: 40px;
float: right;
}
.media-upload-header{
background-color:#F9F9F9;
border-bottom-color:#DFDFDF;
border-bottom-style:solid;
border-bottom-width:1px;
font-weight:bold;
margin:0;
padding:0 5px;
position:relative;
}
ul#menu{
bottom:-1px;
float:none;
font-weight:normal;
left:0;
margin:0 5px;
overflow:hidden;
}
#menu li{
display:inline;
line-height:200%;
list-style:none outside none;
margin:0;
padding:0;
text-align:center;
white-space:nowrap;
}
#menu a{
background-color:#F9F9F9;
border-color:#F9F9F9 #F9F9F9 #DFDFDF;
border-top-style:solid;
border-top-width:1px;
display:block;
float:left;
line-height:28px;
padding:0 7px;
font-size: 14px;
}
#menu a.current {
background-color:#FFFFFF;
border-color:#DFDFDF #DFDFDF #FFFFFF;
color:#D54E21;-moz-border-radius:4px 4px 0 0;
border-style:solid;
border-width:1px;
font-weight:normal;
padding-left:6px;
padding-right:6px;
font-size: 14px;
font-weight: bold;
}
.form_upload{
background-color : #F9F9F9;
}
table.site{
width: 100%;
border: 1px solid gray;
border-collapse: collapse;
border-spacing: 0;
}
table.site thead{
background:none repeat scroll 0 0 bisque;
border-bottom: 1px solid #FFF;
text-align: center;
}
table.site td.click, table.site th.click{
background-color: #E1F5FA;
}
table.site td, table.site th {
border: 1px solid #e5e5e5;
padding: 2px 5px;
cursor: pointer;
}
table.site td.hover, table.site tr.hover{
background-color: #E1F5FA;
}
table.site th.hover, table.site tfoot td.hover{
background-color: ivory;
}
table.site td.hovercell, table.site th.hovercell{
background-color: #FAF6CA;}
table.site td.hoverrow, table.site th.hoverrow{
background-color: #6df;
}
table.pop td{
vertical-align: top;
}
table.form{
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #DADADA;
border-collapse: separate;
border-spacing: 1px;
caption-side: top;
empty-cells: show;
width: 100%;
}
table.form tbody{
background: none repeat scroll 0 0 #F7F7F7;
}
table.form td{
padding: 5px 10px;
}
table.form td.label{
text-align: right;
width: 150px;
padding:5px;
background: #EBEBEB;
vertical-align: top;
}
table.form td.required {
background: #EBEBEB url("../images/required_mark.gif") no-repeat right 8px;
padding-right: 15px;
}
.clear{
clear: both;
}
/* Upload css */
.multi_upload{
}
.multi_upload .upload_wrap{
padding: 10px;
width: 900px;
}
.multi_upload .preview{
background: none;
}
/* Upload css */ | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/layout_basic.css | CSS | asf20 | 4,371 |
body {
color: #222222;
margin: 0px;
padding: 0px;
font: 12px "Tahoma", sans-serif;
line-height: 18px;
}
h1, h2, h3, h4, h5 {
margin: 0px;
padding: 0px;
}
body, textarea {
line-height: 1.4em;
}
textarea, input, select {
font: 12px "Tahoma", sans-serif;
font-size: 13px;
padding: 3px 4px;
}
.cred {
color: #FF9522;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
table a {
color: #0669AF;
text-decoration: none;
}
table a:hover {
color: #F7933B;
text-decoration: none;
}
table a span.next {
background: url("../images/nex.png") no-repeat scroll 4px 4px rgba(0, 0, 0, 0);
display: inline-block;
height: 20px;
width: 20px;
}
table a:hover span.next {
background: url("../images/next.png") no-repeat scroll 4px 4px #169c79;
display: inline-block;
height: 20px;
width: 20px;
}
table a span.prev {
background: url("../images/pre.png") no-repeat scroll 4px 4px rgba(0, 0, 0, 0);
display: inline-block;
height: 20px;
width: 20px;
}
table a:hover span.prev {
background: url("../images/prev.png") no-repeat scroll 4px 4px #169c79;
display: inline-block;
height: 20px;
width: 20px;
}
.submit {
background: url(../images/h_box.jpg) repeat-x bottom;
border: 1px solid #1861BA;
color: #FFF;
cursor: pointer;
cursor: hand;
}
a {
color: #0669AF;
text-decoration: none;
}
a:hover {
color: #F7933B;
text-decoration: none;
}
img {
border: 0px;
}
.full {
width: 95%;
}
.w10 {
width: 10px;
}
.w20 {
width: 10px;
}
.w30 {
width: 10px;
}
.w50 {
width: 50px;
}
.w100 {
width: 100px;
}
.w150 {
width: 150px;
}
.w200 {
width: 200px;
}
.w250 {
width: 250px;
}
.w300 {
width: 300px;
}
.w350 {
width: 350px;
}
.w400 {
width: 400px;
}
.w500 {
width: 500px;
}
.w710 {
width: 710px;
}
.clear{
clear: both;
}
.max {
width: 600px;
}
.field {
-moz-border-radius: 5px 5px 5px 5px;
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #C0C0C0;
color: black;
font-size: 12px;
height: 15px;
margin: 0 0 5px 0;
padding: 2px 0 2px 5px;
}
select {
border: 1px solid #DDDDDD;
padding: 2px;
}
input {
background-color: #FFFFFF;
border: 1px solid #CCC;
}
.field:focus {
-moz-box-shadow: 0 2px 1px #E1E1E1;
border: 1px solid #B5B5B5;
}
ul, dl {
list-style-type: none;
margin: 0;
padding: 0;
}
.button {
-moz-border-radius: 5px 5px 5px 5px;
-moz-box-shadow: 0 1px 2px #343434;
cursor: pointer;
font-weight: bold;
padding: 4px 8px;
text-decoration: none;
text-transform: capitalize;
}
.fl {
float: left !important;
}
.fr {
float: right !important;
}
.preview {
background: url("../images/preview.png") no-repeat scroll center center transparent;
}
.logout {
background: url("../images/logout.png") no-repeat scroll center center transparent;
}
.admin {
background: url("../images/admin.png") no-repeat scroll center center transparent;
}
.center {
text-align: center;
}
.icon_single {
display: block;
height: 16px;
width: 16px;
}
.icon_text {
float: left;
height: 16px;
margin-right: 5px;
width: 16px;
}
.s_1 {
background: url("../images/spacer.jpg") no-repeat scroll center top transparent;
height: 27px;
padding: 0 10px;
width: 1px;
}
.logo {
font-size: 14px;
font-weight: bold;
padding: 2px 10px;
}
#logged {
line-height: 26px;
padding-right: 10px;
}
/***/
.white {
background: url("../images/back_white.jpg") repeat-x scroll left top #DFDFDF;
border: 1px solid white;
}
.white:hover {
background: url("../images/back_white_hover.jpg") repeat-x scroll left top white;
}
.red {
background: url("../images/back_red.jpg") repeat-x scroll left top #940101;
border: 1px solid #EB0000;
color: white !important;
}
.red:hover {
background: url("../images/back_red_hover.jpg") repeat-x scroll left top #CB0000;
}
.black {
background: url("../images/back_black.jpg") repeat-x scroll left top #141213;
border: 1px solid black;
color: white !important;
}
.black:hover {
background: url("../images/back_black_hover.jpg") repeat-x scroll left top #292728;
}
/***/
#wrapper {
height: auto;
margin: 0 auto;
overflow: hidden;
}
#topbar {
background: url("../images/back_topbar.jpg") repeat-x scroll left top transparent;
height: 26px;
padding: 6px 20px;
}
#topbar li {
float: left;
}
li {
list-style: none outside none;
}
.menubar {
background: url(../images/tab_bg.png) repeat-x;
border: 1px solid #CCCCCC;
height: 30px;
}
#admincontent {
}
#admincontent #c_left {
width: 49%;
min-height: 300px;
float: left;
}
#admincontent #c_right {
width: 49%;
min-height: 300px;
float: right;
}
/**
* Box
*/
.box-header {
background: #ececec url("../images/h_box.jpg") repeat-x left top;
height: 30px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
line-height: 30px;
padding: 0 0 0 10px;
margin: 0;
text-transform: capitalize;
font-weight: bold;
cursor: move;
text-shadow: 0 1px 0 white;
font-size: 14px;
-moz-box-shadow: 0 0 2px #dddddd;
-webkit-box-shadow: 0 0 2px #dddddd;
border: 1px solid #0669AF;
color: white;
text-shadow: 0 1px 0 #014B80;
}
.box-white {
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-moz-box-shadow: 0 0 2px #DDDDDD;
background: url("../images/h-box-white.jpg") repeat-x scroll left top #ECECEC;
border: 1px solid #D8D8D8;
color: #0669AF;
cursor: move;
font-size: 14px;
font-weight: bold;
height: 30px;
line-height: 30px;
margin: 0;
padding: 0 10px;
text-shadow: 0 1px 0 white;
}
.box-content {
background: none repeat scroll 0 0 white;
border: 1px solid #D8D8D8;
border-radius: 5px 5px 5px 5px;
box-shadow: 2px 2px 2px #DDDDDD;
margin-bottom: 10px;
overflow: hidden;
padding: 10px;
min-height: 400px;
}
.boxcontent {
background: none repeat scroll 0 0 white;
border: 1px solid #D8D8D8;
border-radius: 5px 5px 5px 5px;
box-shadow: 2px 2px 2px #DDDDDD;
margin-bottom: 10px;
overflow: hidden;
padding: 10px;
min-height: 400px;
}
#cpanel div.icon a {
color: #565656;
text-decoration: none;
}
#cpanel img {
margin: 0 auto;
padding: 10px 0;
}
#cpanel div.icon {
background-color: #FFFFFF;
float: left;
margin-bottom: 15px;
margin-right: 15px;
text-align: center;
}
#cpanel div.icon a {
border: 1px solid #EAEAEA;
color: #565656;
display: block;
float: left;
height: 97px;
text-decoration: none;
vertical-align: middle;
width: 108px;
}
#cpanel div.icon a:hover {
border-left: 1px solid #eee;
border-top: 1px solid #eee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background: #fbfbfb;
color: #025A8D;
}
#cpanel img {
padding: 10px 0;
margin: 0 auto;
}
#cpanel span {
display: block;
text-align: center;
}
/**
*Table
*/
table.admindata {
border-collapse: collapse;
clear: both;
margin: 0 auto;
width: 100%;
border-spacing: 0;
}
table.admindata thead th {
background: url("../images/h-box-white.jpg") repeat-x scroll left top #E8E8E8;
border: 1px solid #E1E1E1;
padding: 3px 5px;
color: #555555;
text-align: left;
font-weight: bold;
}
table.admindata thead tr th.head {
background-image: url(../images/h-box-white.jpg);
background-repeat: repeat-x;
background-position: center right;
border: 1px solid #E1E1E1;
padding: 3px 5px;
color: #555555;
text-align: left;
font-weight: 100;
cursor: default;
}
table.admindata thead tr th.lockhead {
background-image: none;
background-repeat: repeat-x;
background-position: center right;
border: 1px solid #E1E1E1;
padding: 3px 5px;
color: #555555;
text-align: left;
font-weight: 100;
cursor: default;
}
table.admindata thead th.checkbox {
width: 30px;
}
table.admindata thead th.publish {
width: 100px;
}
table.admindata tfoot td {
background: url("../images/h-box-white.jpg") repeat-x scroll left top #E8E8E8;
border: 1px solid #E1E1E1;
color: #555555;
padding: 3px 0 3px 5px;
text-align: left;
}
table.admindata tr.row1 td {
background-color: #FFFFFF;
border: 1px solid #E1E1E1;
color: #555555;
padding: 3px 0 3px 5px;/*text-align: left;*/
}
table.admindata tr.row0 td {
background-color: #F5F5F5;
border: 1px solid #E1E1E1;
color: #1A6699;
padding: 3px 0 3px 5px;/*text-align: left;*/
}
table.admindata tr.row1:hover td {
background-color: #FAEABB;
}
table.admindata tr.row0:hover td {
background-color: #FAEABB;
}
/* tables */
table.admindata thead tr .header {
background-image: url(../images/bg.gif);
background-repeat: no-repeat;
background-position: center right;
cursor: pointer;
}
table.admindata tbody td {
color: #3D3D3D;
padding: 4px;
background-color: #FFF;
vertical-align: top;
}
table.admindata tbody tr.odd td {
background-color: #F0F0F6;
}
table.admindata thead tr .headerSortUp {
background-image: url(../images/asc.gif);
}
table.admindata thead tr .headerSortDown {
background-image: url(../images/desc.gif);
}
table.admindata thead tr .headerSortDown, table.admindata thead tr .headerSortUp {
background-color: #8dbdd8;
}
td ul.price li {
list-style: none;
font-size: 13px;
color: #FA7414;
}
ul.price li span {
font-weight: bold;
color: #1386D7;
}
td {
vertical-align: top;
}
table.admindata tr.row1:hover {
background-color: #FAEABB;
color: #0C5D7D;
}
table.admindata tr.row1 td:hover {
background-color: #FCE59F;
color: #0C5D7D;
}
table.admindata tr.row0:hover {
background-color: #FAEABB;
color: #0C5D7D;
}
table.admindata tr.row0 td:hover {
background-color: #FCE59F;
color: #0C5D7D;
}
/*******Admin Form**********>
*
*/
table.adminform {
border-collapse: collapse;
clear: both;
min-width : 50%;
border-spacing: 0;
}
table.adminform tr td {
border: 1px solid #E1E1E1;
cursor: pointer;
padding: 3px 5px 3px 5px;
color: #555555;
text-align: left;
background-color: #F5F5F5;
vertical-align: top;
}
table.adminform tr td.max {
width: 200px;
}
table.adminform tr td.footer {
border: 0 none;
background-color: #FFFFFF;
}
/*
*Label
**/
.form_label {
color: #373737;
display: block;
font-size: 11px;
font-weight: bold;
height: 20px;
text-transform: uppercase;
}
.row_action {
padding: 3px 0 0;
visibility: hidden;
font-size: 11px;
}
.row_action span a {
padding: 0px 5px;
color: #1D75C2;
}
ul.list_img li {
float: left;
width: 100px;
height: 100px;
overflow: hidden;
margin: 5px;
}
ul.list_img li img {
width: 100px;
height: 70px;
}
.tabs {
/*background: url("../images/tabs_bg.gif") repeat scroll left top #F4F4F4;*/
background: #F4F4F4;
padding: 0 0 0 12px;
vertical-align: bottom;
overflow: hidden;
}
.tabs ul {
max-width: 966px;
vertical-align: bottom;
}
.tabs ul li.cm-active, .tabs ul li {
cursor: pointer;
float: left;
height: 16px;
margin: 2px 0 0;
padding: 4px 11px 6px;
vertical-align: bottom;
white-space: nowrap;
}
.tabs ul li.cm-active {
background-color: #FFFFFF;
border-color: #D1D3D6;
border-style: solid;
border-width: 1px 1px 0;
margin: 3px 0 2px;
padding: 2px 11px 4px;
}
.tabs ul li a, .tabs ul li a:visited, .tabs ul li a:hover, .tabs ul li a:active {
font: 11px Verdana, Geneva, Arial, Helvetica, sans-serif;
}
.tabs ul li.cm-active a, .tabs ul li.cm-active a:visited, .tabs ul li.cm-active a:hover, .tabs ul li.cm-active a:active {
color: #000000;
font: bold 11px Verdana, Geneva, Arial, Helvetica, sans-serif;
text-decoration: none;
}
.tabs ul li a:hover {
text-decoration: none;
}
.tabs ul li.cm-active img {
vertical-align: -5px;
}
.cm-tabs-content {
background-color: #FFFFFF;
}
.cm-tabs-content .items-container .no-items {
margin: 6px;
}
.tabs .float-right {
padding-top: 8px;
}
.hidden {
display: none;
overflow: hidden;
}
h2.subheader {
background-position: left 2px;
border-bottom: 1px dotted #BBBBBB;
clear: both;
color: #494949;
font: bold 16px Arial, Helvetica, sans-serif;
margin: 17px 0 3px;
padding: 0 0 4px;
}
table.form {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #DADADA;
border-collapse: separate;
border-spacing: 1px;
caption-side: top;
empty-cells: show;
width: 100%;
}
table.form tbody {
background: none repeat scroll 0 0 #F7F7F7;
}
table.form td {
padding: 5px 10px;
}
table.form td.label {
text-align: right;
width: 150px;
padding: 5px;
background: #EBEBEB;
}
table.form td.required {
background: #EBEBEB url("../images/required_mark.gif") no-repeat right 8px;
padding-right: 15px;
}
.order-o {
background-color: #FF9522;
}
.order-status {
background: url("../images/button_mask_right.png") no-repeat scroll 100% 0 #FF9522;
color: #FFFFFF;
display: block;
font-weight: bold;
margin-right: 10px;
padding-right: 3px;
}
.order-status em {
background: url("../images/button_mask_left.png") no-repeat scroll 0 0 transparent;
display: block;
font: 11px Arial, Helvetica, sans-serif;
padding: 2px 0 2px 3px;
text-align: center;
text-transform: uppercase;
white-space: nowrap;
}
.detail-block {
background-color: #F2F9DB;
height: 100%;
margin: 8px 0;
padding: 8px 16px;
}
table.order {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #D9D9D9;
border-collapse: collapse;
color: #404040;
border-spacing: 0;
width: 100%;
}
table.order th {
background: none repeat scroll 0 0 #11A5E1;
border-color: #595959 #595959 #000000;
border-style: solid;
border-width: 1px 1px 2px;
color: #FFFFFF;
font-size: 1.1em;
}
table.order td, table.order th {
border: 1px dashed #E5E5E5;
padding: 3px 5px;
}
table.order tbody tr:hover {
background: none repeat scroll 0 0 #FCFAE3;
}
table.order tbody tr:hover th, table.order tbody tr.row0:hover th {
background: none repeat scroll 0 0 #FCFAE3;
}
table.order tbody tr.row0 {
background: none repeat scroll 0 0 #F2F2F2;
border-bottom: 1px dotted #CCCCCC;
padding: 2px;
}
table.order tfoot th, table.order tfoot td {
background-color: #D9D9D9;
border: medium none;
color: #000000;
font-size: 1.1em;
padding: 4px 10px;
}
table.time {
padding: 0px;
margin: 0px;
}
.text-right {
text-align: right;
}
.cls_require {
color: red;
}
.cls_link {
color: #1D75C2;
cursor: pointer;
cursor: hand;
}
h3 {
margin: 3px;
}
#upload_button {
margin: 10px 200px;
padding: 8px 5px 8px 5px;
font-weight: normal;
font-size: 1em;
font-family: Georgia, Arial, Helvetica, sans-serif;
text-align: center;
background: #000000;
color: #ffffff;
border: 2px solid #DADADA;
width: 150px;
cursor: pointer !important;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#status_message {
font-family: Arial;
padding: 5px;
color: #b00000;
font-size: 12px;
font-weight: bold;
}
ul#list_img {
list-style: none;
padding: 0;
margin: 0;
}
ul#list_img li {
color: #666565;
float: left;
margin-bottom: 2px;
margin-right: 10px;
padding: 5px;
text-align: left;
width: 85px;
}
ul#list_img li img {
cursor: pointer;
}
.success {
border: 1px solid #cccccc;
}
/*
.error{ background:#FF0000; border:1px solid #cc6622; }
*/
.list_menufacture {
height: 300px;
margin: 5px 0;
overflow-x: hidden;
overflow-y: scroll;
padding: 0;
width: 100%;
}
div.contenttab {
border: 1px solid #e5e5e5;
padding: 5px;
background-color: #F4F4F4;
}
ul.tabui {
overflow: hidden;
margin-bottom: 10px;
}
ul.tabui li {
list-style: none;
padding: 5px 10px;
float: left;
}
ul.tabui li.select {
background-color: #FFF;
border: 1px solid #e5e5e5;
margin-left: 5px;
}
span.permit_name {
float: left;
margin-right: 5px;
width: 100px;
}
.permission_name {
font-size: 13px;
border-bottom: 1px solid #e5e5e5;
margin-top : 10px;
}
.btnloadgroup {
background: #CCC;
border: 1px solid #333;
padding: 5px 3px;
/*width: 40px;*/
color: #000;
}
.btnloadshow {
background: #CCC;
border: 1px solid #333;
padding: 5px 3px;
width: 40px;
color: #000;
}
.colorbox {
background: #CCC;
border: 1px solid #333;
padding: 5px 3px;
/*width: 40px;*/
color: #000;
}
.btndelete {
background: #CCC;
border: 1px solid #333;
padding: 5px 3px;
width: 80px;
color: #000;
}
/*Begin search bar */
.search_bar {
width: 500px;
float: left;
text-align: left;
margin-left: 14px;
}
.key_search {
}
.field_search {
}
.btn_search {
cursor: pointer;
cursor: hand;
}
.search_bar_file {
width: 300px;
text-align: left;
margin-left: 14px;
float: left;
}
/*End search bar */
.err_txt {
color: #CB0000;
}
.war_txt {
color: #FF9522;
}
.suc_txt {
color: #55ea55;
}
.lib_img {
background: url('../images/icon/add_image.png') no-repeat;
width: 32px;
height: 32px;
display: inline-block;
}
.add_img {
background: #5CB85C;
padding: 5px 10px;
color: #FFFFFF;
font-size: 14px;
margin: 3px;
display: inline-block;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.add_img:hover {
background: #47A447;
}
.del_img {
background: #D9534F;
padding: 5px 10px;
color: #FFFFFF;
font-size: 14px;
margin: 3px;
display: inline-block;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.del_img:hover {
background: #D2322D;
}
/*Begin css gallery*/
#list_image #ul.gallery {
width: 350px;
list-style-type: none;
margin: 0px;
padding: 0px;
}
#list_image #gallery li {
float: left;
padding: 5px;
width: 245px;
}
#list_image #gallery li div {
text-align: center;
}
#list_image #gallery li div .gallery-clean {
height: 244px;
overflow: hidden;
width: 245px;
border: solid 2px #E5E5E5;
}
#list_image #gallery li div .image {
display: block;
height: 207px;
margin: 14px 22px 23px 15px;
overflow: hidden;
width: 208px;
}
#list_image #gallery li div .image img{
width: 100%;
}
#list_image #gallery li div .image:hover {
cursor: move;
}
#list_image #gallery .placeHolder div {
background-color: white!important;
border: dashed 1px gray !important;
}
#list_image #gallery a.ico {
display: block;
float: left;
height: 21px;
margin: 0 6px;
width: 28px;
}
#list_image #gallery .list_ico {
text-align: center;
}
#list_image #gallery a.ico-delete {
background: url("../images/icon/delete1.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
}
#list_image #gallery a.ico-edit {
background: url("../images/icon/edit.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
}
#list_image #gallery a.ico-resize {
background: url("../images/icon/resize.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
}
#list_image #gallery a.ico-full {
background: url("../images/icon/full-screen.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
}
#list_image #gallery a.ico:active, #list_image #gallery a.ico:hover {
background-position: 0 -21px;
}
#list_image #gallery a.ico span {
display: none;
}
/*End gallery*/
.awesome {
background: #222;
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
font-weight: bold;
line-height: 1;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
text-shadow: 0 -1px 1px #222;
border-bottom: 1px solid #222;
position: relative;
cursor: pointer;
}
.awesome:hover { background-color: #111; color: #fff; }
/*Multiupload css*/
.btn_add_file{
background: url('../images/btn_add_file.png') no-repeat;
width: 120px;
height: 42px;
cursor: pointer;
display: inline-block;
float: left;
}
.btn_add_file input {
filter: alpha(opacity=0);
opacity: 0;
width: 100%;
cursor: pointer;
}
.btn_start_upload{
background: url('../images/btn_start_upload.png') no-repeat;
width: 132px;
height: 42px;
cursor: pointer;
border: none;
display: inline-block;
}
.progress_bar{
margin-top: 5px;
width: 300px;
}
.progress_bar .bar {
height: 8px;
background: green;
border-radius: 3px;
}
/*Multiupload css*/
/*Chart css*/
.chart_btn{
border: solid 1px #11A5E1;
background: #0081C3;
border-radius: 5px;
color: #FFFFFF;
font-weight: bold;
cursor: pointer;
}
.chart_song_list_wrap{
width: 800px;
height:300px;
border:1px solid #999999;
overflow:scroll;
margin-top: 10px;
}
/*End chart css*/
/*paging all*/
/*.paging {
display: block;
float: right;
margin: 0 auto;
width: 215px;
}
.paging strong {
background: none repeat scroll 0 0 #169c79;
color: #FFF;
display: block;
float: left;
height: 19px;
margin: 0px 2px;
padding: 2px;
text-align: center;
width: 20px;
}
.paging a {
color: #000;
border:1px solid #999;
background: none repeat scroll 0 0 #999;
display: block;
float: left;
height: 20px;
margin: 0px 2px;
padding: 0px;
text-align: center;
width: 20px;
}
.paging a:hover {
color: #000;
border:1px solid #169c79;
background: none repeat scroll 0 0 #169c79;
display: block;
float: left;
height: 20px;
margin: 0px 2px;
padding: 0px;
text-align: center;
width: 20px;
}
.paging a span.next {
background: url("../images/nex.png") no-repeat scroll 4px 5px rgba(0, 0, 0, 0);
display: block;
height: 20px;
width: 20px;
}
.paging a:hover span.next {
background: url("../images/next.png") no-repeat scroll 4px 5px #169c79;
display: block;
height: 20px;
width: 20px;
}
.paging a span.prev {
background: url("../images/pre.png") no-repeat scroll 4px 5px rgba(0, 0, 0, 0);
display: block;
height: 20px;
width: 20px;
}
.paging a:hover span.prev {
background: url("../images/prev.png") no-repeat scroll 4px 5px #169c79;
display: block;
height: 20px;
width: 20px;
}*/
/*end paging*/ | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/administrator.css | CSS | asf20 | 22,320 |
/* jqModal base Styling courtesy of;
Brice Burgess <bhb@iceburg.net> */
/* The Window's CSS z-index value is respected (takes priority). If none is supplied,
the Window's z-index value will be set to 3000 by default (via jqModal.js). */
.jqmWindow {
display: none;
position: fixed;
top: 17%;
left: 50%;
margin-left: -300px;
width: 600px;
background-color: #EEE;
color: #333;
border: 1px solid black;
padding: 12px;
}
.jqmOverlay { background-color: #000; }
/* Background iframe styling for IE6. Prevents ActiveX bleed-through (<select> form elements, etc.) */
* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;
width: expression(this.parentNode.offsetWidth+'px');
height: expression(this.parentNode.offsetHeight+'px');
}
/* Fixed posistioning emulation for IE6
Star selector used to hide definition from browsers other than IE6
For valid CSS, use a conditional include instead */
* html .jqmWindow {
position: absolute;
top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/jqModal.css | CSS | asf20 | 1,232 |
div.tagsinput {
border: 1px solid #CCC;
background: #FFF;
padding: 5px;
width: 300px;
height: 20px;
overflow-y: auto;
}
div.tagsinput span.tag {
border: 1px solid #CCCCCC;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
display: block;
float: left;
padding: 5px;
text-decoration: none;
background: #EBEBEB;
color: #444;
margin-right: 5px;
/*margin-bottom: 5px;*/
font-family: helvetica;
font-size: 13px;
}
div.tagsinput span.tag a {
font-weight: bold;
color: #444;
text-decoration: none;
font-size: 11px;
}
div.tagsinput input {
width: 80px;
font-family: helvetica;
font-size: 13px;
border: 1px solid transparent;
padding: 0 5px;
background: transparent;
color: #000;
outline: 0px;
margin:6px 0 0;
}
div.tagsinput div {
display: block;
float: left;
}
.tags_clear {
clear: both;
width: 100%;
height: 0px;
}
.not_valid {
background: #FBD8DB !important;
color: #90111A !important;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/jquery.tagsinput.css | CSS | asf20 | 977 |
/* -- BASIC MENU STYLES ----------------------------- */
#menu, #menu ul, #menu li {
margin: 0;
padding: 0;
border: 0 none;
font-size: 11px;
}
#menu {
position: relative;
z-index: 100;
}
#menu li {
float: left;
position: relative;
list-style: none;
display: inline;
}
#menu li.node {
background: transparent url(../images/j_arrow_down.png) no-repeat 10px 50%;
}
#menu li a {
display: block;
white-space: nowrap;
cursor: pointer;
}
#menu li ul {
visibility: hidden;
position: absolute;
width:170px;
}
#menu li li ul {
top: 0;
left: 0;
}
#menu li:hover ul {
visibility: visible;
}
#menu li:hover ul li ul {
visibility: hidden;
}
#menu li:hover li:hover ul {
visibility: visible;
left: 100%;
}
/* ---- Menu layout -------------------------- */
#menu li {
border-left: 1px solid #fff;
border-right: 1px solid #d8d8d8;
}
#menu li li {
border: 0;
display: block;
float: none;
}
#menu ul {
border: 0.1em solid #ccc;
background: #f6f6f6;
}
#menu ul li.node {
background: transparent url(../images/j_arrow.png) no-repeat right 50%;
}
#menu ul li.separator {
background: #DDE1E6 url(../images/bg-menu.gif);
height: 1px;
}
#menu a, #menu div {
padding: 6px 25px;
margin: 0 1px 0 1px;
color: #333333;
line-height: 1.6em;
vertical-align: middle;
font-size: 1em;
font-weight: bold;
text-decoration: none;
cursor: default;
background-repeat: no-repeat;
background-position: left 50%;
}
#menu li.disabled a, #menu li.disabled:hover a {
color: gray;
background-color: transparent;
margin: 0 1px;
border-left-width: 0;
border-right-width: 0;
}
#menu ul a {
font-size: 1em;
font-weight: normal;
padding-right: 20px;
line-height: 1.2em;
}
/* 1 level - hover */
#menu li:hover a {
background-color: #dbe4e9;
border-left: 1px solid #025a8d;
border-right: 1px solid #025a8d;
margin: 0;
}
/* 2 level - normal */
#menu li:hover li a {
background-color: transparent;
border: 1px solid transparent;
margin: 1px;
}
/* 2 level - hover */
#menu li:hover li:hover a {
background-color: #dbe4e9;
border-color: #025a8d;
}
/* 3 level - normal */
#menu li:hover li:hover li a {
background-color: transparent;
border-color: transparent;
}
/* 3 level - hover */
#menu li:hover li:hover li a:hover {
background-color: #dbe4e9;
border-color: #025a8d;
}
a.icon-16-menu span img {
height: 16px;
width: 16px;
vertical-align: bottom;
}
/* ---- Submenu styles -------------------------- */
#submenu {
list-style: none;
padding: 0;
margin: 0;
line-height: 115%;
}
#submenu li {
float: left;
padding: 0;
margin: 0;
}
#submenu li a, #submenu span.nolink {
cursor: pointer;
padding: 0px 15px;
border-right: 1px solid #ccc;
font-size: 1.1em;
font-weight: bold;
color: #808080;
line-height: 14px;
height: 12px;
}
#submenu span.nolink {
color: #999;
}
#submenu a:hover, #submenu a.active, #submenu span.nolink.active {
color: #146295;
background: #FFF;
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/menu.css | CSS | asf20 | 3,046 |
input.error {
background-color: #FFDDDD;
border: 1px dashed #CC0000
}
textarea.error {
border: 1px solid red;color: #0F0F0F;
}
form.cmxform .gray * {
color: gray;
}
label.error{
float: left;
color: #FF0000;
font-size: 11px;
width: 100%;
}
.message{
background: url("../images/message.png") no-repeat scroll left center #FAE06B;
border: 1px dotted #949292;
color: #4F4E4A;
font-size: 130%;
line-height: 25px;
margin-bottom: 10px;
padding: 5px 10px 5px 30px;
}
.error_{
border: 1px solid #FF0000;
height: 25px;
background: #FABD05 url('../images/error.png') no-repeat center left;
padding-left: 25px;
font-weight: bold;
color: #656565;
line-height: 18px;
margin: 5px;
}
.notes{
border: 1px solid #FF0000;
height: 25px;
background: #EBF707 url('../images/notes.png') no-repeat center left;
padding-left: 25px;
font-weight: bold;
color: #FA5F05;
line-height: 18px;
margin: 5px;
}
.pages{
text-align: center;
padding: 10px;
}
.pages .pagebar-mainbody a,.pagelink-current{
display:inline-block;
border:1px solid #E6E7E1;
height:17px;
line-height:17px;
margin-left:1px;
min-width:12px;
overflow:visible;
padding:0 2px;
text-align:center;
vertical-align:middle;
white-space:nowrap;
width:auto !important;
color:#218BBC;
}
.pages .pagebar-mainbody a img{
margin-top:6px;
}
.pagelink-current,.pages .pagebar-mainbody a:hover {
background:#218BBC none repeat scroll 0 0;
border:1px solid #218BBC;
color:#FFFFFF;
}
/* ---------->>> jtip <<<---------------------------------------------------------------*/
#JT_arrow_left{
background-image: url(../images/arrow_left.gif);
background-repeat: no-repeat;
background-position: left top;
position: absolute;
z-index:101;
left:-12px;
height:23px;
width:10px;
top:-3px;
}
#JT_arrow_right{
background-image: url(../images/arrow_right.gif);
background-repeat: no-repeat;
background-position: left top;
position: absolute;
z-index:101;
height:23px;
width:11px;
top:-2px;
}
#JT {
position: absolute;
z-index:100;
border: 2px solid #CCCCCC;
background-color: #fff;
}
#JT_copy{
padding:10px 10px 10px 10px;
color:#333333;
}
.JT_loader{
background-image: url(../images/loader.gif);
background-repeat: no-repeat;
background-position: center center;
width:100%;
height:12px;
}
#JT_close_left{
background-color: #CCCCCC;
text-align: left;
padding-left: 8px;
padding-bottom: 5px;
padding-top: 2px;
font-weight:bold;
}
#JT_close_right{
background-color: #CCCCCC;
text-align: left;
padding-left: 8px;
padding-bottom: 5px;
padding-top: 2px;
font-weight:bold;
}
#JT_copy p{
margin:3px 0;
}
#JT_copy img{
padding: 1px;
border: 1px solid #CCCCCC;
max-width: 200px;
}
.jTip{
cursor:help;
}
#ajax-load {
background: url("../images/dangtai.png") no-repeat scroll center bottom transparent;
display: none;
height: 25px;
left: 45%;
padding: 6px 6px 6px 26px;
position: fixed;
right: 10px;
top: 0;
width: 155px;
z-index: 300;
}
#ajax-load .loading {
background: url("../images/loading.gif") no-repeat scroll 0 0 transparent;
color: #FF0000;
padding-left: 20px;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/system.css | CSS | asf20 | 3,575 |
body {
color: #333333;
margin: 0px;
padding: 0px;
background-color: #F9F9F9;
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
font-size: 12px;
}
body, textarea {
line-height: 1.4em;
}
body, td, textarea, input, select {
height: 18px;
padding: 3px;
}
#wrapper {
margin: 0 auto;
padding-top: 100px;
width: 460px;
}
#body_login {
/*background: url("../images/login/bg_login.jpg") no-repeat scroll 0 0 transparent;*/
height: 222px;
margin: 0 auto;
width: 520px;
}
#content {
padding: 25px;
}
#table1 {
margin: 0 auto;
width: 400px;
box-shadow: 4px 4px 10px #CCCCCC;
}
#table1 td {
border: none;
padding: 8px 5px;
}
.label {
font-size: 14px;
padding-left: 5px;
font-family: Tahoma;
text-align: right;
}
input.login {
background: none repeat scroll 0 0 #FBFBFB;
border: 1px solid #E5E5E5;
font-size: 24px;
margin-bottom: 16px;
margin-right: 6px;
margin-top: 2px;
padding: 3px;
width: 97%;
}
input.buttom {
background: url(../images/login/bt_login.png) no-repeat;
height: 25px;
width: 90px;
border: 0;
cursor: pointer;
}
input.buttom:hover {
background: url(../images/login/bt_login_hover.png) no-repeat;
height: 25px;
width: 90px;
border: 0;
cursor: pointer;
}
.buttom {
padding-bottom: 40px;
} | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/login.css | CSS | asf20 | 1,353 |
/*
ColorBox Core Style
The following rules are the styles that are consistant between themes.
Avoid changing this area to maintain compatability with future versions of ColorBox.
*/
#colorbox, #cboxOverlay, #cboxWrapper {
position:absolute;
top:0;
left:0;
z-index:9999;
overflow:hidden;
}
#cboxOverlay {
position:fixed;
width:100%;
height:100%;
}
#cboxMiddleLeft, #cboxBottomLeft {
clear:left;
}
#cboxContent {
position:relative;
overflow:hidden;
}
#cboxLoadedContent {
overflow:auto;
}
#cboxLoadedContent iframe {
display:block;
width:100%;
height:100%;
border:0;
}
#cboxTitle {
margin:0;
}
#cboxLoadingOverlay, #cboxLoadingGraphic {
position:absolute;
top:0;
left:0;
width:100%;
}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow {
cursor:pointer;
}
/*
Example user style
The following rules are ordered and tabbed in a way that represents the
order/nesting of the generated HTML, so that the structure easier to understand.
*/
#cboxOverlay {
background:url(colorbox/overlay.png) 0 0 repeat;
_background:url(colorbox/overlay.gif) 0 0 repeat;
}
#colorbox {
}
#cboxTopLeft {
width:12px;
height:12px;
background:url(colorbox/borderTopLeft.png) top left no-repeat;
}
#cboxTopRight {
width:15px;
height:12px;
background:url(colorbox/borderTopRight.png) top left no-repeat;
}
#cboxBottomLeft {
width:12px;
height:12px;
background:url(colorbox/borderBottomLeft.png) top left no-repeat;
}
#cboxBottomRight {
width:15px;
height:12px;
background:url(colorbox/borderBottomRight.png) top left no-repeat;
}
#cboxMiddleLeft {
width:12px;
background:url(colorbox/borderMiddleLeft.png) left top repeat-y;
}
#cboxMiddleRight {
width:15px;
background:url(colorbox/borderMiddleRight.png) left top repeat-y;
}
#cboxTopCenter {
height:12px;
background:url(colorbox/borderTopCenter.png) left top repeat-x;
}
#cboxBottomCenter {
height:12px;
background:url(colorbox/borderBottomCenter.png) left top repeat-x;
}
#cboxContent {
background:#fff;
}
#cboxLoadedContent {
margin-top:20px;
padding:0px;
border:#e0e0e0 1px solid;
}
#cboxTitle {
position:absolute;
top:0px;
left:0;
text-align:left;
width:100%;
font-size:12px;
color:#333;
font-weight: bold;
}
#cboxCurrent {
position:absolute;
bottom:-2px;
right:0px;
color:#949494;
font-size:10px;
}
#cboxSlideshow {
position:absolute;
bottom:4px;
right:30px;
color:#0092ef;
}
#cboxPrevious {
position:absolute;
bottom:15px;
right:34px;
/*background:url(colorbox/prev.gif) 0px 0px no-repeat;*/
width:15px;
height:17px;
text-indent:-9999px;
}
#cboxPrevious.hover {
background-position:0px -22px;
}
#cboxNext {
position:absolute;
bottom:15px;
right:18px;
/*background:url(colorbox/next.gif) 0px 0px no-repeat;*/
width:15px;
height:17px;
text-indent:-9999px;
}
#cboxNext.hover {
background-position:0px -22px;
}
#cboxLoadingOverlay {
background:url(colorbox/loading_background.png) center center no-repeat;
}
#cboxLoadingGraphic {
background:url(colorbox/loading.gif) center center no-repeat;
}
#cboxClose {
position:absolute;
top:0px;
right:0;
background:url(colorbox/close.gif) 0px 0px no-repeat;
width:17px;
height:17px;
text-indent:-9999px;
}
#cboxClose.hover {
background-position:0px -22px;
}
/*#cboxSpre {position:absolute; height:32px; border-right:#9c9c9c 1px solid; bottom:0px; right:57px;}*/
/*
The following fixes png-transparency for IE6.
It is also necessary for png-transparency in IE7 & IE8 to avoid 'black halos' with the fade transition
Since this method does not support CSS background-positioning, it is incompatible with CSS sprites.
Colorbox preloads navigation hover classes to account for this.
!! Important Note: AlphaImageLoader src paths are relative to the HTML document,
while regular CSS background images are relative to the CSS document.
*/
.cboxIE #cboxTopLeft {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderTopLeft.png, sizingMethod='scale');
}
.cboxIE #cboxTopCenter {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderTopCenter.png, sizingMethod='scale');
}
.cboxIE #cboxTopRight {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderTopRight.png, sizingMethod='scale');
}
.cboxIE #cboxBottomLeft {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderBottomLeft.png, sizingMethod='scale');
}
.cboxIE #cboxBottomCenter {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderBottomCenter.png, sizingMethod='scale');
}
.cboxIE #cboxBottomRight {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderBottomRight.png, sizingMethod='scale');
}
.cboxIE #cboxMiddleLeft {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderMiddleLeft.png, sizingMethod='scale');
}
.cboxIE #cboxMiddleRight {
background:transparent;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://demo10.vipcom.vn/vipcom/js/lightbox/images/borderMiddleRight.png, sizingMethod='scale');
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/templates/css/ui/colorbox.css | CSS | asf20 | 5,745 |
<html><body></body></html> | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/images/menu/index.html | HTML | asf20 | 26 |
<html><body></body></html> | 123gosaigon | trunk/ 123gosaigon/webadmin/templates/images/header/index.html | HTML | asf20 | 26 |
<?php
class CI_Upload {
// thu muc upload goc
private $_root_upload_dir;
// thu muc upload theo Nam/Thang/Ngay
private $_current_upload_dir;
// duong dan upload
private $_upload_path;
// loai file cho phep
private $_allow_type = array('image/gif','image/jpeg','image/jpg','image/png' );
// dung luong cho phep
private $_allow_size = 5242880;//5M
// chua thong tin loi
private $_error_message = '';
public function __construct($folder) {
// kiem tra thu muc ton tai
$this->_root_upload_dir = $folder;
//$this->_current_upload_dir = date('Y/m/d/');
$folderUpload = $this->_root_upload_dir ; //.'/'. $this->_current_upload_dir
if( !file_exists ($folderUpload) ) {
// tao thu muc
self::mkDirectory($folderUpload);
}
$this->_upload_path = $folderUpload;
}
public function do_upload( $oFile ){
//Kiem tra form submit
if ( ! isset($oFile) ) {
$this->_error_message = 'No file upload.';
return null;
}
// neu co loi
if( $oFile['error'] > 0 ){
$this->_error_message = 'file error';
return null;
}
// kiem tra kieu file
if( ! in_array($oFile['type'], $this->_allow_type ) ) {
$this->_error_message = 'File type disallow';
return null;
}
// kiem tra dung luong
if( $oFile['size'] > $this->_allow_size ) {
$this->_error_message = 'Max file size allow';
return null;
}
// thuc hien upload
if(is_uploaded_file($oFile['tmp_name']))
{
$filename = stripslashes($oFile['name']);
$path_info = pathinfo($filename);
$extension = strtolower($path_info['extension']) ;
$name= md5($oFile['name']).'_'.date("dmYHis").'.'.$extension;
$filename = $this->_root_upload_dir.'/'.$name ;
//$dirsave=$this->_root_upload_dir.'/small/'.$name;
if(move_uploaded_file($oFile['tmp_name'], $filename)){
//self::resize($filename,$dirsave,'width',30,0);
return $filename;
}else{
return false;
}
}else{
return false;
}
}
public static function mkDirectory($strTarget) {
// from php.net/mkdir user contributed notes
if (file_exists ( $strTarget )) {
if (! @ is_dir ( $strTarget ))
return false;
else
return true;
}
// Attempting to create the directory may clutter up our display.
if (@ mkdir ( $strTarget )) {
$stat = @ stat ( dirname ( $strTarget ) );
$dir_perms = $stat ['mode'] & 0007777; // Get the permission bits.
@ chmod ( $strTarget, $dir_perms );
return true;
} else {
if (is_dir ( dirname ( $strTarget ) ))
return false;
}
// If the above failed, attempt to create the parent node, then try again.
if (self::mkDirectory ( dirname ( $strTarget ) ))
return mkDir ( $strTarget );
return false;
}
/**
** options: exact, portrait, landscape, auto, crop
**
**/
public function resize($source,$save,$option='auto',$width=100,$height=100){
/*include 'thumbnail.php';
$thumb=new CI_Thumbnail($source);
switch($option){
case 'width':
$thumb->size_width($width);
break;
case 'height':
$thumb->size_height($height);
break;
case 'auto':
$thumb->size_auto($width);
break;
case 'size':
$thumb->size($width,$height);
break;
}
$thumb->process();
$thumb->show();
$thumb->save($save);*/
include 'resize.php';
// create folder
if( !file_exists ($this->_root_upload_dir.'/small') ) {
// tao thu muc
self::mkDirectory($this->_root_upload_dir.'/small');
}
$resizeObj=new Resize($source);
$resizeObj -> resizeImage($width, $height, $option);
$resizeObj -> saveImage($save, 100);
}
public function getName($source){
$arr=pathinfo($source);
return $arr['filename'].'.'.$arr['extension'];
}
public function getDirImage($dir){
$arrdir=explode('/',$dir);
$arrdir= end($arrdir);
return $arrdir;
}
}
/* ****************************** End of upload class ************************** */ | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/Upload.php | PHP | asf20 | 4,170 |
<?php
# ========================================================================#
#
# Author: Rajani .B
# Version: 1.0
# Date: 07-July-2010
# Purpose: Resizes and saves image
# Requires : Requires PHP5, GD library.
# Usage Example:
# include("classes/resize_class.php");
# $resizeObj = new resize('images/cars/large/input.jpg');
# $resizeObj -> resizeImage(150, 100, 0);
# $resizeObj -> saveImage('images/cars/large/output.jpg', 100);
#
#
# ========================================================================#
Class Resize
{
// *** Class variables
private $image;
private $width;
private $height;
private $imageResized;
function __construct($fileName)
{
// *** Open up the file
$this->image = $this->openImage($fileName);
// *** Get width and height
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
}
## --------------------------------------------------------
private function openImage($file)
{
// *** Get extension
$extension = strtolower(strrchr($file, '.'));
switch($extension)
{
case '.jpg':
case '.jpeg':
$img = @imagecreatefromjpeg($file);
break;
case '.gif':
$img = @imagecreatefromgif($file);
break;
case '.png':
$img = @imagecreatefrompng($file);
break;
default:
$img = false;
break;
}
return $img;
}
## --------------------------------------------------------
public function resizeImage($newWidth, $newHeight, $option="auto")
{
// *** Get optimal width and height - based on $option
$optionArray = $this->getDimensions($newWidth, $newHeight, $option);
$optimalWidth = $optionArray['optimalWidth'];
$optimalHeight = $optionArray['optimalHeight'];
// *** Resample - create image canvas of x, y size
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
// *** if option is 'crop', then crop too
if ($option == 'crop') {
$this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);
}
}
## --------------------------------------------------------
private function getDimensions($newWidth, $newHeight, $option)
{
switch ($option)
{
case 'exact':
$optimalWidth = $newWidth;
$optimalHeight= $newHeight;
break;
case 'portrait':
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
$optimalHeight= $newHeight;
break;
case 'landscape':
$optimalWidth = $newWidth;
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
break;
case 'auto':
$optionArray = $this->getSizeByAuto($newWidth, $newHeight);
$optimalWidth = $optionArray['optimalWidth'];
$optimalHeight = $optionArray['optimalHeight'];
break;
case 'crop':
$optionArray = $this->getOptimalCrop($newWidth, $newHeight);
$optimalWidth = $optionArray['optimalWidth'];
$optimalHeight = $optionArray['optimalHeight'];
break;
}
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
}
## --------------------------------------------------------
private function getSizeByFixedHeight($newHeight)
{
$ratio = $this->width / $this->height;
$newWidth = $newHeight * $ratio;
return $newWidth;
}
private function getSizeByFixedWidth($newWidth)
{
$ratio = $this->height / $this->width;
$newHeight = $newWidth * $ratio;
return $newHeight;
}
private function getSizeByAuto($newWidth, $newHeight)
{
if ($this->height < $this->width)
// *** Image to be resized is wider (landscape)
{
$optimalWidth = $newWidth;
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
}
elseif ($this->height > $this->width)
// *** Image to be resized is taller (portrait)
{
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
$optimalHeight= $newHeight;
}
else
// *** Image to be resizerd is a square
{
if ($newHeight < $newWidth) {
$optimalWidth = $newWidth;
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
} else if ($newHeight > $newWidth) {
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
$optimalHeight= $newHeight;
} else {
// *** Sqaure being resized to a square
$optimalWidth = $newWidth;
$optimalHeight= $newHeight;
}
}
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
}
## --------------------------------------------------------
private function getOptimalCrop($newWidth, $newHeight)
{
$heightRatio = $this->height / $newHeight;
$widthRatio = $this->width / $newWidth;
if ($heightRatio < $widthRatio) {
$optimalRatio = $heightRatio;
} else {
$optimalRatio = $widthRatio;
}
$optimalHeight = $this->height / $optimalRatio;
$optimalWidth = $this->width / $optimalRatio;
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
}
## --------------------------------------------------------
private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight)
{
// *** Find center - this will be used for the crop
$cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
$cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
$crop = $this->imageResized;
//imagedestroy($this->imageResized);
// *** Now crop from center to exact requested size
$this->imageResized = imagecreatetruecolor($newWidth , $newHeight);
imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
}
## --------------------------------------------------------
public function saveImage($savePath, $imageQuality="100")
{
// *** Get extension
$extension = strrchr($savePath, '.');
$extension = strtolower($extension);
switch($extension)
{
case '.jpg':
case '.jpeg':
if (imagetypes() & IMG_JPG) {
imagejpeg($this->imageResized, $savePath, $imageQuality);
}
break;
case '.gif':
if (imagetypes() & IMG_GIF) {
imagegif($this->imageResized, $savePath);
}
break;
case '.png':
// *** Scale quality from 0-100 to 0-9
$scaleQuality = round(($imageQuality/100) * 9);
// *** Invert quality setting as 0 is best, not 9
$invertScaleQuality = 9 - $scaleQuality;
if (imagetypes() & IMG_PNG) {
imagepng($this->imageResized, $savePath, $invertScaleQuality);
}
break;
// ... etc
default:
// *** No extension - No save.
break;
}
imagedestroy($this->imageResized);
}
## --------------------------------------------------------
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/Resize.php | PHP | asf20 | 7,402 |
<?php
class editor_library{
function __construct(){
$this->CI = get_instance();
}
function editor_advanced($name,$value,$error){
$data ='<script type="text/javascript" src="'.base_url().'templates/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>';
$data .='<script type="text/javascript">';
$data .='
tinyMCE.init({
// General options
mode : "exact",
elements : "'.$name.'",
theme : "advanced",
skin : "o2k7",
skin_variant : "black",
editor_selector : "advancedEditor",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "bullist,numlist,outdent,indent,blockquote,undo,redo,link,unlink,image,code,forecolor,backcolor,iespell,media,fullscreen",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "'.base_url().'templates/tinymce/js/css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "'.base_url().'templates/tinymce/js/lists/template_list.js",
external_link_list_url : "'.base_url().'templates/tinymce/js/lists/link_list.js",
external_image_list_url : "'.base_url().'templates/tinymce/js/lists/image_list.js",
media_external_list_url : "'.base_url().'templates/tinymce/js/lists/media_list.js"
});
';
$data .='</script>';
$data .='<textarea id="'.$name.'" name="'.$name.'" rows="20" cols="100" style="width: 100%">'.$value.'</textarea>'.$error;
return $data;
}
function editor_simply($name,$value,$error){
$data ='<script type="text/javascript" src="'.base_url().'templates/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>';
$data .='<script type="text/javascript">';
$data .='
tinyMCE.init({
// General options
mode : "exact",
elements : "'.$name.'",
theme : "advanced",
skin : "o2k7",
skin_variant : "black",
editor_selector : "advancedEditor",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "bullist,numlist,outdent,indent,blockquote,undo,redo,link,unlink,image,code,forecolor,backcolor,iespell,media,fullscreen",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "'.base_url().'templates/tinymce/js/css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "'.base_url().'templates/tinymce/js/lists/template_list.js",
external_link_list_url : "'.base_url().'templates/tinymce/js/lists/link_list.js",
external_image_list_url : "'.base_url().'templates/tinymce/js/lists/image_list.js",
media_external_list_url : "'.base_url().'templates/tinymce/js/lists/media_list.js"
});
';
$data .='</script>';
$data .='<textarea id="'.$name.'" name="'.$name.'" rows="20" cols="100" style="width: 100%">'.$value.'</textarea>'.$error;
return $data;
}
function editor_simply1($name,$value,$error){
$data ='<script type="text/javascript" src="'.base_url().'templates/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>';
$data .='<script type="text/javascript">';
$data .='
tinyMCE.init({
// General options
mode : "exact",
elements : "'.$name.'",
theme : "advanced",
skin : "o2k7",
skin_variant : "black",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,forecolor,backcolor,|,blockquote,|,link,image,code,|,emotions,iespell,media,|,fullscreen",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "'.base_url().'templates/tinymce/js/css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "'.base_url().'templates/tinymce/js/lists/template_list.js",
external_link_list_url : "'.base_url().'templates/tinymce/js/lists/link_list.js",
external_image_list_url : "'.base_url().'templates/tinymce/js/lists/image_list.js",
media_external_list_url : "'.base_url().'templates/tinymce/js/lists/media_list.js"
});
';
$data .='</script>';
$data .='<textarea id="'.$name.'" name="'.$name.'" rows="10" cols="100" style="width: 100%">'.$value.'</textarea>'.$error;
return $data;
}
function editornice($name,$value){
$data ='
<script type="text/javascript" src="'.base_url().'system/application/views/theme/system/js/nicEdit.js"></script>
<script>
var area1;
function toggleArea1() {
if(!area1) {
area1 = new nicEditor({fullPanel : true}).panelInstance(\''.$name.'\',{hasPanel : true});
} else {
area1.removeInstance(\''.$name.'\');
area1 = null;
}
}
bkLib.onDomLoaded(function() { toggleArea1(); });
</script>
';
$data .='<textarea id="'.$name.'" name="'.$name.'" cols="" rows="" style="width: 99%;height: 200px;">'.$value.'</textarea>';
return $data;
}
function fck($editor){
$data = '
<script type="text/javascript" src="'.base_url_site().'editor/fckeditor/ckeditor.js"></script>
<script type="text/javascript">
CKEDITOR.replace( \''.$editor.'\',
{
//
extraPlugins : \'MediaEmbed\',
toolbar :
[
[\'Source\'],
[\'Cut\',\'Copy\',\'Paste\',\'PasteText\',\'PasteFromWord\',\'-\',\'Scayt\'],
[\'Undo\',\'Redo\',\'-\',\'Find\',\'Replace\',\'-\',\'SelectAll\',\'RemoveFormat\'],
[\'Image\',\'Flash\',\'Table\',\'HorizontalRule\',\'Smiley\',\'SpecialChar\',\'PageBreak\'],
[\'Maximize\',\'-\',\'About\'],
\'/\',
[\'Styles\',\'Format\'],
[\'Bold\',\'Italic\',\'Strike\'],[\'JustifyLeft\',\'JustifyCenter\',\'JustifyRight\',\'JustifyBlock\'],
[\'NumberedList\',\'BulletedList\',\'-\',\'Outdent\',\'Indent\',\'Blockquote\'],
[\'Link\',\'Unlink\',\'Anchor\',\'MediaEmbed\']
],
filebrowserBrowseUrl : \''.base_url_site().'editor/ckfinder/ckfinder.html\',
filebrowserImageBrowseUrl : \''.base_url_site().'editor/ckfinder/ckfinder.html?type=Images\',
filebrowserFlashBrowseUrl : \''.base_url_site().'editor/ckfinder/ckfinder.html?type=Flash\',
filebrowserUploadUrl : \''.base_url_site().'editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files\',
filebrowserImageUploadUrl : \''.base_url_site().'editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images\',
filebrowserFlashUploadUrl : \''.base_url_site().'editor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash\'
}
);
</script>
';
return $data;
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/editor_library.php | PHP | asf20 | 10,159 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class upload_library
{
function __construct()
{
$this->CI = get_instance();
}
/*
* @method: uploadfile
* @param : string $path
* @date : 06/04/2013
* @desc : upload hinh anh
* @email : tritigi@gmail.com
*/
function uploadfile($path='../uploads/images/')
{
if(is_uploaded_file($_FILES['filedata']['tmp_name']))
{
$filename = stripslashes($_FILES['filedata']['name']);
$path_info = pathinfo($filename);
$extension = strtolower($path_info['extension']) ;
$name = $this->kodau($path_info['filename']).'_'.date("dmYHis").'.'.$extension ;
$filename = $path. $name ;
if(move_uploaded_file($_FILES['filedata']['tmp_name'], $filename)){
return $name.'*'.$filename.'*'.$extension;
}else{
return false;
}
}else{
return false;
}
}
/*
* @method: kodau
* @param : string $str
* @date : 06/04/2013
* @desc : chuyễn chuổi co dau thanh khong dau, cac ky tu đăc biệt thành dấu gạch nối (_)
* @email : tritigi@gmail.com
*/
function kodau($str)
{
$str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
$str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
$str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
$str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
$str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
$str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
$str = preg_replace("/(đ)/", 'd', $str);
$str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
$str = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $str);
$str = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $str);
$str = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $str);
$str = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $str);
$str = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $str);
$str = preg_replace("/(Đ)/", 'D', $str);
$str = preg_replace("/( )/", '-', $str);
$str = preg_replace("/(\'|\"|`|&|,|\.|\?)/", '', $str);
$str = preg_replace("/(---|--)/", '-', $str);
$pattern = '/([^a-z0-9\-\._])/i';
$str = preg_replace($pattern, '', $str);
$str = strtolower($str);
return $str;
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/upload_library.php | PHP | asf20 | 2,564 |
<?php
class image_library {
function move_file($from, $to)
{
$upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? 'move' : 'copy';
switch ($upload_mode)
{
case 'copy':
if (!@copy($from, $to))
{
if (!@move_uploaded_file($from, $to))
{
return false;
}
}
@unlink($from);
break;
case 'move':
if (!@move_uploaded_file($from, $to))
{
if (!@copy($from, $to))
{
return false;
}
}
@unlink($from);
break;
}
@chmod($to, 0666);
return true;
}
function resizeThumbnailImage($image_thumb, $image, $width, $height, $start_width, $start_height, $scale=0)
{
list($imagewidth, $imageheight, $imageType) = getimagesize($image);
$imageType = image_type_to_mime_type($imageType);
if (!$imagewidth || !$imageheight) {
return;
}
$xpos = 0;
$ypos = 0;
$scale = min($width /$imagewidth , $height / $imageheight);
if ($scale == 1 || ($width >$imagewidth && $height>$imageheight )) {
//lay file goc bo qua
copy($image,$image_thumb);
}
else
{
$new_width = (int)($imagewidth * $scale);
$new_height = (int)($imageheight * $scale);
//$xpos = (int)(($width - $new_width) / 2);
//$ypos = (int)(($height - $new_height) / 2);
$newImage = imagecreatetruecolor($new_width, $new_height);
$background = imagecolorallocate($newImage, 255, 255, 255);
imagefilledrectangle($newImage, 0, 0, $width, $height, $background);
switch ($imageType)
{
case 'image/gif':
$source = imagecreatefromgif ($image);
break;
case 'image/pjpeg':
case 'image/jpeg':
case 'image/jpg':
$source = imagecreatefromjpeg($image);
break;
case 'image/png':
case 'image/x-png':
$source = imagecreatefrompng($image);
break;
}
imagecopyresampled($newImage, $source, 0, 0, 0, 0, $new_width, $new_height, $imagewidth, $imageheight);
imagedestroy($source);
switch ($imageType)
{
case 'image/gif':
imagegif ($newImage, $image_thumb);
break;
case 'image/pjpeg':
case 'image/jpeg':
case 'image/jpg':
imagejpeg($newImage, $image_thumb, 90);
break;
case 'image/png':
case 'image/x-png':
imagepng($newImage, $image_thumb);
break;
}
chmod($image_thumb, 0777);
}
return $image_thumb;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/image_library.php | PHP | asf20 | 2,423 |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class site
{
// Public properties
public $settings = array();
// Protected or private properties
protected $_table;
// Constructor
public function __construct()
{
if (!isset($this->CI))
{
$this->CI =& get_instance();
}
//$this->CI->load->library('user_agent');
//$this->get_site_info();
}
public function load($page, $data = NULL, $layout=FALSE)
{
$data['page'] = $page;
if($layout==TRUE){
$this->CI->load->view('layout/skin_'.$layout, $data);
}else{
$this->CI->load->view('layout/skin', $data);
}
}
public function loadadmin($page, $data = NULL)
{
$data['page'] = $page;
$this->CI->load->view('theme/admin/vnit/skin', $data);
}
// Get Templates Active
public function get_default_template()
{
$this->CI->db->select('duongdan');
$this->CI->db->where('kichhoat', '1');
$query = $this->CI->db->get('giaodien', 1);
if ($query->num_rows() == 1)
{
$row = $query->row_array();
}
return $row['duongdan'];
}
public function get_default_language()
{
$this->CI->db->select('language');
$this->CI->db->where('is_default', '1');
$query = $this->CI->db->get($this->_table['languages'], 1);
if ($query->num_rows() == 1)
{
$row = $query->row_array();
}
return $row['language'];
}
public function get_site_info()
{
/*
$this->CI->db->select('name, value');
$query = $this->CI->db->get($this->_table['settings']);
if ($query->num_rows() > 0)
{
$result = $query->result_array();
foreach ($result as $row)
{
$this->settings[$row['name']] = $row['value'];
}
}
*/
}
public function check_site_status()
{
/*
$this->CI->db->select('name, value');
$this->CI->db->where('name', 'enabled');
$query = $this->CI->db->get($this->_table['settings'], 1);
if ($query->num_rows() == 1)
{
$result = $query->row_array();
if ($result['value'] == 0)
{
$data['offline_reason'] = $this->settings['offline_reason'];
$this->CI->load->view('admin/layout/pages/offline', $data);
die();
}
}
*/
}
public function generate_social_bookmarking_links($post_url, $post_title)
{
/*
$links = '';
if ($this->settings['enable_digg'] == 1)
{
$links = '<a href="http://digg.com/submit?phase=2&url=' . $post_url . '&title=' . $post_title . '" target="_blank">Digg</a>';
}
if ($this->settings['enable_technorati'] == 1)
{
$links .= ($links) ? ' | ' : '';
$links .= '<a href="http://technorati.com/faves?add=' . $post_url . '" target="_blank">Technorati</a>';
}
if ($this->settings['enable_delicious'] == 1)
{
$links .= ($links) ? ' | ' : '';
$links .= '<a href="http://del.icio.us/post?url=' . $post_url . '&title=' . $post_title . '" target="_blank">del.icio.us</a>';
}
if ($this->settings['enable_stumbleupon'] == 1)
{
$links .= ($links) ? ' | ' : '';
$links .= '<a href="http://www.stumbleupon.com/submit?url=' . $post_url . '&title=' . $post_title . '" target="_blank">Stumbleupon</a>';
}
if ($this->settings['enable_reddit'] == 1)
{
$links .= ($links) ? ' | ' : '';
$links .= '<a href="http://reddit.com/submit?url=' . $post_url . '&title=' . $post_title . '" target="_blank">reddit</a>';
}
if ($this->settings['enable_furl'] == 1)
{
$links .= ($links) ? ' | ' : '';
$links .= '<a href="http://www.furl.net/storeIt.jsp?t=' . $post_title . '&u=' . $post_url . '" target="_blank">Furl</a>';
}
return $links;
*/
}
}
/* End of file System.php */
/* Location: ./application/libraries/System.php */ | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/site.php | PHP | asf20 | 4,713 |
<?php
/**
*This is a class that can process an image on the fly by either generate a thumbnail, apply an watermark to the image, or resize it.
*
* The processed image can either be displayed in a page, saved to a file, or returned to a variable.
* It requires the PHP with support for GD library extension in either version 1 or 2. If the GD library version 2 is available it the class can manipulate the images in true color, thus providing better quality of the results of resized images.
* Features description:
* - Thumbnail: normal thumbnail generation
* - Watermark: Text or image in PNG format. Suport multiples positions.
* - Auto-fitting: adjust the dimensions so that the resized image aspect is not distorted
* - Scaling: enlarge and shrink the image
* - Format: both JPEG and PNG are supported, but the watermark image can only be in PNG format as it needs to be transparent
* - Autodetect the GD library version supported by PHP
* - Calculate quality factor for a specific file size in JPEG format.
* - Suport bicubic resample algorithm
* - Tested: PHP 4 valid
*
* @package Thumbnail and Watermark Class
* @author Emilio Rodriguez <emiliort@gmail.com>
* @version 1.48 <2005/07/18>
* @copyright GNU General Public License (GPL)
**/
/*
// Sample -------------------------------------
$thumb=new Thumbnail("source.jpg"); // set source image file
$thumb->size_width(100); // set width for thumbnail, or
$thumb->size_height(300); // set height for thumbnail, or
$thumb->size_auto(200); // set the biggest width or height for thumbnail
$thumb->size(150,113); // set the biggest width and height for thumbnail
$thumb->quality=75; //default 75 , only for JPG format
$thumb->output_format='JPG'; // JPG | PNG
$thumb->jpeg_progressive=0; // set progressive JPEG : 0 = no , 1 = yes
$thumb->allow_enlarge=false; // allow to enlarge the thumbnail
$thumb->CalculateQFactor(10000); // Calculate JPEG quality factor for a specific size in bytes
$thumb->bicubic_resample=true; // [OPTIONAL] set resample algorithm to bicubic
$thumb->img_watermark='watermark.png'; // [OPTIONAL] set watermark source file, only PNG format [RECOMENDED ONLY WITH GD 2 ]
$thumb->img_watermark_Valing='TOP'; // [OPTIONAL] set watermark vertical position, TOP | CENTER | BOTTOM
$thumb->img_watermark_Haling='LEFT'; // [OPTIONAL] set watermark horizonatal position, LEFT | CENTER | RIGHT
$thumb->txt_watermark='Watermark text'; // [OPTIONAL] set watermark text [RECOMENDED ONLY WITH GD 2 ]
$thumb->txt_watermark_color='000000'; // [OPTIONAL] set watermark text color , RGB Hexadecimal[RECOMENDED ONLY WITH GD 2 ]
$thumb->txt_watermark_font=1; // [OPTIONAL] set watermark text font: 1,2,3,4,5
$thumb->txt_watermark_Valing='TOP'; // [OPTIONAL] set watermark text vertical position, TOP | CENTER | BOTTOM
$thumb->txt_watermark_Haling='LEFT'; // [OPTIONAL] set watermark text horizonatal position, LEFT | CENTER | RIGHT
$thumb->txt_watermark_Hmargin=10; // [OPTIONAL] set watermark text horizonatal margin in pixels
$thumb->txt_watermark_Vmargin=10; // [OPTIONAL] set watermark text vertical margin in pixels
$thumb->->memory_limit='32M'; //[OPTIONAL] set maximun memory usage, default 32 MB ('32M'). (use '16M' or '32M' for litter images)
$thumb->max_execution_time='30'; //[OPTIONAL] set maximun execution time, default 30 seconds ('30'). (use '60' for big images o slow server)
$thumb->process(); // generate image
$thumb->show(); // show your thumbnail, or
$thumb->save("thumbnail.jpg"); // save your thumbnail to file, or
$image = $thumb->dump(); // get the image
echo ($thumb->error_msg); // print Error Mensage
//----------------------------------------------
################################################ */
class CI_Thumbnail {
/**
*@access public
*@var integer Quality factor for JPEG output format, default 75
**/
var $quality=75;
/**
*@access public
*@var string output format, default JPG, valid values 'JPG' | 'PNG'
**/
var $output_format='JPG';
/**
*@access public
*@var integer set JPEG output format to progressive JPEG : 0 = no , 1 = yes
**/
var $jpeg_progressive=0;
/**
*@access public
*@var boolean allow to enlarge the thumbnail.
**/
var $allow_enlarge=false;
/**
*@access public
*@var string [OPTIONAL] set watermark source file, only PNG format [RECOMENDED ONLY WITH GD 2 ]
**/
var $img_watermark='';
/**
*@access public
*@var string [OPTIONAL] set watermark vertical position, TOP | CENTER | BOTTOM
**/
var $img_watermark_Valing='TOP';
/**
*@access public
*@var string [OPTIONAL] set watermark horizonatal position, LEFT | CENTER | RIGHT
**/
var $img_watermark_Haling='LEFT';
/**
*@access public
*@var string [OPTIONAL] set watermark text [RECOMENDED ONLY WITH GD 2 ]
**/
var $txt_watermark='';
/**
*@access public
*@var string [OPTIONAL] set watermark text color , RGB Hexadecimal[RECOMENDED ONLY WITH GD 2 ]
**/
var $txt_watermark_color='000000';
/**
*@access public
*@var integer [OPTIONAL] set watermark text font: 1,2,3,4,5
**/
var $txt_watermark_font=1;
/**
*@access public
*@var string [OPTIONAL] set watermark text vertical position, TOP | CENTER | BOTTOM
**/
var $txt_watermark_Valing='TOP';
/**
*@access public
*@var string [OPTIONAL] set watermark text horizonatal position, LEFT | CENTER | RIGHT
**/
var $txt_watermark_Haling='LEFT';
/**
*@access public
*@var integer [OPTIONAL] set watermark text horizonatal margin in pixels
**/
var $txt_watermark_Hmargin=10;
/**
*@access public
*@var integer [OPTIONAL] set watermark text vertical margin in pixels
**/
var $txt_watermark_Vmargin=10;
/**
*@access public
*@var bool [OPTIONAL] set resample algorithm to bicubic
**/
var $bicubic_resample=false;
/**
*@access public
*@var string [OPTIONAL] set maximun memory usage, default 8 MB ('8M'). (use '16M' for big images)
**/
var $memory_limit='128M';
/**
*@access public
*@var string [OPTIONAL] set maximun execution time, default 30 seconds ('30'). (use '60' for big images)
**/
var $max_execution_time='180';
/**
*@access public
*@var string errors mensage
**/
var $error_msg='';
/**
*@access private
*@var mixed images
**/
var $img;
/**
*open source image
*@access public
*@param string filename of the source image file
*@return boolean
**/
var $the_file;
function CI_Thumbnail($imgfile, $imgDes = '')
{
$imgfile = realpath($imgfile);
if (is_file($imgfile)) {
if ($imgDes != '' && $imgfile != $imgDes) {
CI_Function::mkDirectory(substr($imgDes, 0, strrpos($imgDes, '/')));
copy($imgfile, $imgDes);
$imgfile = $imgDes;
}
$this->the_file = substr($imgfile, strrpos($imgfile, "/") + 1);
$img_info = getimagesize($imgfile);
//detect image format
switch ($img_info[2]) {
case 1:
//GIF
$this->img["format"] = "GIF";
$this->img["src"] = ImageCreateFromGIF($imgfile);
break;
case 2:
//JPEG
$this->img["format"] = "JPEG";
$this->img["src"] = ImageCreateFromJPEG($imgfile);
break;
case 3:
//PNG
$this->img["format"] = "PNG";
$this->img["src"] = ImageCreateFromPNG($imgfile);
$this->img["des"] = $this->img["src"];
break;
default:
$this->error_msg="Not Supported File";
return false;
}//case
$this->img["x"] = $img_info[0]; //original dimensions
$this->img["y"] = $img_info[1];
$this->img["x_thumb"] = $this->img["x"]; //thumbnail dimensions
$this->img["y_thumb"] = $this->img["y"];
$this->img["des"] = $this->img["src"]; // thumbnail = original
return true;
}
else
return false;
}
/**
*check folder in exists
*@access public
*@param string path
*@return boolean
**/
function check_dir($path)
{
$directory = explode($this->the_file, $path);
$dir = explode("/", $directory[0]);
$path = $dir[0];
if(@is_dir($directory))
return true;
else {
for($i=1; $i < count($dir); $i++) {
if($dir[$i] != "") {
$path .= "/". $dir[$i];
if(!is_dir($path)) {
umask(0);
if (!@mkdir($path, 0777)) {
return false;
}
else
@chmod($path, 0777);
}
}
}
return true;
}
}
/**
*set height for thumbnail
*@access public
*@param integer height
*@return boolean
**/
function size_height($size=100)
{
//height
$this->img["y_thumb"]=$size;
if ($this->allow_enlarge==true) {
$this->img["y_thumb"]=$size;
} else {
if ($size < ($this->img["y"])) {
$this->img["y_thumb"]=$size;
} else {
$this->img["y_thumb"]=$this->img["y"];
}
}
if ($this->img["y"]>0) {
$this->img["x_thumb"] = ($this->img["y_thumb"]/$this->img["y"])*$this->img["x"];
} else {
$this->error_msg="Invalid size : Y";
return false;
}
}
/**
*set width for thumbnail
*@access public
*@param integer width
*@return boolean
**/
function size_width($size=100)
{
//width
if ($this->allow_enlarge==true) {
$this->img["x_thumb"]=$size;
} else {
if ( $size < ($this->img["x"])) {
$this->img["x_thumb"]=$size;
} else {
$this->img["x_thumb"]=$this->img["x"];
}
}
if ($this->img["x"]>0) {
$this->img["y_thumb"] = ($this->img["x_thumb"]/$this->img["x"])*$this->img["y"];
} else {
$this->error_msg="Invalid size : x";
return false;
}
}
/**
*set the biggest width or height for thumbnail
*@access public
*@param integer width or height
*@return boolean
**/
function size_auto($size=100)
{
//size
if ($this->img["x"]>=$this->img["y"]) {
$this->size_width($size);
} else {
$this->size_height($size);
}
}
/**
*set the biggest width and height for thumbnail
*@access public
*@param integer width and height
*@return boolean
**/
function size_auto_width_height($size_x, $size_y)
{
//size
if(($this->img["x"] < $size_x) && ($this->img["y"] < $size_y))
{
$this->size_width($this->img["x"]);
$this->size_height($this->img["y"]);
}
else
if ( (($this->img["x"])/$size_x) >= (($this->img["y"])/$size_y) ) {
$this->size_width($size_x);
} else {
$this->size_height($size_y);
}
/*if ($this->img["x"]>=$this->img["y"]) {
$this->size_width($size_x);
} else {
$this->size_height($size_y);
}*/
}
/**
*set the biggest width and height for thumbnail
*@access public
*@param integer width
*@param integer height
*@return boolean
**/
function size($size_x,$size_y)
{
//size
// if ( (($this->img["x"])/$size_x) >= (($this->img["y"])/$size_y) ) {
// $this->size_width($size_x);
// } else {
// $this->size_height($size_y);
// }
//Fix chet
$this->img["x_thumb"] = $size_x;
$this->img["y_thumb"] = $size_y;
}
/**
*show your thumbnail, output image and headers
*@access public
*@return void
**/
function show()
{
//show thumb
Header("Content-Type: image/".$this->img["format"]);
if ($this->output_format=="PNG") { //PNG
imagePNG($this->img["des"]);
} else {
imageinterlace( $this->img["des"], $this->jpeg_progressive);
imageJPEG($this->img["des"],"",$this->quality);
}
}
/**
*return the result thumbnail
*@access public
*@return mixed
**/
function dump()
{
//dump thumb
return $this->img["des"];
}
/**
*save your thumbnail to file
*@access public
*@param string output file name
*@return boolean
**/
function save($save="")
{
//save thumb
if (empty($save)) {
$this->error_msg='Not Save File';
return false;
}
if($this->check_dir($save)) {
if ($this->output_format=="PNG") { //PNG
imagePNG($this->img["des"],"$save");
}
else if ($this->output_format=="GIF") { //PNG
imageGIF($this->img["des"],"$save");
}
else {
imageinterlace( $this->img["des"], $this->jpeg_progressive);
imageJPEG($this->img["des"],"$save",$this->quality);
}
return true;
}
else {
$this->error_msg='Can\'t thumbnail in $save';
return false;
}
}
/**
*generate image
*@access public
*@return boolean
**/
function process () {
ini_set('memory_limit',$this->memory_limit);
ini_set('max_execution_time',$this->max_execution_time);
$X_des =$this->img["x_thumb"];
$Y_des =$this->img["y_thumb"];
$gd_version=$this->gdVersion();
if ($gd_version>=2) {
$this->img["des"] = ImageCreateTrueColor($X_des,$Y_des);
if ($this->txt_watermark!='' ) {
sscanf($this->txt_watermark_color, "%2x%2x%2x", $red, $green, $blue);
$txt_color=imageColorAllocate($this->img["des"] ,$red, $green, $blue);
}
if (!$this->bicubic_resample) {
imagecopyresampled ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $X_des, $Y_des, $this->img["x"], $this->img["y"]);
} else {
$this->imageCopyResampleBicubic($this->img["des"], $this->img["src"], 0, 0, 0, 0, $X_des, $Y_des, $this->img["x"], $this->img["y"]);
}
if ($this->img_watermark != '' && file_exists($this->img_watermark)) {
$this->img["watermark"] = @imagecreatefrompng($this->img_watermark);
$this->img["x_watermark"] = @imagesx($this->img["watermark"]);
$this->img["y_watermark"] = @imagesy($this->img["watermark"]);
@imagecopyresampled($this->img["des"], $this->img["watermark"], $this->calc_position_H (), $this->calc_position_V (), 0, 0, $this->img["x_watermark"], $this->img["y_watermark"],$this->img["x_watermark"], $this->img["y_watermark"]);
}
if ($this->txt_watermark!='' ) {
imagestring($this->img["des"], $this->txt_watermark_font, $this->calc_text_position_H() , $this->calc_text_position_V(), $this->txt_watermark,$txt_color);
}
} else {
$this->img["des"] = ImageCreate($X_des,$Y_des);
if ($this->txt_watermark!='' ) {
sscanf($this->txt_watermark_color, "%2x%2x%2x", $red, $green, $blue);
$txt_color=imageColorAllocate($this->img["des"] ,$red, $green, $blue);
}
// pre copy image, allocating color of water mark, GD < 2 can't resample colors
if ($this->img_watermark!='' && file_exists($this->img_watermark)) {
$this->img["watermark"]=ImageCreateFromPNG ($this->img_watermark);
$this->img["x_watermark"] =imagesx($this->img["watermark"]);
$this->img["y_watermark"] =imagesy($this->img["watermark"]);
imagecopy ($this->img["des"], $this->img["watermark"], $this->calc_position_H (), $this->calc_position_V (), 0, 0, $this->img["x_watermark"], $this->img["y_watermark"]);
}
imagecopyresized ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $X_des, $Y_des, $this->img["x"], $this->img["y"]);
@imagecopy ($this->img["des"], $this->img["watermark"], $this->calc_position_H (), $this->calc_position_V (), 0, 0, $this->img["x_watermark"], $this->img["y_watermark"]);
if ($this->txt_watermark!='') {
imagestring($this->img["des"], $this->txt_watermark_font, $this->calc_text_position_H() , $this->calc_text_position_V(), $this->txt_watermark, $txt_color); // $this->txt_watermark_color);
}
}
$this->img["src"]=$this->img["des"];
$this->img["x"]= $this->img["x_thumb"];
$this->img["y"]= $this->img["y_thumb"];
}
/**
*Calculate JPEG quality factor for a specific size in bytes
*@access public
*@param integer maximun file size in bytes
**/
function CalculateQFactor($size) {
//based on: JPEGReducer class version 1, 25 November 2004, Author: huda m elmatsani, Email :justhuda@netscape.net
//calculate size of each image. 75%, 50%, and 25% quality
ob_start(); imagejpeg($this->img["des"],'',75); $buffer = ob_get_contents(); ob_end_clean();
$size75 = strlen($buffer);
ob_start(); imagejpeg($this->img["des"],'',50); $buffer = ob_get_contents(); ob_end_clean();
$size50 = strlen($buffer);
ob_start(); imagejpeg($this->img["des"],'',25); $buffer = ob_get_contents(); ob_end_clean();
$size25 = strlen($buffer);
//calculate gradient of size reduction by quality
$mgrad1 = 25/($size50-$size25);
$mgrad2 = 25/($size75-$size50);
$mgrad3 = 50/($size75-$size25);
$mgrad = ($mgrad1+$mgrad2+$mgrad3)/3;
//result of approx. quality factor for expected size
$q_factor=round($mgrad*($size-$size50)+50);
if ($q_factor<25) {
$this->quality=25;
} elseif ($q_factor>100) {
$this->quality=100;
} else {
$this->quality=$q_factor;
}
}
/**
*@access private
*@return integer
**/
function calc_text_position_H () {
$W_mark = imagefontwidth ($this->txt_watermark_font)*strlen($this->txt_watermark);
$W = $this->img["x_thumb"];
switch ($this->txt_watermark_Haling) {
case 'CENTER':
$x = $W/2-$W_mark/2;
break;
case 'RIGHT':
$x = $W-$W_mark-($this->txt_watermark_Hmargin);
break;
default:
case 'LEFT':
$x = 0+($this->txt_watermark_Hmargin);
break;
}
return $x;
}
/**
*@access private
*@return integer
**/
function calc_text_position_V () {
$H_mark = imagefontheight ($this->txt_watermark_font);
$H = $this->img["y_thumb"];
switch ($this->txt_watermark_Valing) {
case 'CENTER':
$y = $H/2-$H_mark/2;
break;
case 'BOTTOM':
$y = $H-$H_mark-($this->txt_watermark_Vmargin);
break;
default:
case 'TOP':
$y = 0+($this->txt_watermark_Vmargin);
break;
}
return $y;
}
/**
*@access private
*@return integer
**/
function calc_position_H () {
$W_mark = $this->img["x_watermark"];
$W = $this->img["x_thumb"];
switch ($this->img_watermark_Haling) {
case 'CENTER':
$x = $W/2-$W_mark/2;
break;
case 'RIGHT':
$x = $W-$W_mark;
break;
default:
case 'LEFT':
$x = 0;
break;
}
return $x;
}
/**
*@access private
*@return integer
**/
function calc_position_V () {
$H_mark = $this->img["y_watermark"];
$H = $this->img["y_thumb"];
switch ($this->img_watermark_Valing) {
case 'CENTER':
$y = $H/2-$H_mark/2;
break;
case 'BOTTOM':
$y = $H-$H_mark;
break;
default:
case 'TOP':
$y = 0;
break;
}
return $y;
}
/**
*@access private
*@return boolean
**/
function checkgd2(){
// TEST the GD version
if (extension_loaded('gd2') && function_exists('imagecreatetruecolor')) {
return false;
} else {
return true;
}
}
/**
* Get which version of GD is installed, if any.
*
* Returns the version (1 or 2) of the GD extension.
*/
function gdVersion($user_ver = 0)
{
if (! extension_loaded('gd')) { return; }
static $gd_ver = 0;
// Just accept the specified setting if it's 1.
if ($user_ver == 1) { $gd_ver = 1; return 1; }
// Use the static variable if function was called previously.
if ($user_ver !=2 && $gd_ver > 0 ) { return $gd_ver; }
// Use the gd_info() function if possible.
if (function_exists('gd_info')) {
$ver_info = gd_info();
preg_match('/\d/', $ver_info['GD Version'], $match);
$gd_ver = $match[0];
return $match[0];
}
// If phpinfo() is disabled use a specified / fail-safe choice...
if (preg_match('/phpinfo/', ini_get('disable_functions'))) {
if ($user_ver == 2) {
$gd_ver = 2;
return 2;
} else {
$gd_ver = 1;
return 1;
}
}
// ...otherwise use phpinfo().
ob_start();
phpinfo(8);
$info = ob_get_contents();
ob_end_clean();
$info = stristr($info, 'gd version');
preg_match('/\d/', $info, $match);
$gd_ver = $match[0];
return $match[0];
} // End gdVersion()
function imageCopyResampleBicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {
$scaleX = ($src_w - 1) / $dst_w;
$scaleY = ($src_h - 1) / $dst_h;
$scaleX2 = $scaleX / 2.0;
$scaleY2 = $scaleY / 2.0;
$tc = imageistruecolor($src_img);
for ($y = $src_y; $y < $src_y + $dst_h; $y++) {
$sY = $y * $scaleY;
$siY = (int) $sY;
$siY2 = (int) $sY + $scaleY2;
for ($x = $src_x; $x < $src_x + $dst_w; $x++) {
$sX = $x * $scaleX;
$siX = (int) $sX;
$siX2 = (int) $sX + $scaleX2;
if ($tc) {
$c1 = imagecolorat($src_img, $siX, $siY2);
$c2 = imagecolorat($src_img, $siX, $siY);
$c3 = imagecolorat($src_img, $siX2, $siY2);
$c4 = imagecolorat($src_img, $siX2, $siY);
$r = (($c1 + $c2 + $c3 + $c4) >> 2) & 0xFF0000;
$g = ((($c1 & 0xFF00) + ($c2 & 0xFF00) + ($c3 & 0xFF00) + ($c4 & 0xFF00)) >> 2) & 0xFF00;
$b = ((($c1 & 0xFF) + ($c2 & 0xFF) + ($c3 & 0xFF) + ($c4 & 0xFF)) >> 2);
imagesetpixel($dst_img, $dst_x + $x - $src_x, $dst_y + $y - $src_y, $r+$g+$b);
} else {
$c1 = imagecolorsforindex($src_img, imagecolorat($src_img, $siX, $siY2));
$c2 = imagecolorsforindex($src_img, imagecolorat($src_img, $siX, $siY));
$c3 = imagecolorsforindex($src_img, imagecolorat($src_img, $siX2, $siY2));
$c4 = imagecolorsforindex($src_img, imagecolorat($src_img, $siX2, $siY));
$r = ($c1['red'] + $c2['red'] + $c3['red'] + $c4['red'] ) << 14;
$g = ($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) << 6;
$b = ($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue'] ) >> 2;
imagesetpixel($dst_img, $dst_x + $x - $src_x, $dst_y + $y - $src_y, $r+$g+$b);
}
}
}
}
/**
*generate a unique filename in a directory like prefix_filename_randon.ext
*@access public
*@param string path of the destination dir. Example '/img'
*@param string name of the file to save. Example 'my_foto.jpg'
*@param string [optional] prefix of the name Example 'picture'
*@return string full path of the file to save. Exmaple '/img/picture_my_foto_94949.jpg'
**/
function unique_filename ( $archive_dir , $filename , $file_prefix='') {
// checkemaos if file exists
$extension= strtolower( substr( strrchr($filename, ".") ,1) );
$name=str_replace(".".$extension,'',$filename);
// only alfanumerics characters
$string_tmp = $name;
$name='';
while ($string_tmp!='') {
$character=substr ($string_tmp, 0, 1);
$string_tmp=substr ($string_tmp, 1);
if (eregi("[abcdefghijklmnopqrstuvwxyz0-9]", $character)) {
$name=$name.$character;
} else {
$name=$name.'_';
}
}
$destination = $file_prefix."_".$name.".".$extension;
while (file_exists($archive_dir."/".$destination)) {
// if exist, add a random number to the file name
srand((double)microtime()*1000000); // random number inizializzation
$destination = $file_prefix."_".$name."_".rand(0,999999999).".".$extension;
}
return ($destination);
}
/**
* NOT USED : to do: mezclar imagenes a tamao original, preservar canal alpha y redimensionar
* Merge multiple images and keep transparency
* $i is and array of the images to be merged:
* $i[1] will be overlayed over $i[0]
* $i[2] will be overlayed over that
* @param mixed
* @retrun mixed the function returns the resulting image ready for saving
**/
function imagemergealpha($i) {
//create a new image
$s = imagecreatetruecolor(imagesx($i[0]),imagesy($i[1]));
//merge all images
imagealphablending($s,true);
$z = $i;
while($d = each($z)) {
imagecopy($s,$d[1],0,0,0,0,imagesx($d[1]),imagesy($d[1]));
}
//restore the transparency
imagealphablending($s,false);
$w = imagesx($s);
$h = imagesy($s);
for($x=0;$x<$w;$x++) {
for($y=0;$y<$h;$y++) {
$c = imagecolorat($s,$x,$y);
$c = imagecolorsforindex($s,$c);
$z = $i;
$t = 0;
while($d = each($z)) {
$ta = imagecolorat($d[1],$x,$y);
$ta = imagecolorsforindex($d[1],$ta);
$t += 127-$ta['alpha'];
}
$t = ($t > 127) ? 127 : $t;
$t = 127-$t;
$c = imagecolorallocatealpha($s,$c['red'],$c['green'],$c['blue'],$t);
imagesetpixel($s,$x,$y,$c);
}
}
imagesavealpha($s,true);
return $s;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/Thumbnail.php | PHP | asf20 | 26,726 |
<?php
class pagination_library{
function __construct(){
$this->CI = get_instance();
}
function pagination($num,$offset,$limit,$url){
//$id_blog = $this->input->post('id_blog');
$page = $offset;
$adjacents = 2;
if($page)
$start = ($page - 1) * $limit; //first item to display on this page
else
$start = 0; //if no page var is given, set start to 0
$total_pages = $num;
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .='<span class="pagebar-mainbody">';
//previous button
if ($page > 1)
$pagination.= "<a href=\"javascript:javascript:GoToPage($page-1);\"><</a>";
else
$pagination.= "<a href=\"javascript:;\"><</a>";
//pages
if ($lastpage < 6 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:GoToPage($counter); \">$counter</a>";
}
}
elseif($lastpage > 4 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:GoToPage($counter); \">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"javascript:javascript:GoToPage($lpm1); \">$lpm1</a>";
$pagination.= "<a href=\"javascript:javascript:GoToPage($lastpage); \">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"javascript:javascript:GoToPage(1); \">1</a>";
$pagination.= "<a href=\"javascript:javascript:GoToPage(2); ;\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:GoToPage($counter); \">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"javascript:javascript:GoToPage($lpm1);\">$lpm1</a>";
$pagination.= "<a href=\"javascript:javascript:GoToPage($lastpage);\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"javascript:javascript:GoToPage(1);\">1</a>";
$pagination.= "<a href=\"javascript:javascript:GoToPage(2);\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:GoToPage($counter);\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"javascript:javascript:GoToPage($page+1);\">></a>";
else
$pagination.= "<a href=\"javascript:;\">></a>";
return $pagination.= "</span>\n";
}
}
function page($num,$offset,$limit,$url){
//$id_blog = $this->input->post('id_blog');
$page = $offset;
$adjacents = 2;
if($page)
$start = (($page - 1) * $limit)+6; //first item to display on this page
else
$start = 6; //if no page var is given, set start to 0
$total_pages = $num;
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var is given, default to 1.
$prev = $page - 1; //previous page is page - 1
$next = $page + 1; //next page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class=\"pages\">";
$pagination .='<div class="pagebar-mainbody">';
//previous button
if ($page > 1)
$pagination.= "<a href=\"javascript:javascript:go($page-1);\"><</a>";
else
$pagination.= "<a href=\"javascript:;\"><</a>";
//pages
if ($lastpage < 6 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:go($counter); \">$counter</a>";
}
}
elseif($lastpage > 4 + ($adjacents * 2)) //enough pages to hide some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:go($counter); \">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"javascript:javascript:go($lpm1); \">$lpm1</a>";
$pagination.= "<a href=\"javascript:javascript:go($lastpage); \">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "<a href=\"javascript:javascript:go(1); \">1</a>";
$pagination.= "<a href=\"javascript:javascript:go(2); ;\">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:go($counter); \">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a href=\"javascript:javascript:go($lpm1);\">$lpm1</a>";
$pagination.= "<a href=\"javascript:javascript:go($lastpage);\">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a href=\"javascript:javascript:go(1);\">1</a>";
$pagination.= "<a href=\"javascript:javascript:go(2);\">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span class=\"pagebar-selections\"><span class=\"pagelink-current\">$counter</span></span>";
else
$pagination.= "<a href=\"javascript:javascript:go($counter);\">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href=\"javascript:javascript:go($page+1);\">></a>";
else
$pagination.= "<a href=\"javascript:;\">></a>";
return $pagination.= "</div></div>\n";
}
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/pagination_library.php | PHP | asf20 | 11,845 |
<?php
class string_library{
function stringchange($str)
{
$str = strip_tags($str);
$str = mb_strtolower($str,'utf-8');
$str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str); //|á|à|ả|ã|ạ|ấ|ầ|ẩ|ẫ|ậ|ắ|ằ|ẳ|ẵ|ặ
$str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
$str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
$str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
$str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
$str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
$str = preg_replace("/(đ)/", 'd', $str);
$str = preg_replace("/(:|;)/","",$str);
$str = preg_replace("/(́|̀|̉|̃|̣)/","",$str);
$str = str_replace("_","",$str);
$str = str_replace("?","",$str);
$str = str_replace('"',"",$str);
$str = str_replace(")","",$str);
$str = str_replace("/","",$str);
$str = str_replace("%","",$str);
$str = str_replace("&","",$str);
$str = str_replace("–","",$str);
$str = str_replace("_","",$str);
$str = str_replace(".","",$str);
$str = str_replace(",","",$str);
$str = str_replace("-","",$str);
$str = str_replace("(","",$str);
$str = str_replace("!","",$str);
$str = str_replace(" ","-",$str);
$str = str_replace("----","-",$str);
$str = str_replace("---","-",$str);
$str = str_replace("--","-",$str);
$str = preg_replace(array('/[^a-zA-Z0-9 -]/'), array(''), $str) ;
return $str;
}
function changeImgTamtay($value){
$value = str_replace("http://img.tamtay.vn/files/", "", $value);
$value = str_replace("_resize.", "_thumb.", $value);
$value = str_replace(".", "_thumb.", $value);
$value = str_replace("_thumb_thumb", "_thumb", $value);
return $value;
}
// Hàm chuyen ngay
function chuyenngay($ngayhientai,$songay){
$my_time = strtotime ($ngayhientai); //converts date string to UNIX timestamp
$timestamp = $my_time + ($songay * 86400); //calculates # of days passed ($num_days) * # seconds in a day (86400)
$return_date = date("Y-m-d H:i:s",$timestamp); //puts the UNIX timestamp back into string format
return $return_date;//exit function and return string
}
// Ham cat chu
function catchu($value, $length){
if($value!=''){
if(is_array($value)) list($string, $match_to) = $value;
else { $string = $value; $match_to = $value{0}; }
$match_start = stristr($string, $match_to);
$match_compute = strlen($string) - strlen($match_start);
if (strlen($string) > $length)
{
if ($match_compute < ($length - strlen($match_to)))
{
$pre_string = substr($string, 0, $length);
$pos_end = strrpos($pre_string, " ");
if($pos_end === false) $string = $pre_string."...";
else $string = substr($pre_string, 0, $pos_end)."...";
}
else if ($match_compute > (strlen($string) - ($length - strlen($match_to))))
{
$pre_string = substr($string, (strlen($string) - ($length - strlen($match_to))));
$pos_start = strpos($pre_string, " ");
$string = "...".substr($pre_string, $pos_start);
if($pos_start === false) $string = "...".$pre_string;
else $string = "...".substr($pre_string, $pos_start);
}
else
{
$pre_string = substr($string, ($match_compute - round(($length / 3))), $length);
$pos_start = strpos($pre_string, " "); $pos_end = strrpos($pre_string, " ");
$string = "...".substr($pre_string, $pos_start, $pos_end)."...";
if($pos_start === false && $pos_end === false) $string = "...".$pre_string."...";
else $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
}
$match_start = stristr($string, $match_to);
$match_compute = strlen($string) - strlen($match_start);
}
return $string;
}else{
return $string ='';
}
}
// Hàm dinh dang ngay
function format_date($datetime, $format){
return date($format, $this->mysqldatetime_to_timestamp($datetime));
}
function mysqldatetime_to_timestamp($datetime){
// function is only applicable for valid MySQL DATETIME (19 characters) and DATE (10 characters)
$l = strlen($datetime);
if(!($l == 10 || $l == 19))
return 0;
//
$date = $datetime;
$hours = 0;
$minutes = 0;
$seconds = 0;
// DATETIME only
if($l == 19)
{
list($date, $time) = explode(" ", $datetime);
list($hours, $minutes, $seconds) = explode(":", $time);
}
list($year, $month, $day) = explode("-", $date);
return mktime($hours, $minutes, $seconds, $month, $day, $year);
}
/************Loc chu tim kiem****************/
function getkeyword($text){
$output = array();
$output2 = array();
$arr = explode('"',$text);
for ($i=0;$i<count($arr);$i++)
{
if ($i%2==0)
{
$output=array_merge($output,explode(" ",$arr[$i]));
}
else $output[] = $arr[$i];
}
foreach($output as $word) if (trim($word)!="") $output2[]=$word;
return $output2;
}
} | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/string_library.php | PHP | asf20 | 5,629 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/index.html | HTML | asf20 | 114 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class icon_library
{
public function __construct()
{
$this->CI = &get_instance();
}
function publish($table,$field,$id,$status)
{
if($status==0){
$rep ='_x';
}else{
$rep ='';
}
return '<a href="javascript:;" onclick="publish('.$table.','.$field.','.$id.','.$status.');" title="Bật | Tắt"><img src="'.base_url().'templates/images/icon/publish'.$rep.'.png"></a>';
}
function loadtypefile($file,$type){
if($type=='gif' || $type=='jpg' || $type=='jpeg' || $type=='png'){
return '<img src="'.base_url_site().$file.'" height="80px" width="120px">';
}else if($type=='rar' || $type=='zip'){
return '<img src="'.base_url().'templates/images/file/archive.png">';
}else if($type=='doc' || $type=='docx'){
return '<img src="'.base_url().'templates/images/file/document.png">';
}else if($type=='xsl' || $type=='xslx'){
return '<img src="'.base_url().'templates/images/file/spreadsheet.png">';
}else if($type=='txt'){
return '<img src="'.base_url().'templates/images/file/text.png">';
}else if($type=='mp3' || $type=='swf'){
return '<img src="'.base_url().'templates/images/file/audio.png">';
}else if($type=='avi' || $type=='mp4' || $type=='flv'){
return '<img src="'.base_url().'templates/images/file/video.png">';
}else{
return '<img src="'.base_url().'templates/images/file/default.png">';
}
}
}
?> | 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/icon_library.php | PHP | asf20 | 1,505 |
<?php
class permit_library
{
function __construct()
{
$this->CI =& get_instance();
//$this->check_permit();
}
function check_permit()
{
$module = $this->CI->uri->segment(1);
$func = $this->CI->uri->segment(2);
$this->CI->db->select('sys_permission_detail.*');
$this->CI->db->where('sys_permission_detail.permission_name',$module);
$this->CI->db->where('sys_permission_detail.function_name',$func);
$check_fn = $this->CI->db->get('sys_permission_detail')->row();
if($check_fn)
{
$admin_id = $this->CI->session->userdata('admin_id');
$this->CI->db->select('sys_permission_detail.*, sys_permission_admin.*');
$this->CI->db->join('sys_permission_detail','sys_permission_detail.function_id = sys_permission_admin.function_id');
$this->CI->db->where('sys_permission_detail.permission_name',$module);
$this->CI->db->where('sys_permission_admin.admin_id',$admin_id);
$this->CI->db->where('sys_permission_detail.function_name',$func);
$check = $this->CI->db->get('sys_permission_admin')->row();
if(!$check)
{
$this->CI->session->set_flashdata('message','Bạn không có quyền thực thi chức năng trên');
redirect($this->CI->session->userdata('Url'));
}else{
//$this->write_logs($module,$func);
}
}
}
function write_logs($Modules,$Function)
{
$Url = $this->CI->session->userdata('Url');
$AccountID = $this->CI->session->userdata('admin_id');
$data = array(
'admin_id' => $AccountID,
'Modules' => $Modules,
'Function' => $Function,
'Url' => $Url,
'LogInfo' =>$this->CI->agent->agent_string(),
'LogIP' => $this->CI->input->ip_address(),
'DateLog' => time()
);
$this->CI->db->insert('logs',$data);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/libraries/permit_library.php | PHP | asf20 | 1,785 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/webadmin/hooks/index.html | HTML | asf20 | 114 |
<?php
class editor_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function getAllFile($num,$offset)
{
$ar_img = array('gif','png','jpg','jpeg');
$this->db->where_in('ext',$ar_img);
$this->db->order_by('img_id','DESC');
$query = $this->db->get('sys_images',$num,$offset);
return $query->result();
}
function getNumFile()
{
$query = $this->db->get('sys_images');
return $query->num_rows();
}
function upload()
{
$this->load->library('upload_library');
$size = $_FILES["filedata"]["size"];
if($size > 0)
{
$filedata = $this->upload_library->uploadfile();
if($filedata!='')
{
$file = explode('*',$filedata);
$url = $file[0];
$size = $file[1];
$ext = $file[2];
$data = array(
'lb_name' => $file[3],
'lb_url' => $url,
'ext' => $ext,
'dt_create' => date('Y-m-d H:i:s')
);
$this->db->insert('sys_images',$data);
return $url;
}
}else{
return '';
}
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/editor_model.php | PHP | asf20 | 1,086 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Admin_Model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function getAllAdmin($num,$offset)
{
$query = $this->db->get('sys_admin',$num,$offset);
return $query->result();
}
function getNumAdmin()
{
$query = $this->db->get('sys_admin');
return $query->num_rows();
}
function getAdmin()
{
$id = $this->uri->segment(3);
$this->db->where('admin_id',$id);
$query = $this->db->get('sys_admin');
return $query->row();
}
function get_id($id)
{
$this->db->where('admin_id',$id);
$query = $this->db->get('sys_admin');
return $query->row();
}
function saveAdmin()
{
$admin_id = (int)$this->uri->segment(3);
if($admin_id!=0){
$data_pass = array(
'login_name' => $this->input->post('login_name'),
'password' => md5($this->input->post('password'))
);
$data_no_pass = array(
'login_name' => $this->input->post('login_name')
);
if($this->input->post('password')!=''){
$data = $data_pass;
}else{
$data = $data_no_pass;
}
$this->db->where('admin_id',$admin_id);
if($this->db->update('sys_admin',$data))
{
// Get Phan quyen
$this->db->where('admin_id',$admin_id);
$this->db->delete('sys_permission_admin');
$ar_id = $this->input->post('ar_id');
for($i=0;$i<sizeof($ar_id);$i++)
{
$data_permit = array(
'admin_id' => $admin_id,
'function_id' => $ar_id[$i]
);
$this->db->insert('sys_permission_admin',$data_permit);
}
return true;
}else{
return false;
}
}else{
$data = array(
'login_name' => $this->input->post('login_name'),
'password' => md5($this->input->post('password'))
);
if($this->db->insert('sys_admin',$data)){
$admin_id = $this->db->insert_id();
$ar_id = $this->input->post('ar_id');
for($i=0;$i<sizeof($ar_id);$i++){
$data_permit = array(
'admin_id' => $admin_id,
'function_id' => $ar_id[$i]
);
$this->db->insert('sys_permission_admin',$data_permit);
}
return true;
}else{
return false;
}
}
}
function delete($id)
{
$this->db->where('admin_id',$id);
$query = $this->db->delete('sys_admin');
if($query){
return true;
}else{
return false;
}
}
function get_list_permit()
{
return $this->db->get('sys_permission')->result();
}
function get_list_func($permission_id)
{
$this->db->where('permission_id',$permission_id);
return $this->db->get('sys_permission_detail')->result();
}
function get_item_permit_admin($function_id,$admin_id)
{
$this->db->where('function_id',$function_id);
$this->db->where('admin_id',$admin_id);
$check = $this->db->get('sys_permission_admin')->row();
if($check){
return true;
}else{
return false;
}
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/admin_model.php | PHP | asf20 | 3,849 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login_Model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function get_admin($user_name,$password)
{
$this->db->where('login_name',$user_name);
$this->db->where('password',$password);
$query = $this->db->get('sys_admin');
$row = $query->row();
if($row)
{
$rs = $this->mapuser($row) ;
$this->session->sess_destroy();
$this->session->sess_create();
//Set session data
$this->session->set_userdata($rs);
//Set logged_in to true
$this->session->set_userdata(array('logged_in' => true));
return true;
}else{
return false;
}
}
function check_login($user_name,$password)
{
$this->db->where('login_name',$user_name);
$this->db->where('password',$password);
$query = $this->db->get('sys_admin');
if($query->num_rows() > 0)
{
return true;
}
else
{
return false;
}
}
private function mapuser($row)
{
$rs = new stdClass();
$rs->admin_id = $row->admin_id ;
$rs->admin_name = $row->login_name ;
$rs->admin_fullname = $row->fullname ;
$rs->admin_email = $row->email ;
$rs->admin_level = $row->level ;
return $rs ;
}
} | 123gosaigon | trunk/ 123gosaigon/webadmin/models/login_model.php | PHP | asf20 | 1,422 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Permission_Model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function get_all_permission()
{
return $this->db->get('sys_permission')->result();
}
function get_permission_by_id()
{
$ID = $this->uri->segment(3);
$this->db->where('permission_id',$ID);
return $this->db->get('sys_permission')->row();
}
function save()
{
$permission_id = (int)$this->uri->segment(3);
$data = array(
'permission_name' => $this->input->post('permission_name'),
'permission_notice' => $this->input->post('permission_notice')
);
if($permission_id!=0)
{
$this->db->where('permission_id',$permission_id);
if($this->db->update('sys_permission',$data))
{
$req['permission_name'] = $this->input->post('permission_name');
$this->update_permission_detail($req, $permission_id) ;
return true;
}else{
return false;
}
}else{
if($this->db->insert('sys_permission',$data)){
return true;
}else{
return false;
}
}
}
function delPermission($id)
{
$this->db->where('permission_id',$id);
$check = $this->db->get('permission')->row();
if($check){
$this->db->where('permission_id',$id);
$query=$this->db->get('permission_detail');
if($query->num_rows()>0){
$rs= $query->result();
foreach($rs as $function){
$this->db->where('function_id',$function->function_id);
if($this->db->delete('permission_detail')){
$this->db->where('function_id',$function->function_id);
$this->db->delete('permission_admin');
//return true;
}else{
//return false;
}
}
}
$this->db->where('permission_id',$id);
if($this->db->delete('permission')){
return true;
}else{
return false;
}
}else{
return false;
}
}
function update_permission_detail($data, $permission_id)
{
$this->db->where('permission_id', $permission_id);
return $this->db->update('permission_detail', $data);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/permission_model.php | PHP | asf20 | 2,142 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class AdminCP_Model extends CI_Model
{
function __construct()
{
parent::__construct();
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/admincp_model.php | PHP | asf20 | 186 |
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Town_model extends CI_Model
{
function __construct(){
parent::__construct();
}
function get_all($num,$offset)
{
$this->db->order_by('sort_no','ASC');
$this->db->order_by('town_id','ASC');
return $this->db->get('rv_town',$num,$offset)->result();
}
function get_num()
{
return $this->db->get('rv_town')->num_rows();
}
function del($id)
{
$this->db->where('town_id',$id);
if($this->db->delete('rv_town')){
return true;
}else{
return false;
}
}
function save($data)
{
$id = (int)$this->uri->segment(3);
if($id != 0){
$this->db->where('town_id',$id);
if($this->db->update('rv_town',$data)){
return true;
}else{
return false;
}
}else{
if($this->db->insert('rv_town',$data)){
return true;
}else{
return false;
}
}
}
function get($id=0)
{
$this->db->where('town_id',$id);
return $this->db->get('rv_town')->row();
}
function get_list_country(){
$this->db->order_by('lb_country','ASC');
return $this->db->get('fm_country')->result();
}
function get_country()
{
$this->db->order_by('town_id','ASC');
return $this->db->get('rv_town')->result();
}
function get_national()
{
$this->db->order_by('countryid','ASC');
return $this->db->get('locations_country')->result();
}
}
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/town_model.php | PHP | asf20 | 1,490 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Func_Permit_Model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function get_list_func_by_permit($permission_id)
{
if($permission_id!=0){
$this->db->where('permission_id',$permission_id);
}
return $this->db->get('sys_permission_detail')->result();
}
function get_permission_by_id()
{
$function_id = $this->uri->segment(3);
$this->db->where('permission_id',$function_id);
return $this->db->get('sys_permission')->row();
}
function get_all_permission()
{
return $this->db->get('sys_permission')->result();
}
function get_permit_by_id($function_id)
{
$this->db->where('permission_id',$function_id);
return $this->db->get('sys_permission')->row();
}
function get_func_by_id($id)
{
return $this->db->get_where('sys_permission_detail',array('function_id'=>$id))->row();
}
function save()
{
$function_id = (int)$this->uri->segment(4);
$permission_id = (int)$this->input->post('permission_id');
$check = $this->get_permit_by_id($permission_id);
$permission_name = $check->permission_name;
$data = array(
'permission_id' => $permission_id,
'permission_name' => $permission_name,
'function_name' => $this->input->post('function_name'),
'function_notice' => $this->input->post('function_notice')
);
if($function_id!=0){
$this->db->where('function_id',$function_id);
if($this->db->update('sys_permission_detail',$data)){
return true;
}else{
return false;
}
}else{
if($this->db->insert('sys_permission_detail',$data)){
return true;
}else{
return false;
}
}
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/func_permit_model.php | PHP | asf20 | 1,755 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Logs_Model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function get_all_log($admin_id,$num,$offset)
{
$this->db->where('admin_id',$admin_id);
$this->db->order_by('date_log','DESC');
return $this->db->get('sys_logs',$num,$offset)->result();
}
function get_num_log($admin_id)
{
$this->db->where('admin_id',$admin_id);
return $this->db->get('sys_logs')->num_rows();
}
function get_admin_by_id($admin_id)
{
return $this->db->get_where('sys_admin',array('admin_id'=>$admin_id))->row();
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/logs_model.php | PHP | asf20 | 664 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ajax_model extends CI_Model
{
function __construct() {
parent::__construct();
}
function get_last_order(){
$this->db->order_by('CartID','DESC');
$this->db->where('Status !=','Status');
$this->db->where('IsDelete',0);
return $this->db->get('shoppingcart',5,0)->result();
}
/****
* Thong bao chuyen khoan moi nhat
*/
function get_transfer_notice_last(){
$this->db->select('account.*,transfernotice.*');
$this->db->join('account','account.AccountID = transfernotice.AccountID');
$this->db->order_by('transfernotice.TransferID','DESC');
$this->db->limit('10');
return $this->db->get('transfernotice')->result();
}
/*****
* Tinh tong san pham trong moi don hang
*
* @param mixed $CartID
*/
function get_sum_product($CartID){
$this->db->select_sum('Quantity','total');
$this->db->from('cartdetail');
$this->db->where('CartID',$CartID);
$query = $this->db->get();
return $query->row()->total;
}
/********
* Tinh tong tien trong moi don hang
*
* @param mixed $CartID
*/
function get_sum_price($CartID){
$this->db->where('CartID',$CartID);
$list = $this->db->get('cartdetail')->result();
$total = 0;
foreach($list as $rs):
$total = $total + ($rs->Price * $rs->Quantity);
endforeach;
return $total;
}
/********
* Upload img
*/
function add_img($filename,$ProductID,$session){
if($ProductID!=0){
if($filename!=''){
fn_resize_image('../uploads/images/'.$filename,'../uploads/product/200/'.$filename,200,200);
fn_resize_image('../uploads/images/'.$filename,'../uploads/product/80/'.$filename,80,80);
fn_resize_image('../uploads/images/'.$filename,'../uploads/product/40/'.$filename,40,40);
fn_resize_image('../uploads/images/'.$filename,'../uploads/product/30/'.$filename,30,30);
}
}
$data = array(
'ImagePath' => $filename,
'ProductID' => (int)$ProductID,
'ImageSession' => ($ProductID!=0)?'':$session
);
$this->db->insert('productimage',$data);
return $this->db->insert_id();;
}
/*
* @author : Vo Van Hieu
* @method : set active/deactive
* @param :
* @date : 2/10/2012
* @modify :
*/
function setActiveDeactive($table,$field,$id,$pub){
$this->db->set('bl_active',$pub);
$this->db->where($field,$id);
$this->db->update($table);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/ajax_model.php | PHP | asf20 | 2,534 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class filemanager_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function getAllFile($num=30,$offset=0)
{
$this->db->order_by('img_id','DESC');
$query = $this->db->get('sys_images',$num,$offset);
return $query->result();
}
function getNumFile()
{
$query = $this->db->get('sys_images');
return $query->num_rows();
}
function upload()
{
$this->load->library('upload_library');
$size = $_FILES["filedata"]["size"];
if($size > 0)
{
$filedata = $this->upload_library->uploadfile();
if($filedata!='')
{
$file = explode('*',$filedata);
$data['lb_name'] = $file[0];
$data['lb_url'] = $file[1];
$data['ext'] = $file[2] ;
$data['dt_create'] = date('Y-m-d H:i:s') ;
$this->db->insert('sys_images',$data);
return $data['lb_name'];
}
}
else
{
return '';
}
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/models/filemanager_model.php | PHP | asf20 | 1,021 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/webadmin/models/index.html | HTML | asf20 | 114 |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
/* load the MX_Router class */
require APPPATH."third_party/MX/Router.php";
class MY_Router extends MX_Router {} | 123gosaigon | trunk/ 123gosaigon/webadmin/core/MY_Router.php | PHP | asf20 | 191 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// CodeIgniter i18n library by Jérôme Jaglale
// http://maestric.com/en/doc/php/codeigniter_i18n
// version 10 - May 10, 2012
class MY_Config extends CI_Config {
function site_url($uri = '')
{
if (is_array($uri))
{
$uri = implode('/', $uri);
}
if (class_exists('CI_Controller'))
{
$CI =& get_instance();
$uri = $CI->lang->localized($uri);
}
return parent::site_url($uri);
}
}
/* End of file */
| 123gosaigon | trunk/ 123gosaigon/webadmin/core/MY_Config.php | PHP | asf20 | 513 |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";
class MY_Loader extends MX_Loader {} | 123gosaigon | trunk/ 123gosaigon/webadmin/core/MY_Loader.php | PHP | asf20 | 191 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// CodeIgniter i18n library by Jérôme Jaglale
// http://maestric.com/en/doc/php/codeigniter_i18n
// version 10 - May 10, 2012
class MY_Lang extends CI_Lang {
/**************************************************
configuration
***************************************************/
// languages
var $languages = array(
'vn' => 'vn',
'en' => 'english'
);
// special URIs (not localized)
var $special = array (
""
);
// where to redirect if no language in URI
var $default_uri = '';
/**************************************************/
function __construct()
{
parent::__construct();
global $CFG;
global $URI;
global $RTR;
$segment = $URI->segment(1);
if (isset($this->languages[$segment])) // URI with language -> ok
{
$language = $this->languages[$segment];
$CFG->set_item('language', $language);
}
else if($this->is_special($segment)) // special URI -> no redirect
{
return;
}
else // URI without language -> redirect to default_uri
{
// set default language
$CFG->set_item('language', $this->languages[$this->default_lang()]);
// redirect
//header("Location: " . $CFG->site_url($this->localized($this->default_uri)), TRUE, 302);
//exit;
return;
}
}
// get current language
// ex: return 'en' if language in CI config is 'english'
function lang()
{
global $CFG;
$language = $CFG->item('language');
$lang = array_search($language, $this->languages);
if ($lang)
{
return $lang;
}
return NULL; // this should not happen
}
function is_special($uri)
{
$exploded = explode('/', $uri);
if (in_array($exploded[0], $this->special))
{
return TRUE;
}
if(isset($this->languages[$uri]))
{
return TRUE;
}
return FALSE;
}
function switch_uri($lang)
{
$CI =& get_instance();
$uri = $CI->uri->uri_string();
if ($uri != "")
{
$exploded = explode('/', $uri);
if($exploded[0] == $this->lang())
{
$exploded[0] = $lang;
}
$uri = implode('/',$exploded);
}
return $uri;
}
// is there a language segment in this $uri?
function has_language($uri)
{
$first_segment = NULL;
$exploded = explode('/', $uri);
if(isset($exploded[0]))
{
if($exploded[0] != '')
{
$first_segment = $exploded[0];
}
else if(isset($exploded[1]) && $exploded[1] != '')
{
$first_segment = $exploded[1];
}
}
if($first_segment != NULL)
{
return isset($this->languages[$first_segment]);
}
return FALSE;
}
// default language: first element of $this->languages
function default_lang()
{
foreach ($this->languages as $lang => $language)
{
return $lang;
}
}
// add language segment to $uri (if appropriate)
function localized($uri)
{
if($this->has_language($uri)
|| $this->is_special($uri)
|| preg_match('/(.+)\.[a-zA-Z0-9]{2,4}$/', $uri))
{
// we don't need a language segment because:
// - there's already one or
// - it's a special uri (set in $special) or
// - that's a link to a file
}
else
{
$uri = $this->lang() . '/' . $uri;
}
return $uri;
}
}
/* End of file */
| 123gosaigon | trunk/ 123gosaigon/webadmin/core/MY_Lang.php | PHP | asf20 | 3,389 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/webadmin/core/index.html | HTML | asf20 | 114 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ajax extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('ajax_model','ajax');
$this->load->helper('img_helper');
}
function orderlast()
{
$data['list'] = $this->ajax->get_last_order();
$this->load->view('ajax/orderlast',$data);
}
function transfer_notice_last()
{
$list = $this->ajax->get_transfer_notice_last();
$data['list'] = '
<table class="admindata">
<thead>
<th>Mã ĐH</th>
<th>Tài khoản</th>
<th>Xem</th>
</thead>
';
$k=1;
foreach($list as $rs):
$data['list'] .='
<tr class="row'.$k.'">
<td><a href="'.site_url('chonmua/chitietdonhang/'.$rs->CartID).'">'.$rs->CartID.'</a></td>
<td>'.$rs->LoginName.'</td>
<td><a href="'.site_url('chonmua/notice_detail/'.$rs->TransferID).'">Xem</td>
</tr>
';
$k=1-$k;
endforeach;
$data['list'] .='</table> ';
echo json_encode($data);
}
function thongke()
{
$this->load->view('ajax/thongke');
}
function publish()
{
$status = $this->input->post('status');
$id = $this->input->post('id');
$field = $this->input->post('field');
$table = $this->input->post('table');
if($status==0){
$pub = 1;
}else{
$pub = 0;
}
$this->ajax->setActiveDeactive($table,$field,$id,$pub);
echo icon_active("'$table'","'$field'",$id,$pub);
}
function getalias()
{
$name = $this->input->post('name');
echo strtolower($this->string_library->stringchange($name));
}
function uploader()
{
$ProductID = $this->uri->segment(3);
$session_info = $this->session->userdata('session_id');
$dir = '../uploads/images/';
$dir_admin = 'uploads/images/';
//chmod($uploaddir,0777);
$size=$_FILES['uploadfile']['size'];
if($size>204857600)
{
echo "file_biger";
unlink($_FILES['uploadfile']['tmp_name']);
//exit;
}
$filename = stripslashes($_FILES['uploadfile']['name']);
$i = strrpos($filename,".");
if (!$i) { return ""; }
$l = strlen($filename) - $i;
$extension = substr($filename,$i+1,$l);
$extension = strtolower($extension);
$file_name = str_replace($extension,'',$filename);
$name = time();
if($extension =='jpeg'){
$extension = 'jpg';
}
$filename = $dir.$name.'.'.$extension;
$file_ext = $name.'.'.$extension;
if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $filename)) {
$id_img = $this->ajax->add_img($file_ext,$ProductID,$session_info);
echo $id_img.','.$file_ext;
} else {
echo 'error';
}
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/ajax.php | PHP | asf20 | 2,761 |
<?
class editor extends CI_Controller
{
protected $_templates;
public function __construct()
{
parent::__construct();
$this->load->model('editor_model','editor');
}
function index()
{
$data['title'] = '';
$config['base_url'] = base_url().'editor/index/';
$data['total'] = $this->editor->getNumFile();
$config['total_rows'] = $data['total'];
$config['per_page'] = '10';
$config['uri_segment'] = 3;
$this->pagination->initialize($config);
$data['list'] = $this->editor->getAllFile($config['per_page'],(int)$this->uri->segment('3'));
$data['pagination'] = $this->pagination->create_links();
$this->_templates['page'] = 'editor/index';
$this->site->load($this->_templates['page'],$data,'editor');
}
function upload(){
$data['title'] = '';
$this->_templates['page'] = 'editor/upload';
$this->form_validation->set_rules('id','','');
if($this->form_validation->run()){
$file = $this->editor->upload();
$data['file'] = $file;
redirect('editor');
}
$this->site->load($this->_templates['page'],$data,'editor');
}
}
?> | 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/editor.php | PHP | asf20 | 1,349 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Admin extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
$this->pre_message = "";
$this->load->model('admin_model','admin');
$this->load->library('permit_library') ;
$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));
}
function listadmin()
{
$data['title'] = lang('list_admin');
$data['add'] = 'admin/add' ;
$config['base_url'] = base_url().'admin/listadmin/';
$config['total_rows'] = $this->admin->getNumAdmin();
$data['num'] = $config['total_rows'];
$config['per_page'] = 20;
$config['uri_segment'] = 3;
$this->pagination->initialize($config);
$data['list'] = $this->admin->getAllAdmin($config['per_page'],$this->uri->segment('3'));
$data['pagination'] = $this->pagination->create_links();
$this->_templates['page'] = 'admin/listadmin';
$this->site->load('admin/listadmin',$data);
}
function add()
{
$data['title'] = lang('add_new_admin');
$data['list'] = $this->admin->get_list_permit();
if(!empty($_POST['bt_submit'])){
$this->form_validation->set_rules('login_name',lang('user_name'),'trim|required|callback__check_admin');
$this->form_validation->set_rules('password',lang('password'),'trim|required');
$this->form_validation->set_rules('re_password',lang('re_password'),'trim|required|matches[password]');
if($this->form_validation->run() == FALSE){
$this->pre_message = validation_errors();
}else{
if($this->admin->saveAdmin()){
$this->session->set_flashdata('message',lang('ntc_save_success'));
redirect('admin/listadmin');
}else{
$this->pre_message = lang('err_save_unsuccess');
}
}
}
$data['message'] = $this->pre_message;
$this->_templates['page'] = 'admin/add';
$this->site->load($this->_templates['page'],$data);
}
function edit()
{
$rs = $this->admin->getAdmin();
$data['list'] = $this->admin->get_list_permit();
$data['title'] = lang('update_admin_account').' : '.$rs->login_name;
$data['admin_id'] = $rs->admin_id;
if(!empty($_POST['bt_submit']))
{
$this->form_validation->set_rules('login_name',lang('user_name'),'trim|required|callback__check_admin_edit');
$this->form_validation->set_rules('password',lang('password'),'trim');
$this->form_validation->set_rules('re_password',lang('re_password'),'trim|matches[password]');
if($this->form_validation->run() == FALSE){
$this->pre_message = validation_errors();
}else{
if($this->admin->saveAdmin()){
$this->session->set_flashdata('message',lang('ntc_save_success'));
redirect('admin/listadmin');
}else{
$this->pre_message = lang('err_save_unsuccess');
}
}
$data['login_name'] = $this->input->post('login_name');
}else{
$data['login_name'] = $rs->login_name;
}
$data['message'] = $this->pre_message;
$this->_templates['page'] = 'admin/edit';
$this->site->load($this->_templates['page'],$data);
}
function changepass()
{
$data['title'] = 'Đổi mật khẩu' ;
if(isset($_POST['bt_submit']))
{
$oldpass = $this->input->post('oldpass') ;
$newpass = $this->input->post('newpass') ;
$repass = $this->input->post('repass') ;
$admin_id = $this->session->userdata('admin_id');
$rs = $this->admin->get_id($admin_id) ;
$password = $rs->password ;
if(($password == md5($oldpass)) && ($newpass==$repass))
{
$req['password'] = md5($newpass);
$this->db->where('admin_id',$admin_id) ;
if($this->db->update('sys_admin',$req))
{
$this->session->set_flashdata('message','Cập nhật thành công');
redirect('admincp');
}else{
$this->pre_message = 'Lưu không thành công';
}
}else{
$this->pre_message = 'Mật khẩu không đúng hay nhập mật khẩu 2 lần không giống nhau.';
}
}
$data['message'] = $this->pre_message;
$this->site->load('admin/changepass',$data);
}
function _check_admin($login_name)
{
$this->db->where('login_name',$login_name);
$query = $this->db->get('sys_admin');
if($query->num_rows() > 0){
$this->form_validation->set_message('_check_admin',lang('login_name_used'));
return false;
}else{
return true;
}
}
function _check_admin_edit($login_name)
{
$this->db->where('admin_id <>',$this->uri->segment(3));
$this->db->where('login_name',$login_name);
$query = $this->db->get('sys_admin');
if($query->num_rows() > 0){
$this->form_validation->set_message('_check_admin_edit',lang('login_name_used'));
return FALSE;
}else{
return TRUE;
}
}
function del()
{
$id = $this->uri->segment(3);
$page = $this->uri->segment(4);
if($this->admin->delete($id))
$this->session->set_flashdata('message',lang('ntc_del_success'));
else $this->session->set_flashdata('message',lang('err_del_unsuccess'));
redirect('admin/listadmin/'.$page);
}
function dels()
{
if(!empty($_POST['ar_id']))
{
$page = (int)$this->input->post('page');
$ar_id = $this->input->post('ar_id');
if(!empty($_POST['btn_submit']))
{
for($i = 0; $i < sizeof($ar_id); $i ++) {
if ($ar_id[$i]){
if($this->admin->delete($ar_id[$i]))
$this->session->set_flashdata('message',lang('ntc_del_success'));
else $this->session->set_flashdata('message',lang('err_del_unsuccess'));
}
}
}
}
redirect('admin/listadmin/'.$page);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/admin.php | PHP | asf20 | 6,628 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class AdminCP extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
$this->load->model('admincp_model','admincp');
}
function index()
{
$data['title'] = 'Control Panel';
//trit($this->session);
$data['page'] = 'admincp/index' ;
$this->load->view('layout/skin',$data) ;
}
function quickpost()
{
$this->load->view('modules/mod_quickpost');
}
function close()
{
$this->load->view('close');
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/admincp.php | PHP | asf20 | 579 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Permission extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
$this->pre_message ="";
$this->load->model('permission_model','permission');
/*$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));*/
}
function index()
{
$data['title'] = 'Quản lý danh sách Modules';
$data['add'] = 'permission/add' ;
$data['list'] = $this->permission->get_all_permission();
$data['num'] = count($data['list']);
$this->_templates['page'] = 'permission/list';
$this->site->load($this->_templates['page'],$data);
}
function add(){
$data['title'] = 'Thêm mới Modules';
if(!empty($_POST['bt_submit'])){
$this->form_validation->set_rules('permission_name','Tên Modules','trim|required');
$this->form_validation->set_rules('permission_notice','Ghi chú','');
if($this->form_validation->run() == FALSE){
$this->pre_message = validation_errors();
}else{
if($this->permission->save()){
$this->session->set_flashdata('message','Lưu thành công');
redirect('permission');
}else{
$this->pre_message = 'Lưu không thành công';
}
}
}
$data['message'] = $this->pre_message;
$this->_templates['page'] = 'permission/add';
$this->site->load($this->_templates['page'],$data);
}
function edit(){
$data['title'] = 'Cập nhật Modules';
$data['rs'] = $this->permission->get_permission_by_id();
if(!empty($_POST['bt_submit'])){
$this->form_validation->set_rules('permission_name','Tên Modules','trim|required');
$this->form_validation->set_rules('permission_notice','Ghi chú','');
if($this->form_validation->run() == FALSE){
$this->pre_message = validation_errors();
}else{
if($this->permission->save()){
$this->session->set_flashdata('message','Lưu thành công');
redirect('permission');
}else{
$this->pre_message = 'Lưu không thành công';
}
}
}
$data['message'] = $this->pre_message;
$this->_templates['page'] = 'permission/edit';
$this->site->load($this->_templates['page'],$data);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/permission.php | PHP | asf20 | 2,333 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends CI_Controller
{
protected $_templates;
public function __construct()
{
parent::__construct();
$this->load->model('login_model','login');
}
public function index()
{
if($this->session->userdata('admin_id')){
redirect('admincp');
}
if(isset($_POST['bt_submit']))
{
$security_code = $this->session->userdata('security_code') ;
$captcha = $this->input->post('captcha');
$user_name = $this->input->post('user_login');
$password = md5($this->input->post('user_pass'));
//trit($captcha .'=='. $security_code);
if(!empty($captcha) && ($captcha == $security_code))
{
$this->form_validation->set_rules('user_login',lang('login_name'),'trim|required|callback_check_login');
$this->form_validation->set_rules('user_pass',lang('login_password'),'trim|required');
if($this->form_validation->run())
{
if($this->login->get_admin($user_name,$password))
{
$this->session->set_flashdata('message',"Đăng nhập thành công");
redirect(base_url().'admincp');
}else{
$this->session->set_flashdata('message',"Đăng nhập không thành công");
}
}
}
else
{
$this->session->set_userdata('message',"Mã lệnh không hợp lệ");
}
}
$this->load->view('login/index');
}
function check_login($user_login)
{
$password= md5($this->input->post('user_pass'));
if(($user_login!='') && ($password!=''))
{
if($this->login->check_login($user_login,$password))
{
return true;
}
else
{
$this->form_validation->set_message('check_login',lang('login_fail_info'));
return false;
}
}
else
{
$this->form_validation->set_message('check_login',lang('login_name_pass_not_empty'));
return false;
}
}
public function captcha()
{
$md5_hash = md5(rand(0,999));
$security_code = substr($md5_hash, 15, 5);
//$_SESSION["security_code"] = $security_code;
$this->session->set_userdata(array('security_code'=>$security_code)) ;
$width = 100;
$height = 28;
$image = imagecreate($width, $height);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $black);
imagestring($image, 10, 28, 6, $security_code, $white);
header("Content-Type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
}
function logout()
{
$this->session->sess_destroy();
redirect(base_url());
}
}
?> | 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/login.php | PHP | asf20 | 2,819 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Func_Permit extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
$this->pre_message = "";
$this->load->model('func_permit_model','func_permit');
$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));
}
function showlist()
{
$data['cat'] = $this->func_permit->get_permission_by_id();
$data['add'] = 'func_permit/add/'.(int)$this->uri->segment(3) ;
$data['title'] = 'Danh sách chức năng Modules '.$data['cat']->permission_name;
$data['list'] = $this->func_permit->get_list_func_by_permit($this->uri->segment(3));
$data['num'] = count($data['list']);
$this->_templates['page'] = 'permission/func/list';
$this->site->load($this->_templates['page'],$data);
}
function add()
{
$data['title'] = 'Thêm mới Modules';
$data['list'] = $this->func_permit->get_all_permission();
if(!empty($_POST['bt_submit']))
{
$this->form_validation->set_rules('function_name','Tên chức năng','trim|required');
$this->form_validation->set_rules('function_notice','Ghi chú','');
if($this->form_validation->run() == FALSE){
$this->pre_message = validation_errors();
}else{
if($this->func_permit->save())
{
$this->session->set_flashdata('message','Lưu thành công');
redirect('func_permit/showlist/'.$this->uri->segment(3));
}else{
$this->pre_message = 'Lưu không thành công';
}
}
}
$data['message'] = $this->pre_message;
$this->_templates['page'] = 'permission/func/add';
$this->site->load($this->_templates['page'],$data);
}
function edit()
{
$data['title'] = 'Cập nhật Modules';
$data['list'] = $this->func_permit->get_all_permission();
$data['rs'] = $this->func_permit->get_func_by_id($this->uri->segment(4));
if(!empty($_POST['bt_submit']))
{
$this->form_validation->set_rules('function_name','Tên chức năng','trim|required');
$this->form_validation->set_rules('function_notice','Ghi chú','');
if($this->form_validation->run() == FALSE){
$this->pre_message = validation_errors();
}else{
if($this->func_permit->save()){
$this->session->set_flashdata('message','Lưu thành công');
redirect('func_permit/showlist/'.$this->uri->segment(3));
}else{
$this->pre_message = 'Lưu không thành công';
}
}
}
$data['message'] = $this->pre_message;
$this->_templates['page'] = 'permission/func/edit';
$this->site->load($this->_templates['page'],$data);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/func_permit.php | PHP | asf20 | 3,024 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class logs extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
$this->load->model('logs_model','logs');
$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));
}
function index(){
$this->listlogs();
}
function listlogs()
{
$data['title'] = 'Lịch sử thao tác của: '.$this->logs->get_admin_by_id($this->uri->segment(3))->login_name;
$config['base_url'] = base_url().'logs/listlogs/'.$this->uri->segment(3);
$config['total_rows'] = $this->logs->get_num_log($this->uri->segment(3));
$data['num'] = $config['total_rows'];
$config['per_page'] = 30;
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
$data['list'] = $this->logs->get_all_log($this->uri->segment(3),$config['per_page'],$this->uri->segment(4));
$data['pagination'] = $this->pagination->create_links();
$this->_templates['page'] = 'logs/list';
$this->site->load($this->_templates['page'],$data);
}
function del(){
$AdminID = $this->uri->segment(3);
$this->db->where('admin_id',$AdminID);
if($this->db->delete('logs')){
$this->session->set_flashdata('message','Xóa thành công');
}else{
$this->session->set_flashdata('message','Xóa không thành công');
}
redirect('logs/listlogs/'.$AdminID);
}
}
?>
| 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/logs.php | PHP | asf20 | 1,502 |
<?php
class Town extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));
$this->load->model('town_model','town');
}
function index()
{
$data = array();
$data['title'] = "Danh sách tỉnh thành";
$data['add'] = 'town/add';
$start = (int)$this->uri->segment(4) ;
$config['base_url'] = base_url().'town/index/'.$start;
$data['num'] = $config['total_rows'] = $this->town->get_num();
$config['per_page'] = 40 ;
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$data['list'] = $this->town->get_all($config['per_page'], $start);
$data['page'] = 'town/list' ;
$this->load->view('layout/skin', $data);
$this->createTown();
$this->createNational();
}
function add()
{
$data = array();
$data['title'] = lang('add_news');
if(isset($_POST['bt_submit']))
{
$this->form_validation->set_rules('cd_city',lang('code'),'trim|required');
$this->form_validation->set_rules('town_name',lang('name_city'),'trim|required');
if($this->form_validation->run()== FALSE){
$this->pre_message = validation_errors();
}else{
$data = $this-> build_data($_POST,$flag=1);
if($this->town->save_city($data)){
$this->session->set_flashdata('message',lang('successful'));
redirect('town');
}
}
$data['message'] = $this->pre_message;
}
$data['page'] = 'town/add' ;
$this->load->view('layout/skin', $data);
}
function edit($id)
{
if(isset($_POST['bt_submit']))
{
$this->form_validation->set_rules('town_name',lang('name_city'),'trim|required');
if($this->form_validation->run()== FALSE){
$this->pre_message = validation_errors();
}else{
$data = $this-> build_data();
if($this->town->save($data)){
$this->session->set_flashdata('message',lang('successful'));
redirect('town');
}
}
}
$data['title'] = "Cập nhật tỉnh thành";
$data['rs'] = $this->town->get($id);
$data['page'] = 'town/edit' ;
$this->load->view('layout/skin', $data);
}
function build_data($flag=0)
{
$req["town_name"]= $this->input->post("town_name");
$req["sort_no"]= (int) $this->input->post("sort_no");
$req["bl_active"]= (int) $this->input->post("bl_active");
return $req;
}
function del()
{
$id = $this->uri->segment(3);
$page = $this->uri->segment(4);
if($this->town->del($id))
$this->session->set_flashdata('message',lang('delete_success'));
else
$this->session->set_flashdata('message',lang('delete_unsuccess'));
redirect('town');
}
function dels()
{
if(!empty($_POST['ar_id']))
{
$page = (int)$this->input->post('page');
$ar_id = $this->input->post('ar_id');
if(!empty($_POST['btn_submit']))
{
for($i = 0; $i < sizeof($ar_id); $i ++)
{
if ($ar_id[$i]){
if($this->town->del($ar_id[$i]))
$this->session->set_flashdata('message',lang('delete_success'));
else $this->session->set_flashdata('message',lang('delete_unsuccess'));
}
}
}
}
redirect('town');
}
function createTown(){
$data=$this->town->get_country();
$str = "<?php \n/**\n* Cache file for news.dev \n* Date: ".date('d/m/y H:i:s').".\n**/\n";
$str.="\$town_total=".count($data).";\n";
foreach($data as $v){
$str.="\$town['$v->town_id']='$v->town_name';\n";
}
file_put_contents(DIR_DATA.'/town.php',$str);
}
function createNational(){
$data=$this->town->get_national();
$str = "<?php \n/**\n* Cache file for news.dev \n* Date: ".date('d/m/y H:i:s').".\n**/\n";
$str.="\$national_total=".count($data).";\n";
foreach($data as $v){
$str.="\$national['$v->countryid']=\"$v->name\";\n";
}
file_put_contents(DIR_DATA.'/national.php',$str);
}
}
/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */ | 123gosaigon | trunk/ 123gosaigon/webadmin/controllers/town.php | PHP | asf20 | 4,137 |