github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/public/root/js/matrix.form_common.js (about) 1 2 $(document).ready(function(){ 3 4 $('input[type=checkbox],input[type=radio],input[type=file]').uniform(); 5 6 $('select').select2(); 7 $('.colorpicker').colorpicker(); 8 $('.datepicker').datepicker(); 9 }); 10 11 $(document).ready(function() { 12 13 //------------- Tags plugin -------------// 14 15 $("#tags").select2({ 16 tags:["red", "green", "blue", "orange"] 17 }); 18 19 //------------- Elastic textarea -------------// 20 if ($('textarea').hasClass('elastic')) { 21 $('.elastic').elastic(); 22 } 23 24 //------------- Input limiter -------------// 25 if ($('textarea').hasClass('limit')) { 26 $('.limit').inputlimiter({ 27 limit: 100 28 }); 29 } 30 31 //------------- Masked input fields -------------// 32 $("#mask-phone").mask("(999) 999-9999", {completed:function(){alert("Callback action after complete");}}); 33 $("#mask-phoneExt").mask("(999) 999-9999? x99999"); 34 $("#mask-phoneInt").mask("+40 999 999 999"); 35 $("#mask-date").mask("99/99/9999"); 36 $("#mask-ssn").mask("999-99-9999"); 37 $("#mask-productKey").mask("a*-999-a999", { placeholder: "*" }); 38 $("#mask-eyeScript").mask("~9.99 ~9.99 999"); 39 $("#mask-percent").mask("99%"); 40 41 //------------- Toggle button -------------// 42 43 $('.normal-toggle-button').toggleButtons(); 44 $('.text-toggle-button').toggleButtons({ 45 width: 140, 46 label: { 47 enabled: "ONLINE", 48 disabled: "OFFLINE" 49 } 50 }); 51 $('.iToggle-button').toggleButtons({ 52 width: 70, 53 label: { 54 enabled: "<span class='icon16 icomoon-icon-checkmark-2 white'></span>", 55 disabled: "<span class='icon16 icomoon-icon-cancel-3 white marginL5'></span>" 56 } 57 }); 58 59 //------------- Spinners with steps -------------// 60 $( "#spinner1" ).spinner(); 61 62 /*Demacial*/ 63 $( "#spinner2" ).spinner({ 64 step: 0.01, 65 numberFormat: "n" 66 }); 67 68 /*Custom step size*/ 69 $( "#spinner3" ).spinner({ 70 step: 5 71 }); 72 73 /*Currency spinner*/ 74 $( "#spinner4" ).spinner({ 75 numberFormat: "C" 76 }); 77 78 //------------- Colorpicker -------------// 79 if($('div').hasClass('picker')){ 80 $('.picker').farbtastic('#color'); 81 } 82 //------------- Datepicker -------------// 83 if($('#datepicker').length) { 84 $("#datepicker").datepicker({ 85 showOtherMonths:true 86 }); 87 } 88 if($('#datepicker-inline').length) { 89 $('#datepicker-inline').datepicker({ 90 inline: true, 91 showOtherMonths:true 92 }); 93 } 94 95 //------------- Combined picker -------------// 96 if($('#combined-picker').length) { 97 $('#combined-picker').datetimepicker(); 98 } 99 100 //------------- Time entry (picker) -------------// 101 $('#timepicker').timeEntry({ 102 show24Hours: true, 103 spinnerImage: '' 104 }); 105 $('#timepicker').timeEntry('setTime', '22:15') 106 107 //------------- Select plugin -------------// 108 $("#select1").select2(); 109 $("#select2").select2(); 110 111 //--------------- Dual multi select ------------------// 112 $.configureBoxes(); 113 114 //--------------- Tinymce ------------------// 115 $('textarea.tinymce').tinymce({ 116 // Location of TinyMCE script 117 script_url : 'plugins/forms/tiny_mce/tiny_mce.js', 118 119 // General options 120 theme : "advanced", 121 plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist", 122 123 // Theme options 124 theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", 125 theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", 126 theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", 127 theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", 128 theme_advanced_toolbar_location : "top", 129 theme_advanced_toolbar_align : "left", 130 theme_advanced_statusbar_location : "bottom", 131 theme_advanced_resizing : true, 132 133 // Example content CSS (should be your site CSS) 134 content_css : "css/main.css", 135 136 // Drop lists for link/image/media/template dialogs 137 template_external_list_url : "lists/template_list.js", 138 external_link_list_url : "lists/link_list.js", 139 external_image_list_url : "lists/image_list.js", 140 media_external_list_url : "lists/media_list.js", 141 142 // Replace values for the template plugin 143 template_replace_values : { 144 username : "SuprUser", 145 staffid : "991234" 146 } 147 }); 148 149 //Boostrap modal 150 $('#myModal').modal({ show: false}); 151 152 //add event to modal after closed 153 $('#myModal').on('hidden', function () { 154 console.log('modal is closed'); 155 }) 156 157 });//End document ready functions 158 159 //sparkline in sidebar area 160 var positive = [1,5,3,7,8,6,10]; 161 var negative = [10,6,8,7,3,5,1] 162 var negative1 = [7,6,8,7,6,5,4] 163 164 $('#stat1').sparkline(positive,{ 165 height:15, 166 spotRadius: 0, 167 barColor: '#9FC569', 168 type: 'bar' 169 }); 170 $('#stat2').sparkline(negative,{ 171 height:15, 172 spotRadius: 0, 173 barColor: '#ED7A53', 174 type: 'bar' 175 }); 176 $('#stat3').sparkline(negative1,{ 177 height:15, 178 spotRadius: 0, 179 barColor: '#ED7A53', 180 type: 'bar' 181 }); 182 $('#stat4').sparkline(positive,{ 183 height:15, 184 spotRadius: 0, 185 barColor: '#9FC569', 186 type: 'bar' 187 }); 188 //sparkline in widget 189 $('#stat5').sparkline(positive,{ 190 height:15, 191 spotRadius: 0, 192 barColor: '#9FC569', 193 type: 'bar' 194 }); 195 196 $('#stat6').sparkline(positive, { 197 width: 70,//Width of the chart - Defaults to 'auto' - May be any valid css width - 1.5em, 20px, etc (using a number without a unit specifier won't do what you want) - This option does nothing for bar and tristate chars (see barWidth) 198 height: 20,//Height of the chart - Defaults to 'auto' (line height of the containing tag) 199 lineColor: '#88bbc8',//Used by line and discrete charts to specify the colour of the line drawn as a CSS values string 200 fillColor: '#f2f7f9',//Specify the colour used to fill the area under the graph as a CSS value. Set to false to disable fill 201 spotColor: '#e72828',//The CSS colour of the final value marker. Set to false or an empty string to hide it 202 maxSpotColor: '#005e20',//The CSS colour of the marker displayed for the maximum value. Set to false or an empty string to hide it 203 minSpotColor: '#f7941d',//The CSS colour of the marker displayed for the mimum value. Set to false or an empty string to hide it 204 spotRadius: 3,//Radius of all spot markers, In pixels (default: 1.5) - Integer 205 lineWidth: 2//In pixels (default: 1) - Integer 206 }); 207