Skip to content

Commit 06315c0

Browse files
up JC.AutoFixed, Bizs.FormLogic
1 parent 28a1421 commit 06315c0

File tree

91 files changed

+1012
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1012
-68
lines changed

bizs/FormLogic/FormLogic.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//TODO: 添加 disabled bind hidden 操作
22
//TODO: formSubmitIgnoreCheck 时, 如果在控件里回车提交的话, 控制逻辑可能会有问题, 需要仔细检查
3-
;(function(define, _win) { 'use strict'; define( [ 'JC.BaseMVC', 'JC.Valid', 'JC.Panel', 'JC.FormFillUrl' ], function(){
3+
;(function(define, _win) { 'use strict'; define( 'Bizs.FormLogic', [ 'JC.BaseMVC', 'JC.Valid', 'JC.Panel', 'JC.FormFillUrl' ], function(){
44
/**
55
* <h2>提交表单控制逻辑</h2>
66
* 应用场景
@@ -411,7 +411,7 @@ window.parent
411411
FormLogic.processErrorCb;
412412
/**
413413
* 全局返回数据处理回调
414-
* <br />所有提交结果都会调用
414+
* <br />所有换回结果都会调用
415415
* <br />arg: _data[string of result]
416416
* @property GLOBAL_AJAX_CHECK
417417
* @type function
@@ -420,6 +420,18 @@ window.parent
420420
*/
421421
FormLogic.GLOBAL_AJAX_CHECK;
422422

423+
/**
424+
* 全局数据解析函数
425+
* <br />所有换回结果都会调用
426+
* <br />arg: _data[string of result]
427+
* @property GLOBAL_AJAX_CHECK
428+
* @type function
429+
* @default null
430+
* @return Object
431+
* @static
432+
*/
433+
FormLogic.DATA_PARSE;
434+
423435
FormLogic._currentIns;
424436

425437

@@ -553,6 +565,8 @@ window.parent
553565

554566
_p._model.formSubmitDisable() && _p.trigger( FormLogic.Model.ENABLE_SUBMIT );
555567

568+
_p._model.dataParse() && ( _data = _p._model.dataParse()( _data ) );
569+
556570
var _json, _fatalError, _resultType = _p._model.formAjaxResultType();
557571
if( Object.prototype.toString.call( _data ) == '[object Object]' ){
558572
_json = _data;
@@ -1027,6 +1041,13 @@ window.parent
10271041
_r = _p.userFormAjaxDone() || _r;
10281042
return _r;
10291043
}
1044+
, dataParse:
1045+
function(){
1046+
var _p = this, _r = FormLogic.DATA_PARSE;
1047+
_r = _p.windowProp( 'formDataParse' ) || _r;
1048+
return _r;
1049+
}
1050+
10301051
, userFormAjaxDone:
10311052
function(){
10321053
var _p = this, _r

comps/AutoFixed/AutoFixed.js

Lines changed: 99 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//TODO: 兼容 不支持 css position = fixed 的浏览器
2-
;(function(define, _win) { 'use strict'; define( [ 'JC.BaseMVC' ], function(){
2+
;(function(define, _win) { 'use strict'; define( 'JC.AutoFixed', [ 'JC.BaseMVC' ], function(){
33
/**
44
* 自动 Fixed ( JC.AutoFixed )
55
*
@@ -34,6 +34,15 @@
3434
* <dd>
3535
* 是否修正 html 锚点定位问题( 该问题通常出现在 position fixed top = 0 )
3636
* </dd>
37+
*
38+
* <dt>data-highlightTrigger = selector</dt>
39+
* <dd>滚动时响应滚动条所在锚点的内容高亮显示</dd>
40+
*
41+
* <dt>data-highlightAnchorLayout = selector, default = data-highlightTrigger</dt>
42+
* <dd>指定计算位置为锚点的某个父容器 y + height</dd>
43+
*
44+
* <dt>data-highlightClass = css class name, default = cur</dt>
45+
* <dd>当前高亮的css class</dd>
3746
* </dl>
3847
*
3948
* @namespace JC
@@ -81,7 +90,7 @@
8190
if( _selector.hasClass( 'js_compAutoFixed' ) ){
8291
_r.push( new AutoFixed( _selector ) );
8392
}else{
84-
_selector.find( 'div.js_compAutoFixed' ).each( function(){
93+
_selector.find( 'div.js_compAutoFixed, ul.js_compAutoFixed, dl.js_compAutoFixed' ).each( function(){
8594
_r.push( new AutoFixed( this ) );
8695
});
8796
}
@@ -137,7 +146,7 @@
137146
});
138147

139148
JWIN.on( 'resize', function( _evt ){
140-
var _cloneItem = _p._model.cloneItem(), _realWidth, _height, _ds, _winSize;
149+
var _cloneItem = _p._model.cloneItem(), _realWidth, _height, _ds, _winSize, _x, _css;
141150
if( !_cloneItem ) {
142151
_p._model.normalClass()
143152
&& _p.selector().removeClass( _p._model.normalClass() )
@@ -160,7 +169,14 @@
160169
return;
161170
}
162171
_realWidth = _cloneItem.width();
163-
_p.selector().css( { 'width': _realWidth, 'height': _height } );
172+
_css = { 'width': _realWidth, 'height': _height, left: _cloneItem.offset().left };
173+
if( _ds.right != 'auto' ){
174+
_css.right = _winSize.width - ( _cloneItem.offset().left + _cloneItem.width() );
175+
}else{
176+
_css.left = _cloneItem.offset().left;
177+
}
178+
179+
_p.selector().css( _css );
164180
}
165181
_p._model.defaultStyle().width = _realWidth;
166182
});
@@ -204,6 +220,7 @@
204220
_css.right = _winSize.width - ( _cloneItem.offset().left + _cloneItem.width() );
205221
}else{
206222
_css.left = _left;
223+
_css.left = _cloneItem.offset().left;
207224
}
208225
_p.selector().css( _css );
209226

@@ -258,6 +275,49 @@
258275
_p.on( 'UN_CLONE_ITEM', function(){
259276
_p._model.cloneItem( null );
260277
});
278+
279+
if( _p._model.highlightTrigger() && _p._model.highlightTrigger().length ){
280+
var _clickTs = JC.f.ts();
281+
_p._model.highlightTrigger().on( 'click', function(){
282+
_clickTs = JC.f.ts();
283+
_p.trigger( 'setCurHighlight', [ this ] );
284+
});
285+
286+
_p.on( 'setCurHighlight', function( _evt, _src ){
287+
_src = $( _src );
288+
if( !( _src && _src.length ) ) return;
289+
_p._model.lastHighlightItem() && _p._model.lastHighlightItem().removeClass( _p._model.highlightClass() );
290+
_src.addClass( _p._model.highlightClass() );
291+
_p._model.lastHighlightItem( _src );
292+
293+
});
294+
295+
JWIN.on( 'scroll', function( _evt ){
296+
if( JC.f.ts() - _clickTs < 200 ) return;
297+
var _st = JDOC.scrollTop(), _curItem;
298+
_p._model.highlightTrigger().each( function(){
299+
var _src = $( this )
300+
, _anchorName = _src.attr( 'href' ).replace( /^\#/, '' )
301+
, _anchor
302+
, _anchorOffset
303+
;
304+
if( !_anchorName ) return;
305+
_anchor = $( JC.f.printf( 'a[name={0}]', _anchorName ) ).first();
306+
if( !_anchor.length ) return;
307+
_anchorOffset = _p._model.anchorOffset( _anchor );
308+
309+
if( _anchorOffset.top > _st ){
310+
_curItem = _src;
311+
return false;
312+
}
313+
});
314+
if( _curItem ){
315+
//JC.log( '_curItem', _curItem.attr( 'name' ) );
316+
_p.trigger( 'setCurHighlight', [ _curItem ] );
317+
}
318+
});
319+
320+
}
261321
}
262322

263323
, _inited:
@@ -280,6 +340,41 @@
280340
return this._gid;
281341
}
282342

343+
, lastHighlightItem:
344+
function( _setter ){
345+
_setter && ( this._lastHighlightItem = _setter );
346+
return this._lastHighlightItem;
347+
}
348+
349+
, highlightTrigger:
350+
function(){
351+
return this.selectorProp( 'data-highlightTrigger' );
352+
}
353+
354+
, highlightClass:
355+
function(){
356+
return this.attrProp( 'data-highlightClass' ) || 'cur';
357+
}
358+
, anchorOffset:
359+
function( _a ){
360+
var _r = _a.offset(), _layout = this.highlightAnchorLayout( _a ), _tmp;
361+
362+
if( _layout && _layout.length ){
363+
_r = _layout.offset();
364+
_r.top += _layout.height();
365+
}
366+
367+
return _r;
368+
}
369+
, highlightAnchorLayout:
370+
function( _a ){
371+
var _r;
372+
if( this.is( '[data-highlightAnchorLayout]' ) ){
373+
_r = JC.f.parentSelector( _a, this.attrProp( 'data-highlightAnchorLayout' ) );
374+
}
375+
return _r;
376+
}
377+
283378
, defaultStyle:
284379
function(){
285380
var _r = {

comps/FChart/FChart.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ JC.use && !jQuery.event.special.mousewheel && JC.use( 'plugins.jquery.mousewheel
315315
, 'ndount': 'NDount'
316316

317317
, 'stack': 'Stack'
318+
, 'hstack': 'HStack'
318319

319320
, 'rate': 'Rate'
320321
};

comps/FChart/swf/HStack.swf

71.1 KB
Binary file not shown.

deploy/bizs/ActionLogic/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( __FILE__ ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/ChangeLogic/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/CommonModify/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/CustomColumn/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( __FILE__ ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/DMultiDate/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/DisableLogic/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/DropdownTree/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( __FILE__ ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/FormLogic/FormLogic.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/bizs/FormLogic/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/InputSelect/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/InputSelect/res/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname(__FILE__) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/KillISPCache/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/MoneyTips/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/MultiDate/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/MultiSelect/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/bizs/MultiUpload/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname(__FILE__) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/comps/AjaxTree/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/comps/AjaxUpload/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/comps/AjaxUpload/res/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname(__FILE__) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/comps/AutoChecked/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname(__FILE__) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

deploy/comps/AutoComplete/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( __FILE__ ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
include_once dirname( dirname( dirname( dirname( dirname(__FILE__) ) ) ) ) . '/tools/php/lsdir.php';
3+
listFolderFiles('.');
4+
?>

0 commit comments

Comments
 (0)