改了改 jquery.kc.js 文件

3 views
Skip to first unread message

kindy

unread,
Mar 11, 2009, 5:04:54 AM3/11/09
to Kin...@googlegroups.com
主要是看到很多 css 操作都分开进行的,就给合并了一下。
另,能不能申请 gcode 的 cm 权限呢?

这里是 diff

2c2
< $(document).ready(function(){
---
> jQuery(function($){
3a4,5
> var body = $(document.body),
> head = $('head');
5,6c7,13
< $('html').width($(this).width()<800?800:$(this).width());
< $(window).resize(function(){$('html').width($(this).width()<800?800:$(this).width())});
---
> if($.borswer.ie && $.borswer.version<'7'){
> $(window).resize(function(){
> body.css('width', body.width() < 800 ? '800px', '');
> }).resize();
> }else{
> body.css('min-width', '800px');
> }
9c16
< $('head').append($.kc_style());
---
> head.append($.kc_style());
11c18
< $('body').append('<div id="k_ajax" class="none"></div>');
---
> body.append('<div id="k_ajax" class="none"></div>');
21,25c28,36
< $('.k_menu>li').click(function(){$('.k_menu>li>ul').hide();$(this).children('ul').show();
< $('.k_menu>li').bind('mouseover',function(){$('.k_menu>li>ul').hide();$(this).children('ul').show()});
< });
< $('.k_menu>li>a').blur(function(){$('.k_menu>li>ul').fadeOut();$('.k_menu>li').unbind('mouseover');});
< $('.k_menu>li>ul>li').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});
---
> $('.k_menu>li').click(function(){
> $('>li>ul',this.parentNode).hide();$(this).children('ul').show();
> $('.k_menu>li').bind('mouseover',function(){
> $('>li>ul',this.parentNode).hide();
> $(this).children('ul').show();
> });
> })
> .find('>a').blur(function(){$('>li',this.parentNode.parentNode).unbind('mouseover').find('>ul').fadeOut();}).end()
> .find('>ul>li').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});
30d40
<
34c44,46
<
---
> $.fn.reset_href=function(h){
> return this.attr('href',h===undefined ? 'javascript:;' : h);
> },
43,45c55,57
< $(pre+'.k_ajax').click(function(){$.kc_ajax($(this).attr('rel'))});
< $(pre+'.k_goto').click(function(){$.kc_goto($(this).attr('rel'))});
< $(pre+'a.k_ajax,a.k_help,a.k_setvalue,a.k_updown').attr('href','javascript:;');//重置k_ajax链接为空->javascript:;
---
> $(pre+'.k_ajax').reset_href().click(function(){$.kc_ajax($(this).attr('rel'))});
> $(pre+'.k_goto').reset_href().click(function(){$.kc_goto($(this).attr('rel'))});
> //$(pre+'a.k_ajax,a.k_help,a.k_setvalue,a.k_updown').attr('href','javascript:;');//重置k_ajax链接为空->javascript:;
49c61
< this.checked==true?
$('#'+this.id).attr('checked',false):$('#'+this.id).attr('checked',true)})});
---
> this.checked==!this.checked})});
51c63
< $(pre+'.k_setvalue').click(function(){$.kc_setvalue_click(this)}).blur(function(){$('#k_setvalue_Fly').fadeOut(300)});
---
> $(pre+'.k_setvalue').reset_href().click(function(){$.kc_setvalue_click(this)}).blur(function(){$('#k_setvalue_Fly').fadeOut(300)});
53c65
< $(pre+'.k_updown').click(function(){$.kc_updown_click(this)}).blur(function(){$('#k_updown_Fly').fadeOut(300)});
---
> $(pre+'.k_updown').reset_href().click(function(){$.kc_updown_click(this)}).blur(function(){$('#k_updown_Fly').fadeOut(300)});
65c77
< $(pre+"*[class^='k_user_']").attr('href','javascript:;').click(function(){$.kc_user_action(this,pre)});
---
> $(pre+"*[class^='k_user_']").reset_href().click(function(){$.kc_user_action(this,pre)});
67c79
< $('#k_ajax .k_close').attr('href','javascript:;').click(function(){
---
> $('#k_ajax .k_close').reset_href().click(function(){
76c88,89
< $.kc_ajax('{URL:\''+$.kc_root()+'system/verify.php\',ID:\''+id+'_Fly\',CMD:\'salt\'}');
---
> //$.kc_ajax('{URL:\''+$.kc_root()+'system/verify.php\',ID:\''+id+'_Fly\',CMD:\'salt\'}');
> $.kc_ajax({URL:$.kc_root()+'system/verify.php',ID:id+'_Fly',CMD:'salt'});
122c135
< }
---
> }//parseInt(str, 10) || 0 第二个参数是进制,|| 0 是为了防止 NaN
128c141,142
< $.kc_ajax('{URL:\''+$.kc_root()+'user/index.php\',METHOD:\'GET\',CMD:\''+s.substr(7,s.length-7)+'\',IS:'+(pre==''?0:1)+'}');
---
> //$.kc_ajax('{URL:\''+$.kc_root()+'user/index.php\',METHOD:\'GET\',CMD:\''+s.substr(7,s.length-7)+'\',IS:'+(pre==''?0:1)+'}');
> $.kc_ajax({URL:$.kc_root()+'user/index.php',METHOD:'GET',CMD:s.substr(7,s.length-7),IS:(pre==''?0:1)});
191a206,208
> if($.kc_root.path){
> return $.kc_root.path;
> }
194c211,212
< return fp.substring(0,fp.length-22);
---
>
> return $.kc_root.path = fp.substring(0,fp.length-22);
198c216
< var rel=eval('('+Rel+')');//rel值
---
> var rel=(typeof Rel=='string') ? eval('('+Rel+')') : Rel;//rel值
206,217c224,228
< if (cmd.substr(0,6)=='delete'){
< if(!confirm($.kc_lang('delete'))){return false;}
< }
< if (cmd.substr(0,5)=='clear'){
< if(!confirm($.kc_lang('clear'))){return false;}
< }
< if (cmd.substr(0,5)=='close'){
< if(!confirm($.kc_lang('close'))){return false;}
< }
< if (cmd=='logout'){
< if(!confirm($.kc_lang('logout'))){return false;}
< }
---
> var t_ = cmd.match(/^(delete|clear|close|logout)/);
> if(t_ && !confirm($.kc_lang(t_[0]))){
> return false;
> }
>
251,252c262,266
< $('#k_ajaxFly').css('position','absolute').css('top',document.documentElement.scrollTop)
< .css('left',$(document).width()-$('#k_ajaxFly').width()-$.kc_border($('#k_ajaxFly')));
---
> $('#k_ajaxFly').css({
> 'position':'absolute',
> 'top':document.documentElement.scrollTop,
> 'left',$(document).width()-$('#k_ajaxFly').width()-$.kc_border($('#k_ajaxFly'))
> });
333,335c347,352
< $('#k_ajaxBg').width(w+30).height(h+30)
< .css('top',document.documentElement.scrollTop)
< .css('left',document.documentElement.scrollLeft);
---
> $('#k_ajaxBg').css({
> 'top':document.documentElement.scrollTop,
> 'width':w+30,
> 'height':h+30,
> 'left':document.documentElement.scrollLeft
> });
338c355
< $('#k_ajaxMain').width(width).height(height);
---
> $('#k_ajaxMain').css({width:width,height:height});
343,345c360,367
< $('#k_ajaxBox').width(width).height(nHeight).css('left',document.documentElement.scrollLeft+(w-width)/2)
< .css('zindex','901').css('position','absolute').css('top',document.documentElement.scrollTop+((h-nHeight)/2));
<
---
> $('#k_ajaxBox').).css({
> 'left':document.documentElement.scrollLeft+(w-width)/2,
> 'width':width,
> 'height':nHeight,
> 'zindex':'901',
> 'position':'absolute',
> 'top':document.documentElement.scrollTop+((h-nHeight)/2)
> });
737c759,760
< $.kc_ajax('{URL:\'../system/manage.php\',CMD:\'lnkmove\',id:\''+kid+'\',left:'+left+',top:'+top+',IS:1}');
---
> //$.kc_ajax('{URL:\'../system/manage.php\',CMD:\'lnkmove\',id:\''+kid+'\',left:'+left+',top:'+top+',IS:1}');
> $.kc_ajax({URL:'../system/manage.php',CMD:'lnkmove',id:kid,left:left,top:top,IS:1});
746c769,770
< $.kc_ajax('{URL:\'../system/manage.php\',CMD:\'lnkmove\',id:\''+kid+'\',left:'+left+',top:'+top+',IS:1}');
---
> //$.kc_ajax('{URL:\'../system/manage.php\',CMD:\'lnkmove\',id:\''+kid+'\',left:'+left+',top:'+top+',IS:1}');
> $.kc_ajax({URL:'../system/manage.php',CMD:'lnkmove',id:kid,left:left,top:top,IS:1});

jquery.kc.js

Sin.CS

unread,
Mar 11, 2009, 11:42:35 PM3/11/09
to KingCMS 开发者论坛, kindy
修改了很多不足,不错。已经加到ProjectMember里了,你可以直接用SVN提交更新这个代码及其他代码。
需要注意的是,修改代码的时候,最好写上修改注释。
Reply all
Reply to author
Forward
0 new messages