//-Created by zhuyan6 on 16/5/5.
//- __uiWidgetBeDone__ 全局去重标识，同一js环境下加载的全局性
//- __classHashId__ 全局hash值,为递增值，全局唯一
- if(document){
- if(!document.widget){
-  document.widget={num:0};
- }
-}
-if (!__uiWidgetBeDone__)
   - __classHashId__= 'classHashId_000'+'_'+Number(Boolean(__uiWidgetBeDone__))
   - __uiWidgetBeDone__ = true;
   //- __loadedBeDone__={'window':window.onload};
   - __loadedBeDone__={};

   //-/**/递增hash算法 用来确定class的唯一性
   mixin hashHCode(data)
      - if(document)document.widget.num++;
      - var hash = 0;
      - if(data.constructor.name == "Object") {
         - var str = data.str;
         - if (str&&str.length > 0) {
            -  for (i = 0; i < str.length; i++){
               - char = str.charCodeAt(i);
               - hash += char;//- 简单hash
            - }
         - }
      - }
      - else if(data.str) {
            - hash = str;
      - }
      //- data.str = hash+(parseInt(Math.random()*100));
      - data.str = hash+(parseInt(Math.random()*100))+'_'+parseInt(document.widget.num);

   //-/**/递增hash 用来确定class的唯一性,classHashId_+hashcode+百位随机数
   mixin createHashId()
      - var hashd = {str:String(new Date().getTime())};
      +hashHCode(hashd)
      //- if(__classHashId__)
         //- __classHashId__ = __classHashId__.split('_')[0] +'_'+hashd.str+'_'+__classHashId__.split('_')[2]
      //- else
      - __classHashId__ = 'classHashId_'+hashd.str+'_'+Number(Boolean(__uiWidgetBeDone__))

   mixin documentReady(callback)
      -    if (document.addEventListener) {
      -      document.addEventListener('DOMContentLoaded', function () {
      -           callback&&callback();
      -     }, false)
      -    }else if (document.attachEvent) {
      -       document.attachEvent('onreadytstatechange', function () {
      -          if (document.readyState == "complete") {
      -             document.detachEvent("onreadystatechange", arguments.callee);
      -           callback&&callback();
      -       }
      -       })
      -    }else if (document.lastChild == document.body) {
      -       callback&&callback();
      -    }

   mixin windowReady()
      - window.onload = function() {
      -     for(var i in window.__loadedBeDone__){
      -        var fun = window.__loadedBeDone__[i];
      -        if(typeof callback == 'function') {
      -            fun();
      -        }
      -  }
      -}

   mixin windowAddFun(key,callback)
      -   if(callback){
      -        var _fun_ = callback;
      -        if(typeof callback == 'function') {
      -            window.__loadedBeDone__[key]=_fun_;
      -        }
      -   }


   //-+windowReady()
   mixin nextTick(callback)
      - setTimeout(function(){
      -     var _fun_ = callback;
      -     if(typeof _fun_ == 'function') {
      -           _fun_();
      -     }
      - },0)

   include ./button
   include ./radio
   include ./select
   include ./checkBox
   include ./input



