芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/www/cepali/mod/quiz/amd/build/add_random_form.min.js
define(["jquery","mod_quiz/random_question_form_preview"],function(a,b){var c=2e3,d={PREVIEW_CONTAINER:'[data-region="random-question-preview-container"]',CATEGORY_FORM_ELEMENT:'[name="category"]',SUBCATEGORY_FORM_ELEMENT:'[name="includesubcategories"]',TAG_IDS_FORM_ELEMENT:'[name="fromtags[]"]'},e=function(a){return a.find(d.CATEGORY_FORM_ELEMENT).val()},f=function(a){var b=e(a),c=b.split(",");return c[0]},g=function(a,b){var c=e(a);return b.indexOf(c)>-1},h=function(a,b){return!!g(a,b)||a.find(d.SUBCATEGORY_FORM_ELEMENT).is(":checked")},i=function(a){var b=a.find(d.TAG_IDS_FORM_ELEMENT).val();return b.map(function(a){var b=a.split(",");return b[0]})},j=function(a,c,e){var g=a.find(d.PREVIEW_CONTAINER);b.reload(g,f(a),h(a,e),i(a),c)},k=function(a){return a.closest(d.CATEGORY_FORM_ELEMENT).length>0||(a.closest(d.SUBCATEGORY_FORM_ELEMENT).length>0||a.closest(d.TAG_IDS_FORM_ELEMENT).length>0)},l=function(d,e,f){var g=null;d.on("change",function(h){k(a(h.target))&&(b.showLoadingIcon(d),g&&clearTimeout(g),g=setTimeout(function(){j(d,e,f)},c))})},m=function(b,c,d,e){if(1==e){var f=a("#"+b);j(f,c,d,e),l(f,c,d,e)}};return{init:m}});