1: <?php
2: 3: 4: 5: 6:
7:
8: 9: 10: 11: 12:
13: abstract class QJQAction extends QAction {
14: protected $strControlId = null;
15: protected $strMethod = null;
16:
17: protected function __construct(QControl $objControl, $strMethod) {
18: $this->strControlId = $objControl->ControlId;
19: $this->strMethod = QType::Cast($strMethod, QType::String);
20: $this->setJavaScripts($objControl);
21: }
22:
23: private function setJavaScripts(QControlBase $objControl) {
24: $objControl->AddJavascriptFile(__JQUERY_EFFECTS__);
25: }
26: }
27:
28: 29: 30: 31: 32:
33: class QJQShowAction extends QJQAction {
34: public function __construct(QControl $objControl, $strMethod = "slow") {
35: parent::__construct($objControl, $strMethod);
36: }
37:
38: public function RenderScript(QControl $objControl) {
39: return sprintf('$j("#%s").show("%s");', $this->strControlId, $this->strMethod);
40: }
41: }
42:
43: 44: 45: 46: 47:
48: class QJQShowEffectAction extends QJQAction {
49: protected $strOptions = null;
50: protected $strSpeed = null;
51:
52: public function __construct(QControl $objControl, $strMethod = "default", $strOptions = "", $strSpeed = 1000) {
53: $this->strOptions = QType::Cast($strOptions, QType::String);
54: $this->strSpeed = QType::Cast($strSpeed, QType::String);
55:
56: parent::__construct($objControl, $strMethod);
57: }
58:
59: public function RenderScript(QControl $objControl) {
60: return sprintf('$j("#%s").show("%s", {%s}, %s);', $this->strControlId, $this->strMethod, $this->strOptions, $this->strSpeed);
61: }
62: }
63:
64:
65: 66: 67: 68: 69:
70: class QJQToggleEffectAction extends QJQAction {
71: protected $strOptions = null;
72: protected $strSpeed = null;
73:
74: public function __construct(QControl $objControl, $strMethod = "slow", $strOptions = "", $strSpeed = 1000) {
75: $this->strOptions = QType::Cast($strOptions, QType::String);
76: $this->strSpeed = QType::Cast($strSpeed, QType::String);
77:
78: parent::__construct($objControl, $strMethod);
79: }
80:
81: public function RenderScript(QControl $objControl) {
82: return sprintf('$j("#%s").toggle("%s", {%s}, %s);', $this->strControlId, $this->strMethod, $this->strOptions, $this->strSpeed);
83: }
84: }
85:
86:
87: 88: 89: 90: 91:
92: class QJQToggleAction extends QJQAction {
93: public function __construct(QControl $objControl, $strMethod = "slow") {
94: parent::__construct($objControl, $strMethod);
95: }
96:
97: public function RenderScript(QControl $objControl) {
98: return sprintf('$j("#%s").toggle("%s");', $this->strControlId, $this->strMethod);
99: }
100: }
101:
102: 103: 104: 105: 106:
107: class QJQHideAction extends QJQAction {
108: public function __construct(QControl $objControl, $strMethod = "slow") {
109: parent::__construct($objControl, $strMethod);
110: }
111:
112: public function RenderScript(QControl $objControl) {
113: return sprintf('$j("#%s").hide("%s");', $this->strControlId, $this->strMethod);
114: }
115: }
116:
117: 118: 119: 120: 121:
122: class QJQHideEffectAction extends QJQAction {
123: protected $strOptions = null;
124: protected $strSpeed = null;
125:
126: public function __construct(QControl $objControl, $strMethod = "blind", $strOptions = "", $strSpeed = 1000) {
127: $this->strOptions = QType::Cast($strOptions, QType::String);
128: $this->strSpeed = QType::Cast($strSpeed, QType::String);
129:
130: parent::__construct($objControl, $strMethod);
131: }
132:
133: public function RenderScript(QControl $objControl) {
134: return sprintf('$j("#%s").hide("%s", {%s}, %s);', $this->strControlId, $this->strMethod, $this->strOptions, $this->strSpeed);
135: }
136: }
137:
138: 139: 140: 141: 142:
143: class QJQBounceAction extends QJQAction {
144: protected $strOptions = null;
145: protected $strSpeed = null;
146:
147: public function __construct(QControl $objControl, $strOptions = "", $strSpeed = 1000) {
148: $this->strOptions = QType::Cast($strOptions, QType::String);
149: $this->strSpeed = QType::Cast($strSpeed, QType::String);
150:
151: parent::__construct($objControl, 'bounce');
152: }
153:
154: public function RenderScript(QControl $objControl) {
155: return sprintf('$j("#%s_ctl").effect("bounce", {%s}, %s);', $this->strControlId, $this->strOptions, $this->strSpeed);
156: }
157: }
158:
159: 160: 161: 162: 163:
164: class QJQShakeAction extends QJQAction {
165: protected $strOptions = null;
166: protected $strSpeed = null;
167:
168: public function __construct(QControl $objControl, $strOptions = "", $strSpeed = 1000) {
169: $this->strOptions = QType::Cast($strOptions, QType::String);
170: $this->strSpeed = QType::Cast($strSpeed, QType::String);
171:
172: parent::__construct($objControl, 'shake');
173: }
174:
175: public function RenderScript(QControl $objControl) {
176: return sprintf('$j("#%s_ctl").effect("shake", {%s}, %s);', $this->strControlId, $this->strOptions, $this->strSpeed);
177: }
178: }
179:
180: 181: 182: 183: 184:
185: class QJQHighlightAction extends QJQAction {
186: protected $strOptions = null;
187: protected $strSpeed = null;
188:
189: public function __construct(QControl $objControl, $strOptions = "", $strSpeed = 1000) {
190: $this->strOptions = QType::Cast($strOptions, QType::String);
191: $this->strSpeed = QType::Cast($strSpeed, QType::String);
192:
193: parent::__construct($objControl, 'highlight');
194: }
195:
196: public function RenderScript(QControl $objControl) {
197: return sprintf('$j("#%s").effect("highlight", {%s}, %s);', $this->strControlId, $this->strOptions, $this->strSpeed);
198: }
199: }
200:
201: 202: 203: 204: 205:
206: class QJQPulsateAction extends QJQAction {
207: protected $strOptions = null;
208: protected $strSpeed = null;
209:
210: public function __construct(QControl $objControl, $strOptions = "", $strSpeed = 1000) {
211: $this->strOptions = QType::Cast($strOptions, QType::String);
212: $this->strSpeed = QType::Cast($strSpeed, QType::String);
213:
214: parent::__construct($objControl, 'pulsate');
215: }
216:
217: public function RenderScript(QControl $objControl) {
218: return sprintf('$j("#%s").effect("pulsate", {%s}, %s);', $this->strControlId, $this->strOptions, $this->strSpeed);
219: }
220: }
221:
222: 223: 224: 225: 226:
227: class QJQSizeAction extends QJQAction {
228: protected $strOptions = null;
229: protected $strSpeed = null;
230:
231: public function __construct(QControl $objControl, $strOptions, $strSpeed = 1000) {
232: $this->strOptions = QType::Cast($strOptions, QType::String);
233: $this->strSpeed = QType::Cast($strSpeed, QType::String);
234:
235: parent::__construct($objControl, 'pulsate');
236: }
237:
238: public function RenderScript(QControl $objControl) {
239: return sprintf('$j("#%s").effect("size", {%s}, %s);', $this->strControlId, $this->strOptions, $this->strSpeed);
240: }
241: }
242:
243: 244: 245: 246: 247:
248: class QJQTransferAction extends QJQAction {
249: protected $strTargetControlId = null;
250: protected $strOptions = null;
251: protected $strSpeed = null;
252:
253: public function __construct(QControl $objControl, QControl $objTargetControl, $strOptions = "", $strSpeed = 1000) {
254: $this->strTargetControlId = $objTargetControl->ControlId;
255:
256: $this->strOptions = QType::Cast($strOptions, QType::String);
257: $this->strSpeed = QType::Cast($strSpeed, QType::String);
258:
259: parent::__construct($objControl, 'transfer');
260: }
261:
262: public function RenderScript(QControl $objControl) {
263: return sprintf('$j("#%s").effect("transfer", {to: "#%s_ctl" %s}, %s);', $this->strControlId, $this->strTargetControlId, $this->strOptions, $this->strSpeed);
264: }
265: }