Commit 81143165 by Qiang Xue

form wip

parent 4e9dc981
......@@ -17,14 +17,14 @@ return array(
'yii/validation' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'yii-validation.js',
'yii.validation.js',
),
'depends' => array('yii'),
),
'yii/form' => array(
'sourcePath' => __DIR__ . '/assets',
'js' => array(
'yii-form.js',
'yii.activeForm.js',
),
'depends' => array('yii', 'yii/validation'),
),
......
/**
* Yii form widget.
*
* This is the JavaScript widget used by the yii\widgets\ActiveForm widget.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
!function ($) {
}(window.jQuery);
\ No newline at end of file
......@@ -7,10 +7,24 @@
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
;(function($) {
$.yii = {
version : '2.0'
yii = (function ($) {
var pub = {
version: '2.0'
};
return pub;
})(jQuery);
jQuery(document).ready(function ($) {
// call the init() method of every module
var init = function (module) {
if ($.isFunction(module.init) && (module.trigger == undefined || $(module.trigger).length)) {
module.init();
}
$.each(module, function () {
if ($.isPlainObject(this)) {
init(this);
}
});
};
init(yii);
});
/**
* Yii form widget.
* Yii validation module.
*
* This is the JavaScript widget used by the yii\widgets\ActiveForm widget.
*
......@@ -10,6 +10,8 @@
* @since 2.0
*/
!function ($) {
}(window.jQuery);
\ No newline at end of file
yii.validation = (function ($) {
var pub = {
};
return pub;
})(jQuery);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment