| 1 | | Object.extend(rubricks.system.admin_block,{_ajax_history_prefix:"rubricks_system_admin_block_select",SortableBlocks:Class.create(),add_ajax_history:function(_1){ |
|---|
| 2 | | if(AjaxHistoryPageManager.getSpecifiedValue(this._ajax_history_prefix)==_1){ |
|---|
| 3 | | this.show_page_info(_1); |
|---|
| 4 | | }else{ |
|---|
| 5 | | AjaxHistory.add(_1,{prefix:this._ajax_history_prefix}); |
|---|
| 6 | | } |
|---|
| 7 | | },add_block:function(id){ |
|---|
| 8 | | var _3=$("rubricks_block_add_row_"+id); |
|---|
| 9 | | if(_3){ |
|---|
| 10 | | _3.remove(); |
|---|
| 11 | | } |
|---|
| 12 | | var _4=this.addable_block_jsons.detect(function(b){ |
|---|
| 13 | | return b.id==id; |
|---|
| 14 | | }); |
|---|
| 15 | | if(_4){ |
|---|
| 16 | | new Insertion.Bottom("edit_partition_center_center",new Template($("block_template").value).evaluate(_4)); |
|---|
| 17 | | this.addable_block_jsons=this.addable_block_jsons.reject(function(b){ |
|---|
| 18 | | return b==_4; |
|---|
| 19 | | }); |
|---|
| 20 | | } |
|---|
| 21 | | if($("edit_addable_blocks").rows.length==0){ |
|---|
| 22 | | $("no_addable_block_msg").show(); |
|---|
| 23 | | $("edit_addable_blocks_area").innerHTML=""; |
|---|
| 24 | | } |
|---|
| 25 | | },addable_blocks_window_close:function(){ |
|---|
| 26 | | this.addable_blocks_window.close(); |
|---|
| 27 | | SpinelzUtil._redrawForIE("block_management_area"); |
|---|
| 28 | | },addable_blocks_window_open:function(){ |
|---|
| 29 | | this.render_addable_block_table(); |
|---|
| 30 | | this.addable_blocks_window.center(); |
|---|
| 31 | | this.addable_blocks_window.open(); |
|---|
| 32 | | SpinelzUtil._redrawForIE("block_management_area"); |
|---|
| 33 | | },become_edit_mode:function(){ |
|---|
| 34 | | this.sortable_blocks.sortable(); |
|---|
| 35 | | rubricks.common.FormEditor.editMode("block_management_area"); |
|---|
| 36 | | this.addable_block_jsons=this.addable_block_jsons_org.map(Prototype.K); |
|---|
| 37 | | },become_read_mode:function(){ |
|---|
| 38 | | rubricks.common.FormEditor.readMode("block_management_area"); |
|---|
| 39 | | this.sortable_blocks.unsortable(); |
|---|
| 40 | | this.addable_blocks_window.close(); |
|---|
| 41 | | },block_edit:function(){ |
|---|
| 42 | | var _7=$("block_edit_id").value; |
|---|
| 43 | | $("rubricks_block_title_"+_7).innerHTML=$("block_edit_title").value.escapeHTML(); |
|---|
| 44 | | this.block_edit_window_close(); |
|---|
| 45 | | },block_edit_window_close:function(){ |
|---|
| 46 | | this.block_edit_window.close(); |
|---|
| 47 | | },detail_area_hide:function(){ |
|---|
| 48 | | Element.hide("rubricks_page_info"); |
|---|
| 49 | | Element.show("rubricks_page_empty_message"); |
|---|
| 50 | | },detail_area_show:function(){ |
|---|
| 51 | | Element.hide("rubricks_page_empty_message"); |
|---|
| 52 | | Element.show("rubricks_page_info"); |
|---|
| 53 | | },page_update:function(_8){ |
|---|
| 54 | | var _9=[]; |
|---|
| 55 | | var _a=this.sortable_blocks.serialize(_9); |
|---|
| 56 | | _a.edit_addable_blocks=this.addable_block_jsons.map(function(_b){ |
|---|
| 57 | | var _c=_b.title.stripMB().unescapeHTML(); |
|---|
| 58 | | if(_c&&(0<_c.length)&&(_c.length<=32)){ |
|---|
| 59 | | return [_b.id,_c]; |
|---|
| 60 | | }else{ |
|---|
| 61 | | _9.push([_b.id,_c]); |
|---|
| 62 | | } |
|---|
| 63 | | }); |
|---|
| 64 | | if(_9.length==0){ |
|---|
| 65 | | new Ajax.Request(rubricks.system.admin_block.url_update,{asynchronous:true,evalScripts:true,parameters:{id:_8,page_update_data:JSON.stringify(_a)},onLoaded:function(_d){ |
|---|
| 66 | | rubricks.common.rubricks_wait_message_close(); |
|---|
| 67 | | },onLoading:function(_e){ |
|---|
| 68 | | rubricks.system.admin_block.become_read_mode(); |
|---|
| 69 | | rubricks.common.rubricks_wait_message_open(); |
|---|
| 70 | | }}); |
|---|
| 71 | | }else{ |
|---|
| 72 | | rubricks.common.rubricks_message_window_open(rubricks.system.admin_block.msg_invalid_title_length,"error"); |
|---|
| 73 | | } |
|---|
| 74 | | },render_addable_block_table:function(){ |
|---|
| 75 | | var _f=new Template($("addable_blocks_template").value); |
|---|
| 76 | | var _10="<table id=\"edit_addable_blocks\" class=\"rubricks_general_table\" style=\"table-layout:fixed;\">"+this.addable_block_jsons.map(function(_11){ |
|---|
| 77 | | return _f.evaluate(_11); |
|---|
| 78 | | }).join("")+"</table>"; |
|---|
| 79 | | $("edit_addable_blocks_area").innerHTML=_10; |
|---|
| 80 | | rubricks.common.Rollover.swap_range("edit_addable_blocks"); |
|---|
| 81 | | if(this.addable_block_jsons.length==0){ |
|---|
| 82 | | $("no_addable_block_msg").show(); |
|---|
| 83 | | }else{ |
|---|
| 84 | | $("no_addable_block_msg").hide(); |
|---|
| 85 | | } |
|---|
| 86 | | },remove_block:function(id){ |
|---|
| 87 | | var _13=$("rubricks_block_"+id); |
|---|
| 88 | | if(_13){ |
|---|
| 89 | | var _14=$("rubricks_block_title_"+id).value.stripMB().unescapeHTML(); |
|---|
| 90 | | if(_14&&(0<_14.length)&&(_14.length<=32)){ |
|---|
| 91 | | if(this.addable_block_jsons.all(function(_15){ |
|---|
| 92 | | return _15.id!=id; |
|---|
| 93 | | })){ |
|---|
| 94 | | this.addable_block_jsons.push({id:id,title:$("rubricks_block_title_"+id).value.escapeHTML().replace(/"/g,""")}); |
|---|
| 95 | | } |
|---|
| 96 | | _13.remove(); |
|---|
| 97 | | }else{ |
|---|
| 98 | | rubricks.common.rubricks_message_window_open(rubricks.system.admin_block.msg_invalid_title_length,"error"); |
|---|
| 99 | | } |
|---|
| 100 | | } |
|---|
| 101 | | },show_page_info:function(_16){ |
|---|
| 102 | | rubricks.system.admin_block.temp_hash=_16; |
|---|
| 103 | | rubricks.common.execute_if_loaded("admin_block_scripts",function(){ |
|---|
| 104 | | var _17=rubricks.system.admin_block.temp_hash; |
|---|
| 105 | | var _18=rubricks.system.admin_block.page_list.getSelected(); |
|---|
| 106 | | if(_18[0]!=_17){ |
|---|
| 107 | | rubricks.system.admin_block.page_list.selectEffect(rubricks.system.admin_block.page_list.buildTrId(_17)); |
|---|
| 108 | | } |
|---|
| 109 | | if(_17.length>0){ |
|---|
| 110 | | new Ajax.Updater("rubricks_page_info",rubricks.system.admin_block.url_show,{asynchronous:true,evalScripts:true,parameters:{id:_17},onLoaded:function(_19){ |
|---|
| 111 | | rubricks.common.rubricks_wait_message_close(); |
|---|
| 112 | | },onLoading:function(_1a){ |
|---|
| 113 | | rubricks.common.rubricks_wait_message_open(); |
|---|
| 114 | | }}); |
|---|
| 115 | | }else{ |
|---|
| 116 | | rubricks.system.admin_block.detail_area_hide(); |
|---|
| 117 | | } |
|---|
| 118 | | }); |
|---|
| 119 | | }}); |
|---|
| 120 | | rubricks.system.admin_block.SortableBlocks.prototype={initialize:function(_1b){ |
|---|
| 121 | | this.target_id_list=_1b; |
|---|
| 122 | | this.record_initial_data(); |
|---|
| 123 | | this.unsortable(); |
|---|
| 124 | | },record_initial_data:function(){ |
|---|
| 125 | | var _1c=this.target_id_list; |
|---|
| 126 | | $A(this.target_id_list).each(function(_1d){ |
|---|
| 127 | | this[_1d]=$(_1d).innerHTML; |
|---|
| 128 | | }); |
|---|
| 129 | | },serialize:function(_1e){ |
|---|
| 130 | | var _1f=new Object(); |
|---|
| 131 | | _1f[$A(this.target_id_list)[0]]=this.serialize_partition($A(this.target_id_list)[0],_1e); |
|---|
| 132 | | _1f[$A(this.target_id_list)[1]]=this.serialize_partition($A(this.target_id_list)[1],_1e); |
|---|
| 133 | | _1f[$A(this.target_id_list)[2]]=this.serialize_partition($A(this.target_id_list)[2],_1e); |
|---|
| 134 | | _1f[$A(this.target_id_list)[3]]=this.serialize_partition($A(this.target_id_list)[3],_1e); |
|---|
| 135 | | _1f[$A(this.target_id_list)[4]]=this.serialize_partition($A(this.target_id_list)[4],_1e); |
|---|
| 136 | | return _1f; |
|---|
| 137 | | },serialize_partition:function(_20,_21){ |
|---|
| 138 | | var _22; |
|---|
| 139 | | var _23=new Array(); |
|---|
| 140 | | $A($(_20).getElementsByTagName("ul")).each(function(_24){ |
|---|
| 141 | | _22=new Array(); |
|---|
| 142 | | _22.push(_24.id.split("_")[2]); |
|---|
| 143 | | var _25=$("rubricks_block_title_"+_22[0]).value.stripMB(); |
|---|
| 144 | | if(_25&&(0<_25.length)&&(_25.length<=32)){ |
|---|
| 145 | | _22.push(_25); |
|---|
| 146 | | _23.push(_22); |
|---|
| 147 | | }else{ |
|---|
| 148 | | _21.push([_24.id,_25]); |
|---|
| 149 | | } |
|---|
| 150 | | }); |
|---|
| 151 | | return _23; |
|---|
| 152 | | },sortable:function(){ |
|---|
| 153 | | var _26=this.target_id_list; |
|---|
| 154 | | $A(this.target_id_list).each(function(_27){ |
|---|
| 155 | | this._create_sortable(_27,_26); |
|---|
| 156 | | rubricks.common.Rollover.swap_range(_27); |
|---|
| 157 | | }.bind(this)); |
|---|
| 158 | | },unsortable:function(){ |
|---|
| 159 | | var _28=this.target_id_list; |
|---|
| 160 | | $A(this.target_id_list).each(function(_29){ |
|---|
| 161 | | Sortable.destroy(_29); |
|---|
| 162 | | $(_29).innerHTML=this[_29]; |
|---|
| 163 | | }); |
|---|
| 164 | | },refresh_sortable:function(){ |
|---|
| 165 | | var _2a=this.target_id_list; |
|---|
| 166 | | _2a.each(function(_2b){ |
|---|
| 167 | | Sortable.destroy(_2b); |
|---|
| 168 | | this._create_sortable(_2b,_2a); |
|---|
| 169 | | }.bind(this)); |
|---|
| 170 | | },_create_sortable:function(_2c,_2d){ |
|---|
| 171 | | SortableEx.create(_2c,{constraint:false,containment:_2d,dropOnEmpty:true,tag:"ul",selector:"admin_block_drag_selector"}); |
|---|
| 172 | | }}; |
|---|
| 173 | | AjaxHistory.addCallback(function(_2e){ |
|---|
| 174 | | rubricks.system.admin_block.show_page_info(_2e); |
|---|
| 175 | | },rubricks.system.admin_block._ajax_history_prefix); |
|---|
| | 1 | Object.extend(rubricks.system.calendar,{changeDisplayType:function(_1){ |
|---|
| | 2 | this.calendarDetail.changeDisplayType(_1); |
|---|
| | 3 | this.changeButtons(_1); |
|---|
| | 4 | },changeButtons:function(_2){ |
|---|
| | 5 | if(_2=="day"){ |
|---|
| | 6 | this.enableButton("calendar_month_button"); |
|---|
| | 7 | this.enableButton("calendar_week_button"); |
|---|
| | 8 | this.disableButton("calendar_day_button"); |
|---|
| | 9 | }else{ |
|---|
| | 10 | if(_2=="week"){ |
|---|
| | 11 | this.enableButton("calendar_month_button"); |
|---|
| | 12 | this.disableButton("calendar_week_button"); |
|---|
| | 13 | this.enableButton("calendar_day_button"); |
|---|
| | 14 | }else{ |
|---|
| | 15 | this.disableButton("calendar_month_button"); |
|---|
| | 16 | this.enableButton("calendar_week_button"); |
|---|
| | 17 | this.enableButton("calendar_day_button"); |
|---|
| | 18 | } |
|---|
| | 19 | } |
|---|
| | 20 | this.enableShowDayOfWeekButton(); |
|---|
| | 21 | },enableButton:function(_3){ |
|---|
| | 22 | Element.hide(_3.appendSuffix("disabled")); |
|---|
| | 23 | Element.show(_3); |
|---|
| | 24 | },disableButton:function(_4){ |
|---|
| | 25 | Element.show(_4.appendSuffix("disabled")); |
|---|
| | 26 | Element.hide(_4); |
|---|
| | 27 | },showDayOfWeek:function(){ |
|---|
| | 28 | if(this.calendarDetail.options.displayIndexes.length==7){ |
|---|
| | 29 | this.calendarDetail.hideDayOfWeek([0,6]); |
|---|
| | 30 | }else{ |
|---|
| | 31 | this.calendarDetail.showDayOfWeek([0,6]); |
|---|
| | 32 | } |
|---|
| | 33 | this.enableShowDayOfWeekButton(); |
|---|
| | 34 | },enableShowDayOfWeekButton:function(){ |
|---|
| | 35 | if(this.calendarDetail.options.displayType=="day"){ |
|---|
| | 36 | $("calendar_show_sat_sun").hide(); |
|---|
| | 37 | $("calendar_hide_sat_sun").hide(); |
|---|
| | 38 | }else{ |
|---|
| | 39 | if(this.calendarDetail.options.displayIndexes.length==7){ |
|---|
| | 40 | $("calendar_show_sat_sun").hide(); |
|---|
| | 41 | $("calendar_hide_sat_sun").show(); |
|---|
| | 42 | }else{ |
|---|
| | 43 | $("calendar_show_sat_sun").show(); |
|---|
| | 44 | $("calendar_hide_sat_sun").hide(); |
|---|
| | 45 | } |
|---|
| | 46 | } |
|---|
| | 47 | },delete_schedule:function(_5){ |
|---|
| | 48 | new Ajax.Request(this.url_delete_schedule,{asynchronous:true,evalScripts:true,parameters:{adapter_id:_5.adapter,schedule_sid:_5.sid,schedule_id:_5.id},onLoaded:function(_6){ |
|---|
| | 49 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 50 | },onLoading:function(_7){ |
|---|
| | 51 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 52 | }}); |
|---|
| | 53 | }}); |
|---|
| 219 | | Object.extend(rubricks.system.admin_config,{SortableToolbar:Class.create(),all_tab_read_mode:function(){ |
|---|
| 220 | | this.arr_formeditor_area.each(function(el){ |
|---|
| 221 | | el=$(el); |
|---|
| | 97 | Object.extend(rubricks.system.admin_theme,{_ajax_history_prefix:"rubricks_system_admin_theme_select",add_ajax_history:function(_1){ |
|---|
| | 98 | if(AjaxHistoryPageManager.getSpecifiedValue(this._ajax_history_prefix)==_1){ |
|---|
| | 99 | this.show_theme_info(_1); |
|---|
| | 100 | }else{ |
|---|
| | 101 | AjaxHistory.add(_1,{prefix:this._ajax_history_prefix}); |
|---|
| | 102 | } |
|---|
| | 103 | },clear_rubricks_theme_info:function(){ |
|---|
| | 104 | $("rubricks_theme_info").innerHTML=this.msg_theme_not_selected; |
|---|
| | 105 | },detail_area_hide:function(){ |
|---|
| | 106 | Element.hide("rubricks_theme_info"); |
|---|
| | 107 | Element.show("rubricks_theme_empty_message"); |
|---|
| | 108 | },detail_area_show:function(){ |
|---|
| | 109 | Element.hide("rubricks_theme_empty_message"); |
|---|
| | 110 | Element.show("rubricks_theme_info"); |
|---|
| | 111 | },open_theme_install_window:function(){ |
|---|
| | 112 | this.theme_install_window.center(); |
|---|
| | 113 | this.theme_install_window.open(); |
|---|
| | 114 | },refresh_install_window:function(){ |
|---|
| | 115 | new Ajax.Updater("admin_theme_install",this.url_install_window,{asynchronous:true,evalScripts:true}); |
|---|
| | 116 | },refresh_theme_list:function(){ |
|---|
| | 117 | this.select_singular_mode(); |
|---|
| | 118 | new Ajax.Updater("rubricks_theme_list_frame",this.url_list,{asynchronous:true,evalScripts:true}); |
|---|
| | 119 | },select_multiple_mode:function(){ |
|---|
| | 120 | this.rubricks_theme_list.makeMultiple(); |
|---|
| | 121 | Element.hide("select_multiple_form"); |
|---|
| | 122 | Element.show("select_singular_form"); |
|---|
| | 123 | Element.show("theme_uninstall_multiple_form"); |
|---|
| | 124 | },select_singular_mode:function(){ |
|---|
| | 125 | this.rubricks_theme_list.makeSingular(); |
|---|
| | 126 | Element.hide("theme_uninstall_multiple_form"); |
|---|
| | 127 | Element.hide("select_singular_form"); |
|---|
| | 128 | Element.show("select_multiple_form"); |
|---|
| | 129 | },show_theme_info:function(_2){ |
|---|
| | 130 | rubricks.system.admin_theme.temp_hash=_2; |
|---|
| | 131 | rubricks.common.execute_if_loaded("admin_theme_scripts",function(){ |
|---|
| | 132 | var _3=rubricks.system.admin_theme.temp_hash; |
|---|
| | 133 | var _4=rubricks.system.admin_theme.rubricks_theme_list.getSelected(); |
|---|
| | 134 | if(_4[0]!=_3){ |
|---|
| | 135 | rubricks.system.admin_theme.rubricks_theme_list.selectEffect(rubricks.system.admin_theme.rubricks_theme_list.buildTrId(_3)); |
|---|
| | 136 | } |
|---|
| | 137 | if(_3.length>0){ |
|---|
| | 138 | new Ajax.Updater("rubricks_theme_info",rubricks.system.admin_theme.url_show,{asynchronous:true,evalScripts:true,parameters:{id:_3},onLoaded:function(_5){ |
|---|
| | 139 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 140 | },onLoading:function(_6){ |
|---|
| | 141 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 142 | }}); |
|---|
| | 143 | }else{ |
|---|
| | 144 | rubricks.system.admin_theme.detail_area_hide(); |
|---|
| | 145 | } |
|---|
| | 146 | }); |
|---|
| | 147 | },theme_uninstall:function(_7){ |
|---|
| | 148 | new Ajax.Request(this.url_uninstall,{asynchronous:true,evalScripts:true,parameters:{uninstall_id:_7},onLoaded:function(_8){ |
|---|
| | 149 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 150 | },onLoading:function(_9){ |
|---|
| | 151 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 152 | }}); |
|---|
| | 153 | },theme_uninstall_multiple:function(){ |
|---|
| | 154 | this.target_theme_id_str=this.rubricks_theme_list.getSelected().join(","); |
|---|
| | 155 | if(this.target_theme_id_str.length==0){ |
|---|
| | 156 | rubricks.common.rubricks_message_window_open(this.msg_theme_not_selected,"error"); |
|---|
| | 157 | }else{ |
|---|
| | 158 | rubricks.common.rubricks_confirm_window_open(this.msg_uninstall_confirm,function(){ |
|---|
| | 159 | this.theme_uninstall(this.target_theme_id_str); |
|---|
| | 160 | }.bind(this)); |
|---|
| | 161 | } |
|---|
| | 162 | },theme_update:function(_a){ |
|---|
| | 163 | new Ajax.Request(this.url_update,{asynchronous:true,evalScripts:true,parameters:{id:_a},onLoaded:function(_b){ |
|---|
| | 164 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 165 | },onLoading:function(_c){ |
|---|
| | 166 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 167 | }}); |
|---|
| | 168 | }}); |
|---|
| | 169 | AjaxHistory.addCallback(function(_d){ |
|---|
| | 170 | rubricks.system.admin_theme.show_theme_info(_d); |
|---|
| | 171 | },rubricks.system.admin_theme._ajax_history_prefix); |
|---|
| | 172 | |
|---|
| | 173 | Object.extend(rubricks.system.admin_user.functions,{activate_tab:function(_1){ |
|---|
| | 174 | var _2=rubricks.system.admin_user.variables; |
|---|
| | 175 | _2.list_tab_box.selectTab(_2.list_tab_box.tabs[_2.arr_tab_number[_1]]); |
|---|
| | 176 | },clear_search_conditions:function(){ |
|---|
| | 177 | $A(["filter_conditions_user_key","filter_conditions_user_sequence","filter_conditions_user_type","filter_conditions_user_match"]).each(function(_3){ |
|---|
| | 178 | var _4=$(_3); |
|---|
| | 179 | if(_4){ |
|---|
| | 180 | _4.selectedIndex=0; |
|---|
| | 181 | } |
|---|
| | 182 | }); |
|---|
| | 183 | $("filter_conditions_user_word").value=""; |
|---|
| | 184 | rubricks.common.fire_onsubmit("user_filter_form"); |
|---|
| | 185 | },detail_area_hide:function(){ |
|---|
| | 186 | Element.hide("user_management_detail"); |
|---|
| | 187 | Element.show("user_management_empty_message"); |
|---|
| | 188 | this.print_target_clear(); |
|---|
| | 189 | },detail_area_show:function(){ |
|---|
| | 190 | Element.hide("user_management_empty_message"); |
|---|
| | 191 | Element.show("user_management_detail"); |
|---|
| | 192 | },filter_blur:function(){ |
|---|
| | 193 | SelectableTableManager.start(); |
|---|
| | 194 | },filter_clear:function(){ |
|---|
| | 195 | if($("filter_conditions_user_word").value==rubricks.system.admin_user.variables.filter_default_query){ |
|---|
| | 196 | $("filter_conditions_user_word").value=""; |
|---|
| | 197 | } |
|---|
| | 198 | },filter_detail_mode:function(){ |
|---|
| | 199 | this.filter_clear(); |
|---|
| | 200 | Element.hide("rubricks_user_filter_detail_mode_button"); |
|---|
| | 201 | Element.show("rubricks_user_filter_detail1"); |
|---|
| | 202 | Element.show("filter_conditions_user_match"); |
|---|
| | 203 | },filter_focus:function(){ |
|---|
| | 204 | SelectableTableManager.stop(); |
|---|
| | 205 | this.filter_clear(); |
|---|
| | 206 | },group_create_form_clear:function(){ |
|---|
| | 207 | $("rubricks_group_parent_id").value=""; |
|---|
| | 208 | $("group_create_form").reset(); |
|---|
| | 209 | rubricks.common.Validator.refresh(); |
|---|
| | 210 | },group_create_window_close:function(){ |
|---|
| | 211 | rubricks.system.admin_user.variables.group_create_window.close(); |
|---|
| | 212 | },group_create_window_open:function(){ |
|---|
| | 213 | var _5=rubricks.system.admin_user.variables; |
|---|
| | 214 | if(_5.flg_group_create_window_loaded){ |
|---|
| | 215 | this.group_create_form_clear(); |
|---|
| | 216 | if(_5.group_tree){ |
|---|
| | 217 | if(_5.rubricks_group_tree){ |
|---|
| | 218 | if(_5.rubricks_group_tree.getHierarchyNumber()>=_5.group_grade_limit){ |
|---|
| | 219 | rubricks.common.rubricks_message_window_open(_5.msg_group_grade_limit,"error"); |
|---|
| | 220 | return false; |
|---|
| | 221 | }else{ |
|---|
| | 222 | if(_5.rubricks_group_tree.selected){ |
|---|
| | 223 | var _6=_5.rubricks_group_tree.selected.id.replace(/^rubricks_group_tree_group_/,""); |
|---|
| | 224 | $("rubricks_group_parent_id").value=_6; |
|---|
| | 225 | }else{ |
|---|
| | 226 | $("rubricks_group_parent_id").value=""; |
|---|
| | 227 | } |
|---|
| | 228 | } |
|---|
| | 229 | } |
|---|
| | 230 | }else{ |
|---|
| | 231 | var _7=_5.rubricks_group_list; |
|---|
| | 232 | if(_7){ |
|---|
| | 233 | if(_5.group_grade>=_5.group_grade_limit-1){ |
|---|
| | 234 | rubricks.common.rubricks_message_window_open(_5.msg_group_grade_limit,"error"); |
|---|
| | 235 | return false; |
|---|
| | 236 | }else{ |
|---|
| | 237 | if(_7.getSelected().length>0){ |
|---|
| | 238 | $("rubricks_group_parent_id").value=_7.getSelected(); |
|---|
| | 239 | }else{ |
|---|
| | 240 | $("rubricks_group_parent_id").value=_5.parent_group_id; |
|---|
| | 241 | } |
|---|
| | 242 | } |
|---|
| | 243 | } |
|---|
| | 244 | } |
|---|
| | 245 | _5.group_create_window.center(); |
|---|
| | 246 | _5.group_create_window.open(); |
|---|
| | 247 | $("rubricks_group_name").focus(); |
|---|
| | 248 | }else{ |
|---|
| | 249 | this.group_create_window_render(); |
|---|
| | 250 | } |
|---|
| | 251 | },group_create_window_render:function(){ |
|---|
| | 252 | new Ajax.Updater("group_create_window_contents",rubricks.system.admin_user.variables.url_group_create_window,{asynchronous:true,evalScripts:true,onLoading:function(_8){ |
|---|
| | 253 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 254 | }}); |
|---|
| | 255 | },group_delete:function(_9){ |
|---|
| | 256 | new Ajax.Request(rubricks.system.admin_user.variables.url_group_delete,{asynchronous:true,evalScripts:true,parameters:{delete_id:_9},onLoaded:function(_a){ |
|---|
| | 257 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 258 | },onLoading:function(_b){ |
|---|
| | 259 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 260 | }}); |
|---|
| | 261 | },group_edit_mode:function(){ |
|---|
| | 262 | rubricks.common.Validator.refresh(); |
|---|
| | 263 | rubricks.common.FormEditor.editMode("group_info_management_area"); |
|---|
| | 264 | },group_list_change_grade:function(_c,_d){ |
|---|
| | 265 | Event.stop(_c); |
|---|
| | 266 | this.refresh_group_list(_d,true); |
|---|
| | 267 | },group_permission_edit_mode:function(){ |
|---|
| | 268 | rubricks.common.FormEditor.editMode("group_permission_management_area"); |
|---|
| | 269 | },group_permission_read_mode:function(){ |
|---|
| | 270 | if($("group_permission_management_area")){ |
|---|
| | 271 | rubricks.common.FormEditor.readMode("group_permission_management_area","group_permission_edit_form"); |
|---|
| | 272 | } |
|---|
| | 273 | this.group_tab_activate(); |
|---|
| | 274 | },group_permission_save:function(){ |
|---|
| | 275 | rubricks.common.fire_onsubmit("group_permission_edit_form"); |
|---|
| | 276 | this.group_permission_read_mode(); |
|---|
| | 277 | },group_read_mode:function(){ |
|---|
| | 278 | if($("group_info_management_area")){ |
|---|
| | 279 | rubricks.common.FormEditor.readMode("group_info_management_area","group_edit_form"); |
|---|
| | 280 | } |
|---|
| | 281 | this.group_tab_activate(); |
|---|
| | 282 | },group_select_effect:function(_e){ |
|---|
| | 283 | var _f=rubricks.system.admin_user.variables; |
|---|
| | 284 | if(_f.group_tree){ |
|---|
| | 285 | _f.rubricks_group_tree.selectEffect("rubricks_group_tree_group_"+_e,{enableUnselected:false}); |
|---|
| | 286 | }else{ |
|---|
| | 287 | var _10=_f.rubricks_group_list; |
|---|
| | 288 | if(_10){ |
|---|
| | 289 | var _11=_10.getSelected(); |
|---|
| | 290 | if(_11[0]!=_e){ |
|---|
| | 291 | _10.unselectAll(); |
|---|
| | 292 | _10.selectEffect(_10.buildTrId(_e)); |
|---|
| | 293 | } |
|---|
| | 294 | } |
|---|
| | 295 | } |
|---|
| | 296 | },group_tab_activate:function(){ |
|---|
| | 297 | this.group_tab_activate_effect(); |
|---|
| | 298 | SelectableTableManager.activate("rubricks_group_list"); |
|---|
| | 299 | },group_tab_activate_effect:function(){ |
|---|
| | 300 | this.activate_tab(1); |
|---|
| | 301 | this.show_buttons([1]); |
|---|
| | 302 | },group_user_edit_window_close:function(){ |
|---|
| | 303 | this.group_tab_activate(); |
|---|
| | 304 | rubricks.system.admin_user.variables.group_user_edit_window.close(); |
|---|
| | 305 | },group_user_edit_window_open:function(){ |
|---|
| | 306 | var _12=rubricks.system.admin_user.variables; |
|---|
| | 307 | if(_12.flg_group_user_edit_window_loaded){ |
|---|
| | 308 | _12.group_user_edit_window.center(); |
|---|
| | 309 | _12.group_user_edit_window.open(); |
|---|
| | 310 | }else{ |
|---|
| | 311 | this.group_user_edit_window_render(); |
|---|
| | 312 | } |
|---|
| | 313 | },group_user_edit_window_render:function(){ |
|---|
| | 314 | var _13=rubricks.system.admin_user.variables; |
|---|
| | 315 | new Ajax.Updater("group_user_edit_window_contents",_13.url_group_user_edit_window,{asynchronous:true,evalScripts:true,parameters:{id:_13.target_group_id},onLoading:function(_14){ |
|---|
| | 316 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 317 | }}); |
|---|
| | 318 | },hide_buttons:function(){ |
|---|
| | 319 | rubricks.system.admin_user.variables.arr_operation_bar_button.each(function(_15){ |
|---|
| | 320 | if($(_15)){ |
|---|
| | 321 | Element.hide(_15); |
|---|
| | 322 | } |
|---|
| | 323 | }); |
|---|
| | 324 | },hide_list_operation_buttons:function(){ |
|---|
| | 325 | Element.hide("user_multiple_form"); |
|---|
| | 326 | Element.hide("user_singular_form"); |
|---|
| | 327 | Element.hide("user_invalidate_multiple_form"); |
|---|
| | 328 | },print_control:function(){ |
|---|
| | 329 | if(!Element.hasClassName("print_button","disabled")){ |
|---|
| | 330 | rubricks.common.fire_submit("operationbar_button_print"); |
|---|
| | 331 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 332 | } |
|---|
| | 333 | },print_list:function(){ |
|---|
| | 334 | rubricks.common.fire_submit("user_list_print_form"); |
|---|
| | 335 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 336 | },print_target_clear:function(){ |
|---|
| | 337 | $("user_management_print_target").value=""; |
|---|
| | 338 | $("user_management_print_id").value=""; |
|---|
| | 339 | $("user_management_print_page").value=""; |
|---|
| | 340 | if(!Element.hasClassName("print_button","disabled")){ |
|---|
| | 341 | Element.addClassName("print_button","disabled"); |
|---|
| | 342 | } |
|---|
| | 343 | },print_target_set:function(_16,id,_18){ |
|---|
| | 344 | $("user_management_print_target").value=_16; |
|---|
| | 345 | $("user_management_print_id").value=id; |
|---|
| | 346 | $("user_management_print_page").value=_18; |
|---|
| | 347 | Element.removeClassName("print_button","disabled"); |
|---|
| | 348 | },refocus_filter:function(){ |
|---|
| | 349 | var el=$("filter_conditions_user_word"); |
|---|
| 223 | | rubricks.common.FormEditor.readMode(el,null,{force:false}); |
|---|
| 224 | | } |
|---|
| 225 | | }); |
|---|
| 226 | | },button_hash:{1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:["operationbar_button_import","operationbar_button_initialize"]},change_tr:function(_2,_3){ |
|---|
| 227 | | _2.split(",").each(function(_4){ |
|---|
| 228 | | if(_3){ |
|---|
| 229 | | Element.show(_4); |
|---|
| 230 | | }else{ |
|---|
| 231 | | Element.hide(_4); |
|---|
| 232 | | } |
|---|
| 233 | | }); |
|---|
| 234 | | },check_switching:function(){ |
|---|
| 235 | | $A(this.switching_info).each(function(_5){ |
|---|
| 236 | | var el=$(_5["element"]); |
|---|
| 237 | | if(el){ |
|---|
| 238 | | if(el.value==_5["condition"]){ |
|---|
| 239 | | this.change_tr(_5["target"],_5["equal"]); |
|---|
| 240 | | }else{ |
|---|
| 241 | | this.change_tr(_5["target"],!_5["equal"]); |
|---|
| 242 | | } |
|---|
| 243 | | } |
|---|
| 244 | | }.bind(this)); |
|---|
| | 351 | el.blur(); |
|---|
| | 352 | this.user_tab_activate(); |
|---|
| | 353 | el.focus(); |
|---|
| | 354 | } |
|---|
| | 355 | },refresh_group_list:function(_1a,_1b,_1c){ |
|---|
| | 356 | var _1d=rubricks.system.admin_user.variables; |
|---|
| | 357 | if(!_1d.group_tree){ |
|---|
| | 358 | var _1e; |
|---|
| | 359 | var _1f={id:_1a,focus_id:_1c}; |
|---|
| | 360 | if(_1b){ |
|---|
| | 361 | _1e={asynchronous:true,evalScripts:true,parameters:_1f,onLoaded:function(_20){ |
|---|
| | 362 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 363 | },onLoading:function(_21){ |
|---|
| | 364 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 365 | }}; |
|---|
| | 366 | }else{ |
|---|
| | 367 | _1e={asynchronous:true,evalScripts:true,parameters:_1f}; |
|---|
| | 368 | } |
|---|
| | 369 | new Ajax.Updater("rubricks_group_list_frame",_1d.url_group_list,_1e); |
|---|
| | 370 | } |
|---|
| | 371 | },refresh_group_tree:function(_22){ |
|---|
| | 372 | var _23=rubricks.system.admin_user.variables; |
|---|
| | 373 | if(_23.group_tree){ |
|---|
| | 374 | new Ajax.Updater("rubricks_group_tree_frame",_23.url_group_tree,{asynchronous:true,evalScripts:true,parameters:{focus_id:_22}}); |
|---|
| | 375 | } |
|---|
| | 376 | },refresh_user_list:function(_24){ |
|---|
| | 377 | new Ajax.Updater("rubricks_user_list_frame",rubricks.system.admin_user.variables.url_user_list,{asynchronous:true,evalScripts:true,parameters:{id:_24}}); |
|---|
| | 378 | },render_user_image_window:function(_25){ |
|---|
| | 379 | new Ajax.Updater("user_image_frame",rubricks.system.admin_user.variables.url_user_image_window,{asynchronous:true,evalScripts:true,parameters:{id:_25},onLoaded:function(_26){ |
|---|
| | 380 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 381 | rubricks.system.admin_user.functions.user_image_window_open(); |
|---|
| | 382 | },onLoading:function(_27){ |
|---|
| | 383 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 384 | }}); |
|---|
| | 385 | },show_buttons:function(_28){ |
|---|
| | 386 | this.hide_buttons(); |
|---|
| | 387 | _28.each(function(_29){ |
|---|
| | 388 | var _2a=rubricks.system.admin_user.variables; |
|---|
| | 389 | if($(_2a.arr_operation_bar_button[_29])){ |
|---|
| | 390 | Element.show(_2a.arr_operation_bar_button[_29]); |
|---|
| | 391 | } |
|---|
| | 392 | }); |
|---|
| | 393 | },show_detail:function(_2b){ |
|---|
| | 394 | rubricks.system.admin_user.variables.temp_hash=_2b; |
|---|
| | 395 | rubricks.common.execute_if_loaded("admin_user_scripts",function(){ |
|---|
| | 396 | var _2c=true; |
|---|
| | 397 | var _2d=rubricks.system.admin_user.variables.temp_hash; |
|---|
| | 398 | $A(rubricks.system.admin_user.variables.arr_functions).each(function(arr){ |
|---|
| | 399 | if(_2d.match(arr[0])){ |
|---|
| | 400 | rubricks.system.admin_user.variables.ajax_history_hash=_2d; |
|---|
| | 401 | _2c=false; |
|---|
| | 402 | arr[1](); |
|---|
| | 403 | } |
|---|
| | 404 | }); |
|---|
| | 405 | if(_2c){ |
|---|
| | 406 | rubricks.system.admin_user.functions.detail_area_hide(); |
|---|
| | 407 | } |
|---|
| | 408 | }); |
|---|
| | 409 | },show_detail_group:function(){ |
|---|
| | 410 | var _2f=rubricks.system.admin_user.variables; |
|---|
| | 411 | this.group_tab_activate_effect(); |
|---|
| | 412 | var _30=_2f.ajax_history_hash.replace(/^group_/,""); |
|---|
| | 413 | this.group_select_effect(_30); |
|---|
| | 414 | _2f.target_group_id=_30; |
|---|
| | 415 | if(_30.length>0){ |
|---|
| | 416 | var _31={id:_30}; |
|---|
| | 417 | new Ajax.Updater("user_management_detail",_2f.url_group_show,{asynchronous:true,evalScripts:true,parameters:_31,onLoaded:function(_32){ |
|---|
| | 418 | rubricks.system.admin_user.functions.detail_area_show(); |
|---|
| | 419 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 420 | },onLoading:function(_33){ |
|---|
| | 421 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 422 | }}); |
|---|
| | 423 | } |
|---|
| | 424 | },show_detail_user:function(){ |
|---|
| | 425 | var _34=rubricks.system.admin_user.variables; |
|---|
| | 426 | this.user_tab_activate_effect(); |
|---|
| | 427 | var _35=_34.ajax_history_hash.replace(/^user_/,""); |
|---|
| | 428 | this.user_list_select_effect(_35); |
|---|
| | 429 | if(_35.length>0){ |
|---|
| | 430 | new Ajax.Updater("user_management_detail",_34.url_user_show,{asynchronous:true,evalScripts:true,parameters:{id:_35},onLoaded:function(_36){ |
|---|
| | 431 | rubricks.system.admin_user.functions.detail_area_show(); |
|---|
| | 432 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 433 | },onLoading:function(_37){ |
|---|
| | 434 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 435 | }}); |
|---|
| | 436 | } |
|---|
| | 437 | },user_admit:function(_38){ |
|---|
| | 438 | var _39=rubricks.system.admin_user.variables; |
|---|
| | 439 | new Ajax.Request(_39.url_user_admit,{asynchronous:true,evalScripts:true,parameters:{admit_id:_38},onLoaded:function(_3a){ |
|---|
| | 440 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 441 | },onLoading:function(_3b){ |
|---|
| | 442 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 443 | }}); |
|---|
| | 444 | },user_admit_confirm:function(_3c){ |
|---|
| | 445 | rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_admit_confirm,function(){ |
|---|
| | 446 | rubricks.system.admin_user.functions.user_admit(_3c); |
|---|
| | 447 | },function(){ |
|---|
| | 448 | rubricks.system.admin_user.functions.user_tab_activate(); |
|---|
| | 449 | }); |
|---|
| | 450 | },user_create_form_clear:function(){ |
|---|
| | 451 | $("user_create_form").reset(); |
|---|
| 246 | | },function_hash:{1:Prototype.emptyFunction,2:Prototype.emptyFunction,3:Prototype.emptyFunction,4:Prototype.emptyFunction,5:Prototype.emptyFunction,6:Prototype.emptyFunction,7:Prototype.emptyFunction,8:function(){ |
|---|
| 247 | | setTimeout("rubricks.system.admin_config.resize_calendar_cover();",200); |
|---|
| 248 | | }},holiday_delete:function(){ |
|---|
| 249 | | new Ajax.Request(this.url_holiday_delete,{asynchronous:true,evalScripts:true,parameters:this.delete_params,onLoaded:function(_7){ |
|---|
| 250 | | rubricks.common.rubricks_wait_message_close(); |
|---|
| 251 | | },onLoading:function(_8){ |
|---|
| 252 | | rubricks.common.rubricks_wait_message_open(); |
|---|
| 253 | | }}); |
|---|
| 254 | | },holiday_delete_confirm:function(){ |
|---|
| 255 | | var _9=this.calendar.getSelected(); |
|---|
| 256 | | if(_9.length==0){ |
|---|
| 257 | | rubricks.common.rubricks_message_window_open(this.msg_date_not_selected,"error"); |
|---|
| 258 | | return; |
|---|
| 259 | | } |
|---|
| 260 | | var _a=null; |
|---|
| 261 | | var _b=[]; |
|---|
| 262 | | _9.each(function(n){ |
|---|
| 263 | | var _d=this.calendar.getDate(n); |
|---|
| 264 | | var _e=this.calendar.getHoliday(_d).pop(); |
|---|
| 265 | | if(_e){ |
|---|
| 266 | | _b.push({year:_d.getFullYear(),month:_d.getMonth()+1,day:_d.getDate()}); |
|---|
| 267 | | } |
|---|
| 268 | | }.bind(this)); |
|---|
| 269 | | if(_b.length==0){ |
|---|
| 270 | | rubricks.common.rubricks_message_window_open(this.msg_holiday_not_set,"error"); |
|---|
| 271 | | return; |
|---|
| 272 | | } |
|---|
| 273 | | this.delete_params={holidays:JSON.stringify(_b)}; |
|---|
| 274 | | this.delete_confirm_window(); |
|---|
| 275 | | },holiday_edit_window_close:function(){ |
|---|
| 276 | | this.holiday_edit_window.close(); |
|---|
| 277 | | },holiday_edit_window_open:function(){ |
|---|
| 278 | | var _f=this.calendar.getSelected(); |
|---|
| 279 | | if(_f.length==0){ |
|---|
| 280 | | rubricks.common.rubricks_message_window_open(this.msg_date_not_selected,"error"); |
|---|
| 281 | | return; |
|---|
| 282 | | } |
|---|
| 283 | | var _10=this.calendar.getDate(_f[0]); |
|---|
| 284 | | var _11=null; |
|---|
| 285 | | var _12=_f.map(function(n){ |
|---|
| 286 | | var _14=this.calendar.getDate(n); |
|---|
| 287 | | if(!_11){ |
|---|
| 288 | | _11=this.calendar.getHoliday(_14).pop(); |
|---|
| 289 | | } |
|---|
| 290 | | return {year:_14.getFullYear(),month:_14.getMonth()+1,day:_14.getDate()}; |
|---|
| 291 | | }.bind(this)); |
|---|
| 292 | | if(_11){ |
|---|
| 293 | | $("holiday_name").value=_11.name.unescapeHTML(); |
|---|
| 294 | | }else{ |
|---|
| 295 | | $("holiday_name").value=""; |
|---|
| 296 | | } |
|---|
| | 453 | },user_create_window_close:function(){ |
|---|
| | 454 | rubricks.system.admin_user.variables.user_create_window.close(); |
|---|
| | 455 | },user_create_window_open:function(){ |
|---|
| | 456 | var _3d=rubricks.system.admin_user.variables; |
|---|
| | 457 | if(_3d.flg_user_create_window_loaded){ |
|---|
| | 458 | if(_3d.group_tree&&_3d.group_changed){ |
|---|
| | 459 | _3d.group_changed=false; |
|---|
| | 460 | this.user_create_window_render(); |
|---|
| | 461 | }else{ |
|---|
| | 462 | this.user_create_form_clear(); |
|---|
| | 463 | _3d.user_create_window.center(); |
|---|
| | 464 | _3d.user_create_window.open(); |
|---|
| | 465 | $("rubricks_user_login_name").focus(); |
|---|
| | 466 | } |
|---|
| | 467 | }else{ |
|---|
| | 468 | this.user_create_window_render(); |
|---|
| | 469 | } |
|---|
| | 470 | },user_create_window_render:function(){ |
|---|
| | 471 | new Ajax.Updater("user_create_window_contents",rubricks.system.admin_user.variables.url_user_create_window,{asynchronous:true,evalScripts:true,onLoading:function(_3e){ |
|---|
| | 472 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 473 | }}); |
|---|
| | 474 | },user_detail_window_close:function(){ |
|---|
| | 475 | rubricks.system.admin_user.variables.user_detail_window.close(); |
|---|
| | 476 | },user_detail_window_open:function(_3f){ |
|---|
| | 477 | var _40=rubricks.system.admin_user.variables; |
|---|
| | 478 | _40.user_detail_window.center(); |
|---|
| | 479 | _40.user_detail_window.open(); |
|---|
| | 480 | },user_detail_window_render:function(_41){ |
|---|
| | 481 | new Ajax.Updater("user_detail_window_contents",rubricks.system.admin_user.variables.url_user_detail_window,{asynchronous:true,evalScripts:true,parameters:{id:_41},onLoading:function(_42){ |
|---|
| | 482 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 483 | }}); |
|---|
| | 484 | },user_edit_mode:function(){ |
|---|
| 298 | | var _15=_10.toLocaleDateString(); |
|---|
| 299 | | if(_f.length>1){ |
|---|
| 300 | | _15+=" - "+this.calendar.getDate(_f[_f.length-1]).toLocaleDateString(); |
|---|
| 301 | | } |
|---|
| 302 | | $("holiday_date_string").innerHTML=_15; |
|---|
| 303 | | $("holiday_dates").value=JSON.stringify(_12); |
|---|
| 304 | | this.holiday_edit_window.center(); |
|---|
| 305 | | this.holiday_edit_window.open(); |
|---|
| 306 | | Form.focusFirstElement("holiday_form"); |
|---|
| 307 | | },holiday_import_fix_params:function(){ |
|---|
| 308 | | $("holiday_import_year").value=this.calendar.date.getFullYear(); |
|---|
| 309 | | $("holiday_import_month").value=this.calendar.date.getMonth()+1; |
|---|
| 310 | | },holiday_import_window_close:function(){ |
|---|
| 311 | | this.holiday_import_window.close(); |
|---|
| 312 | | },holiday_import_window_open:function(){ |
|---|
| 313 | | $("holidays_import_form").reset(); |
|---|
| 314 | | $("holidays").value=""; |
|---|
| 315 | | rubricks.common.Validator.refresh_by_id("holidays"); |
|---|
| 316 | | this.holiday_import_window.center(); |
|---|
| 317 | | this.holiday_import_window.open(); |
|---|
| 318 | | },resize_calendar_cover:function(){ |
|---|
| 319 | | this.calendar.builder.setColumnWidth(); |
|---|
| 320 | | this.calendar.builder.setCover(); |
|---|
| 321 | | },show_buttons:function(tab){ |
|---|
| 322 | | $H(this.button_hash).keys().each(function(key){ |
|---|
| 323 | | $A(this.button_hash[key]).each(function(_18){ |
|---|
| 324 | | Element.hide(_18); |
|---|
| 325 | | }); |
|---|
| 326 | | }.bind(this)); |
|---|
| 327 | | $A(this.button_hash[tab]).each(function(_19){ |
|---|
| 328 | | Element.show(_19); |
|---|
| 329 | | }); |
|---|
| 330 | | },tab_click:function(tab){ |
|---|
| 331 | | this.show_buttons(tab); |
|---|
| 332 | | this.function_hash[tab](); |
|---|
| 333 | | },tab_hash:{1:"tab_site",2:"tab_user",3:"tab_toolbar",4:"tab_dashboard",5:"tab_search",6:"tab_mail",7:"tab_meta",8:"tab_holiday"},tab_toolbar_submit:function(){ |
|---|
| 334 | | var _1b=JSON.stringify(this.sortable_toolbar.serialize()); |
|---|
| 335 | | this.all_tab_read_mode(); |
|---|
| 336 | | new Ajax.Request(rubricks.system.admin_config.url_toolbar_update,{asynchronous:true,evalScripts:true,parameters:{rubricks_toolbar_view_data:_1b},onLoaded:function(_1c){ |
|---|
| 337 | | rubricks.common.rubricks_wait_message_close(); |
|---|
| 338 | | },onLoading:function(_1d){ |
|---|
| 339 | | rubricks.common.rubricks_wait_message_open(); |
|---|
| 340 | | }}); |
|---|
| 341 | | },tab_toolbar_edit_mode:function(){ |
|---|
| 342 | | rubricks.common.FormEditor.editMode("tab_toolbar_management_area"); |
|---|
| 343 | | this.sortable_toolbar.sortable(); |
|---|
| 344 | | },tab_toolbar_read_mode:function(){ |
|---|
| 345 | | rubricks.common.FormEditor.readMode("tab_toolbar_management_area","tab_toolbar_form"); |
|---|
| 346 | | this.sortable_toolbar.unsortable(); |
|---|
| 347 | | }}); |
|---|
| 348 | | rubricks.system.admin_config.SortableToolbar.prototype={id_prefix:"rubricks_toolbar_view_",initialize:function(_1e){ |
|---|
| 349 | | this.target_id_list=_1e; |
|---|
| 350 | | this.record_initial_data(); |
|---|
| 351 | | },record_initial_data:function(){ |
|---|
| 352 | | var _1f=this; |
|---|
| 353 | | this.initial_data=new Object(); |
|---|
| 354 | | $A(this.target_id_list).each(function(id){ |
|---|
| 355 | | _1f.initial_data[id]=$(id).innerHTML; |
|---|
| 356 | | }); |
|---|
| 357 | | },serialize:function(){ |
|---|
| 358 | | var _21=this; |
|---|
| 359 | | var _22=new Object(); |
|---|
| 360 | | $A(this.target_id_list).each(function(id){ |
|---|
| 361 | | _22[id]=_21.serialize_list(id); |
|---|
| 362 | | }); |
|---|
| 363 | | return _22; |
|---|
| 364 | | },serialize_list:function(id){ |
|---|
| 365 | | var _25=this; |
|---|
| 366 | | var _26=new Array(); |
|---|
| 367 | | $A($(id).getElementsByTagName("li")).each(function(_27){ |
|---|
| 368 | | _26.push(_27.id.replace(_25.id_prefix,"")); |
|---|
| 369 | | }.bind(this)); |
|---|
| 370 | | return _26; |
|---|
| 371 | | },sortable:function(){ |
|---|
| 372 | | $A(this.target_id_list).each(function(id){ |
|---|
| 373 | | Sortable.create(id,{constraint:"vertical",containment:this.target_id_list,dropOnEmpty:true,overlap:"vertical",tag:"li"}); |
|---|
| 374 | | }.bind(this)); |
|---|
| 375 | | },unsortable:function(){ |
|---|
| 376 | | var _29=this; |
|---|
| 377 | | $A(this.target_id_list).each(function(id){ |
|---|
| 378 | | Sortable.destroy(id); |
|---|
| 379 | | $(id).innerHTML=_29.initial_data[id]; |
|---|
| 380 | | }.bind(this)); |
|---|
| 381 | | }}; |
|---|
| | 486 | rubricks.common.FormEditor.editMode("user_management_area"); |
|---|
| | 487 | },user_export_window_close:function(){ |
|---|
| | 488 | rubricks.system.admin_user.variables.user_export_window.close(); |
|---|
| | 489 | },user_export_window_open:function(){ |
|---|
| | 490 | var _43=rubricks.system.admin_user.variables; |
|---|
| | 491 | if(_43.flg_user_export_window_loaded){ |
|---|
| | 492 | _43.user_export_window.center(); |
|---|
| | 493 | _43.user_export_window.open(); |
|---|
| | 494 | }else{ |
|---|
| | 495 | this.user_export_window_render(); |
|---|
| | 496 | } |
|---|
| | 497 | },user_export_window_render:function(){ |
|---|
| | 498 | new Ajax.Updater("user_export_window_contents",rubricks.system.admin_user.variables.url_user_export_window,{asynchronous:true,evalScripts:true,onLoading:function(_44){ |
|---|
| | 499 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 500 | }}); |
|---|
| | 501 | },user_image_delete:function(_45){ |
|---|
| | 502 | new Ajax.Request(rubricks.system.admin_user.variables.url_user_image_delete,{asynchronous:true,evalScripts:true,parameters:{id:_45},onLoaded:function(_46){ |
|---|
| | 503 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 504 | },onLoading:function(_47){ |
|---|
| | 505 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 506 | }}); |
|---|
| | 507 | },user_image_delete_confirm:function(_48){ |
|---|
| | 508 | rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_image_delete_confirm,function(){ |
|---|
| | 509 | rubricks.system.admin_user.functions.user_image_delete(_48); |
|---|
| | 510 | },function(){ |
|---|
| | 511 | rubricks.system.admin_user.functions.user_tab_activate(); |
|---|
| | 512 | }); |
|---|
| | 513 | },user_image_window_close:function(){ |
|---|
| | 514 | rubricks.system.admin_user.variables.user_image_window.close(); |
|---|
| | 515 | },user_image_window_open:function(){ |
|---|
| | 516 | var _49=rubricks.system.admin_user.variables; |
|---|
| | 517 | _49.user_image_window.center(); |
|---|
| | 518 | _49.user_image_window.open(); |
|---|
| | 519 | },user_import_form_clear:function(){ |
|---|
| | 520 | $("user_import_form").reset(); |
|---|
| | 521 | rubricks.common.Validator.refresh(); |
|---|
| | 522 | },user_import_window_close:function(){ |
|---|
| | 523 | rubricks.system.admin_user.variables.user_import_window.close(); |
|---|
| | 524 | },user_import_window_open:function(){ |
|---|
| | 525 | var _4a=rubricks.system.admin_user.variables; |
|---|
| | 526 | if(_4a.flg_user_import_window_loaded){ |
|---|
| | 527 | this.user_import_form_clear(); |
|---|
| | 528 | _4a.user_import_window.center(); |
|---|
| | 529 | _4a.user_import_window.open(); |
|---|
| | 530 | }else{ |
|---|
| | 531 | this.user_import_window_render(); |
|---|
| | 532 | } |
|---|
| | 533 | },user_import_window_render:function(){ |
|---|
| | 534 | new Ajax.Updater("user_import_window_contents",rubricks.system.admin_user.variables.url_user_import_window,{asynchronous:true,evalScripts:true,onLoading:function(_4b){ |
|---|
| | 535 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 536 | }}); |
|---|
| | 537 | },user_invalidate:function(_4c){ |
|---|
| | 538 | new Ajax.Request(rubricks.system.admin_user.variables.url_user_invalidate,{asynchronous:true,evalScripts:true,parameters:{invalidate_id:_4c},onLoaded:function(_4d){ |
|---|
| | 539 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 540 | },onLoading:function(_4e){ |
|---|
| | 541 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 542 | }}); |
|---|
| | 543 | },user_invalidate_confirm:function(_4f){ |
|---|
| | 544 | rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_invalidate_confirm,function(){ |
|---|
| | 545 | rubricks.system.admin_user.functions.user_invalidate(_4f); |
|---|
| | 546 | },function(){ |
|---|
| | 547 | rubricks.system.admin_user.functions.user_tab_activate(); |
|---|
| | 548 | }); |
|---|
| | 549 | },user_invalidate_multiple:function(){ |
|---|
| | 550 | var _50=rubricks.system.admin_user.variables; |
|---|
| | 551 | var _51=_50.rubricks_user_list; |
|---|
| | 552 | var _52=(_51)?_51.getSelected().join(","):""; |
|---|
| | 553 | if(_52.length==0){ |
|---|
| | 554 | rubricks.common.rubricks_message_window_open(_50.msg_user_not_selected,"error"); |
|---|
| | 555 | }else{ |
|---|
| | 556 | rubricks.common.rubricks_confirm_window_open(_50.msg_user_invalidate_confirm,function(){ |
|---|
| | 557 | rubricks.system.admin_user.functions.user_invalidate(rubricks.system.admin_user.variables.rubricks_user_list.getSelected().join(",")); |
|---|
| | 558 | },function(){ |
|---|
| | 559 | _51.makeAvailable(); |
|---|
| | 560 | }); |
|---|
| | 561 | } |
|---|
| | 562 | },user_list_buttons_singular:function(){ |
|---|
| | 563 | if($("user_singular_form")){ |
|---|
| | 564 | Element.hide("user_invalidate_multiple_form"); |
|---|
| | 565 | Element.hide("user_singular_form"); |
|---|
| | 566 | Element.show("user_multiple_form"); |
|---|
| | 567 | } |
|---|
| | 568 | },user_list_buttons_multiple:function(){ |
|---|
| | 569 | if($("user_singular_form")){ |
|---|
| | 570 | Element.hide("user_multiple_form"); |
|---|
| | 571 | Element.show("user_singular_form"); |
|---|
| | 572 | Element.show("user_invalidate_multiple_form"); |
|---|
| | 573 | } |
|---|
| | 574 | },user_list_select_effect:function(_53){ |
|---|
| | 575 | var _54=rubricks.system.admin_user.variables.rubricks_user_list; |
|---|
| | 576 | if(_54){ |
|---|
| | 577 | var _55=_54.getSelected(); |
|---|
| | 578 | if(_55[0]!=_53){ |
|---|
| | 579 | _54.selectEffect(_54.buildTrId(_53)); |
|---|
| | 580 | } |
|---|
| | 581 | } |
|---|
| | 582 | },user_multiple_mode:function(){ |
|---|
| | 583 | var _56=rubricks.system.admin_user.variables.rubricks_user_list; |
|---|
| | 584 | if(_56){ |
|---|
| | 585 | _56.makeMultiple(); |
|---|
| | 586 | } |
|---|
| | 587 | this.user_list_buttons_multiple(); |
|---|
| | 588 | },user_read_mode:function(){ |
|---|
| | 589 | if($("user_management_area")){ |
|---|
| | 590 | rubricks.common.FormEditor.readMode("user_management_area","user_edit_form"); |
|---|
| | 591 | } |
|---|
| | 592 | this.user_tab_activate(); |
|---|
| | 593 | },user_singular_mode:function(){ |
|---|
| | 594 | var _57=rubricks.system.admin_user.variables.rubricks_user_list; |
|---|
| | 595 | if(_57){ |
|---|
| | 596 | _57.makeSingular(); |
|---|
| | 597 | } |
|---|
| | 598 | this.user_list_buttons_singular(); |
|---|
| | 599 | },user_tab_activate:function(){ |
|---|
| | 600 | this.user_tab_activate_effect(); |
|---|
| | 601 | SelectableTableManager.activate("rubricks_user_list"); |
|---|
| | 602 | },user_tab_activate_effect:function(){ |
|---|
| | 603 | this.activate_tab(0); |
|---|
| | 604 | this.show_buttons([0]); |
|---|
| | 605 | },user_unlock:function(_58){ |
|---|
| | 606 | new Ajax.Request(rubricks.system.admin_user.variables.url_user_unlock,{asynchronous:true,evalScripts:true,parameters:{unlock_id:_58},onLoaded:function(_59){ |
|---|
| | 607 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 608 | },onLoading:function(_5a){ |
|---|
| | 609 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 610 | }}); |
|---|
| | 611 | },user_unlock_confirm:function(_5b){ |
|---|
| | 612 | rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_unlock_confirm,function(){ |
|---|
| | 613 | rubricks.system.admin_user.functions.user_unlock(_5b); |
|---|
| | 614 | },function(){ |
|---|
| | 615 | rubricks.system.admin_user.functions.user_tab_activate(); |
|---|
| | 616 | }); |
|---|
| | 617 | },user_validate:function(_5c){ |
|---|
| | 618 | new Ajax.Request(rubricks.system.admin_user.variables.url_user_validate,{asynchronous:true,evalScripts:true,parameters:{validate_id:_5c},onLoaded:function(_5d){ |
|---|
| | 619 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 620 | },onLoading:function(_5e){ |
|---|
| | 621 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 622 | }}); |
|---|
| | 623 | },user_validate_confirm:function(_5f){ |
|---|
| | 624 | rubricks.common.rubricks_confirm_window_open(rubricks.system.admin_user.variables.msg_user_validate_confirm,function(){ |
|---|
| | 625 | rubricks.system.admin_user.functions.user_validate(_5f); |
|---|
| | 626 | },function(){ |
|---|
| | 627 | rubricks.system.admin_user.functions.user_tab_activate(); |
|---|
| | 628 | }); |
|---|
| | 629 | }}); |
|---|
| | 630 | AjaxHistory.addCallback(function(_60){ |
|---|
| | 631 | rubricks.system.admin_user.functions.show_detail(_60); |
|---|
| | 632 | },"rubricks_system_admin_user"); |
|---|
| 710 | | Object.extend(rubricks.system.admin_theme,{_ajax_history_prefix:"rubricks_system_admin_theme_select",add_ajax_history:function(_1){ |
|---|
| | 905 | Object.extend(rubricks.system.admin_config,{SortableToolbar:Class.create(),all_tab_read_mode:function(){ |
|---|
| | 906 | this.arr_formeditor_area.each(function(el){ |
|---|
| | 907 | el=$(el); |
|---|
| | 908 | if(el){ |
|---|
| | 909 | rubricks.common.FormEditor.readMode(el,null,{force:false}); |
|---|
| | 910 | } |
|---|
| | 911 | }); |
|---|
| | 912 | },button_hash:{1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:["operationbar_button_import","operationbar_button_initialize"]},change_tr:function(_2,_3){ |
|---|
| | 913 | _2.split(",").each(function(_4){ |
|---|
| | 914 | if(_3){ |
|---|
| | 915 | Element.show(_4); |
|---|
| | 916 | }else{ |
|---|
| | 917 | Element.hide(_4); |
|---|
| | 918 | } |
|---|
| | 919 | }); |
|---|
| | 920 | },check_switching:function(){ |
|---|
| | 921 | $A(this.switching_info).each(function(_5){ |
|---|
| | 922 | var el=$(_5["element"]); |
|---|
| | 923 | if(el){ |
|---|
| | 924 | if(el.value==_5["condition"]){ |
|---|
| | 925 | this.change_tr(_5["target"],_5["equal"]); |
|---|
| | 926 | }else{ |
|---|
| | 927 | this.change_tr(_5["target"],!_5["equal"]); |
|---|
| | 928 | } |
|---|
| | 929 | } |
|---|
| | 930 | }.bind(this)); |
|---|
| | 931 | rubricks.common.Validator.refresh(); |
|---|
| | 932 | },function_hash:{1:Prototype.emptyFunction,2:Prototype.emptyFunction,3:Prototype.emptyFunction,4:Prototype.emptyFunction,5:Prototype.emptyFunction,6:Prototype.emptyFunction,7:Prototype.emptyFunction,8:function(){ |
|---|
| | 933 | setTimeout("rubricks.system.admin_config.resize_calendar_cover();",200); |
|---|
| | 934 | }},holiday_delete:function(){ |
|---|
| | 935 | new Ajax.Request(this.url_holiday_delete,{asynchronous:true,evalScripts:true,parameters:this.delete_params,onLoaded:function(_7){ |
|---|
| | 936 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 937 | },onLoading:function(_8){ |
|---|
| | 938 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 939 | }}); |
|---|
| | 940 | },holiday_delete_confirm:function(){ |
|---|
| | 941 | var _9=this.calendar.getSelected(); |
|---|
| | 942 | if(_9.length==0){ |
|---|
| | 943 | rubricks.common.rubricks_message_window_open(this.msg_date_not_selected,"error"); |
|---|
| | 944 | return; |
|---|
| | 945 | } |
|---|
| | 946 | var _a=null; |
|---|
| | 947 | var _b=[]; |
|---|
| | 948 | _9.each(function(n){ |
|---|
| | 949 | var _d=this.calendar.getDate(n); |
|---|
| | 950 | var _e=this.calendar.getHoliday(_d).pop(); |
|---|
| | 951 | if(_e){ |
|---|
| | 952 | _b.push({year:_d.getFullYear(),month:_d.getMonth()+1,day:_d.getDate()}); |
|---|
| | 953 | } |
|---|
| | 954 | }.bind(this)); |
|---|
| | 955 | if(_b.length==0){ |
|---|
| | 956 | rubricks.common.rubricks_message_window_open(this.msg_holiday_not_set,"error"); |
|---|
| | 957 | return; |
|---|
| | 958 | } |
|---|
| | 959 | this.delete_params={holidays:JSON.stringify(_b)}; |
|---|
| | 960 | this.delete_confirm_window(); |
|---|
| | 961 | },holiday_edit_window_close:function(){ |
|---|
| | 962 | this.holiday_edit_window.close(); |
|---|
| | 963 | },holiday_edit_window_open:function(){ |
|---|
| | 964 | var _f=this.calendar.getSelected(); |
|---|
| | 965 | if(_f.length==0){ |
|---|
| | 966 | rubricks.common.rubricks_message_window_open(this.msg_date_not_selected,"error"); |
|---|
| | 967 | return; |
|---|
| | 968 | } |
|---|
| | 969 | var _10=this.calendar.getDate(_f[0]); |
|---|
| | 970 | var _11=null; |
|---|
| | 971 | var _12=_f.map(function(n){ |
|---|
| | 972 | var _14=this.calendar.getDate(n); |
|---|
| | 973 | if(!_11){ |
|---|
| | 974 | _11=this.calendar.getHoliday(_14).pop(); |
|---|
| | 975 | } |
|---|
| | 976 | return {year:_14.getFullYear(),month:_14.getMonth()+1,day:_14.getDate()}; |
|---|
| | 977 | }.bind(this)); |
|---|
| | 978 | if(_11){ |
|---|
| | 979 | $("holiday_name").value=_11.name.unescapeHTML(); |
|---|
| | 980 | }else{ |
|---|
| | 981 | $("holiday_name").value=""; |
|---|
| | 982 | } |
|---|
| | 983 | rubricks.common.Validator.refresh(); |
|---|
| | 984 | var _15=_10.toLocaleDateString(); |
|---|
| | 985 | if(_f.length>1){ |
|---|
| | 986 | _15+=" - "+this.calendar.getDate(_f[_f.length-1]).toLocaleDateString(); |
|---|
| | 987 | } |
|---|
| | 988 | $("holiday_date_string").innerHTML=_15; |
|---|
| | 989 | $("holiday_dates").value=JSON.stringify(_12); |
|---|
| | 990 | this.holiday_edit_window.center(); |
|---|
| | 991 | this.holiday_edit_window.open(); |
|---|
| | 992 | Form.focusFirstElement("holiday_form"); |
|---|
| | 993 | },holiday_import_fix_params:function(){ |
|---|
| | 994 | $("holiday_import_year").value=this.calendar.date.getFullYear(); |
|---|
| | 995 | $("holiday_import_month").value=this.calendar.date.getMonth()+1; |
|---|
| | 996 | },holiday_import_window_close:function(){ |
|---|
| | 997 | this.holiday_import_window.close(); |
|---|
| | 998 | },holiday_import_window_open:function(){ |
|---|
| | 999 | $("holidays_import_form").reset(); |
|---|
| | 1000 | $("holidays").value=""; |
|---|
| | 1001 | rubricks.common.Validator.refresh_by_id("holidays"); |
|---|
| | 1002 | this.holiday_import_window.center(); |
|---|
| | 1003 | this.holiday_import_window.open(); |
|---|
| | 1004 | },resize_calendar_cover:function(){ |
|---|
| | 1005 | this.calendar.builder.setColumnWidth(); |
|---|
| | 1006 | this.calendar.builder.setCover(); |
|---|
| | 1007 | },show_buttons:function(tab){ |
|---|
| | 1008 | $H(this.button_hash).keys().each(function(key){ |
|---|
| | 1009 | $A(this.button_hash[key]).each(function(_18){ |
|---|
| | 1010 | Element.hide(_18); |
|---|
| | 1011 | }); |
|---|
| | 1012 | }.bind(this)); |
|---|
| | 1013 | $A(this.button_hash[tab]).each(function(_19){ |
|---|
| | 1014 | Element.show(_19); |
|---|
| | 1015 | }); |
|---|
| | 1016 | },tab_click:function(tab){ |
|---|
| | 1017 | this.show_buttons(tab); |
|---|
| | 1018 | this.function_hash[tab](); |
|---|
| | 1019 | },tab_hash:{1:"tab_site",2:"tab_user",3:"tab_toolbar",4:"tab_dashboard",5:"tab_search",6:"tab_mail",7:"tab_meta",8:"tab_holiday"},tab_toolbar_submit:function(){ |
|---|
| | 1020 | var _1b=JSON.stringify(this.sortable_toolbar.serialize()); |
|---|
| | 1021 | this.all_tab_read_mode(); |
|---|
| | 1022 | new Ajax.Request(rubricks.system.admin_config.url_toolbar_update,{asynchronous:true,evalScripts:true,parameters:{rubricks_toolbar_view_data:_1b},onLoaded:function(_1c){ |
|---|
| | 1023 | rubricks.common.rubricks_wait_message_close(); |
|---|
| | 1024 | },onLoading:function(_1d){ |
|---|
| | 1025 | rubricks.common.rubricks_wait_message_open(); |
|---|
| | 1026 | }}); |
|---|
| | 1027 | },tab_toolbar_edit_mode:function(){ |
|---|
| | 1028 | rubricks.common.FormEditor.editMode("tab_toolbar_management_area"); |
|---|
| | 1029 | this.sortable_toolbar.sortable(); |
|---|
| | 1030 | },tab_toolbar_read_mode:function(){ |
|---|
| | 1031 | rubricks.common.FormEditor.readMode("tab_toolbar_management_area","tab_toolbar_form"); |
|---|
| | 1032 | this.sortable_toolbar.unsortable(); |
|---|
| | 1033 | }}); |
|---|
| | 1034 | rubricks.system.admin_config.SortableToolbar.prototype={id_prefix:"rubricks_toolbar_view_",initialize:function(_1e){ |
|---|
| | 1035 | this.target_id_list=_1e; |
|---|
| | 1036 | this.record_initial_data(); |
|---|
| | 1037 | },record_initial_data:function(){ |
|---|
| | 1038 | var _1f=this; |
|---|
| | 1039 | this.initial_data=new Object(); |
|---|
| | 1040 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1041 | _1f.initial_data[id]=$(id).innerHTML; |
|---|
| | 1042 | }); |
|---|
| | 1043 | },serialize:function(){ |
|---|
| | 1044 | var _21=this; |
|---|
| | 1045 | var _22=new Object(); |
|---|
| | 1046 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1047 | _22[id]=_21.serialize_list(id); |
|---|
| | 1048 | }); |
|---|
| | 1049 | return _22; |
|---|
| | 1050 | },serialize_list:function(id){ |
|---|
| | 1051 | var _25=this; |
|---|
| | 1052 | var _26=new Array(); |
|---|
| | 1053 | $A($(id).getElementsByTagName("li")).each(function(_27){ |
|---|
| | 1054 | _26.push(_27.id.replace(_25.id_prefix,"")); |
|---|
| | 1055 | }.bind(this)); |
|---|
| | 1056 | return _26; |
|---|
| | 1057 | },sortable:function(){ |
|---|
| | 1058 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1059 | Sortable.create(id,{constraint:"vertical",containment:this.target_id_list,dropOnEmpty:true,overlap:"vertical",tag:"li"}); |
|---|
| | 1060 | }.bind(this)); |
|---|
| | 1061 | },unsortable:function(){ |
|---|
| | 1062 | var _29=this; |
|---|
| | 1063 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1064 | Sortable.destroy(id); |
|---|
| | 1065 | $(id).innerHTML=_29.initial_data[id]; |
|---|
| | 1066 | }.bind(this)); |
|---|
| | 1067 | }}; |
|---|
| | 1068 | |
|---|
| | 1069 | Object.extend(rubricks.system.admin_mobile,{SortableMobileMenu:Class.create(),all_tab_read_mode:function(){ |
|---|
| | 1070 | this.arr_formeditor_area.each(function(el){ |
|---|
| | 1071 | el=$(el); |
|---|
| | 1072 | if(el){ |
|---|
| | 1073 | rubricks.common.FormEditor.readMode(el,null,{force:false}); |
|---|
| | 1074 | } |
|---|
| | 1075 | }); |
|---|
| | 1076 | },tab_login_edit_mode:function(){ |
|---|
| | 1077 | rubricks.common.FormEditor.editMode("tab_login_management_area"); |
|---|
| | 1078 | },tab_login_read_mode:function(){ |
|---|
| | 1079 | rubricks.common.FormEditor.readMode("tab_login_management_area","tab_login_form"); |
|---|
| | 1080 | },tab_menu_submit:function(){ |
|---|
| | 1081 | $("rubricks_mobile_menu_data").value=JSON.stringify(this.sortable_mobile_menu.serialize()); |
|---|
| | 1082 | rubricks.common.fire_onsubmit("tab_menu_form","tab_menu_update_button","tab_menu_management_area"); |
|---|
| | 1083 | },tab_menu_edit_mode:function(){ |
|---|
| | 1084 | rubricks.common.FormEditor.editMode("tab_menu_management_area"); |
|---|
| | 1085 | this.sortable_mobile_menu.sortable(); |
|---|
| | 1086 | },tab_menu_read_mode:function(){ |
|---|
| | 1087 | rubricks.common.FormEditor.readMode("tab_menu_management_area","tab_menu_form"); |
|---|
| | 1088 | this.sortable_mobile_menu.unsortable(); |
|---|
| | 1089 | }}); |
|---|
| | 1090 | rubricks.system.admin_mobile.SortableMobileMenu.prototype={id_prefix:"rubricks_mobile_menu_",initialize:function(_2){ |
|---|
| | 1091 | this.target_id_list=_2; |
|---|
| | 1092 | this.record_initial_data(); |
|---|
| | 1093 | },record_initial_data:function(){ |
|---|
| | 1094 | var _3=this; |
|---|
| | 1095 | this.initial_data=new Object(); |
|---|
| | 1096 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1097 | _3.initial_data[id]=$(id).innerHTML; |
|---|
| | 1098 | }); |
|---|
| | 1099 | },serialize:function(){ |
|---|
| | 1100 | var _5=this; |
|---|
| | 1101 | var _6=new Object(); |
|---|
| | 1102 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1103 | _6[id]=_5.serialize_list(id); |
|---|
| | 1104 | }); |
|---|
| | 1105 | return _6; |
|---|
| | 1106 | },serialize_list:function(id){ |
|---|
| | 1107 | var _9=this; |
|---|
| | 1108 | var _a=new Array(); |
|---|
| | 1109 | $A($(id).getElementsByTagName("li")).each(function(_b){ |
|---|
| | 1110 | _a.push(_b.id.replace(_9.id_prefix,"")); |
|---|
| | 1111 | }.bind(this)); |
|---|
| | 1112 | return _a; |
|---|
| | 1113 | },sortable:function(){ |
|---|
| | 1114 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1115 | Sortable.create(id,{constraint:"vertical",containment:this.target_id_list,dropOnEmpty:true,overlap:"vertical",tag:"li"}); |
|---|
| | 1116 | }.bind(this)); |
|---|
| | 1117 | },unsortable:function(){ |
|---|
| | 1118 | var _d=this; |
|---|
| | 1119 | $A(this.target_id_list).each(function(id){ |
|---|
| | 1120 | Sortable.destroy(id); |
|---|
| | 1121 | $(id).innerHTML=_d.initial_data[id]; |
|---|
| | 1122 | }.bind(this)); |
|---|
| | 1123 | }}; |
|---|
| | 1124 | |
|---|
| | 1125 | Object.extend(rubricks.system.admin_block,{_ajax_history_prefix:"rubricks_system_admin_block_select",SortableBlocks:Class.create(),add_ajax_history:function(_1){ |
|---|