matrix.form_common.js 6.5 KB

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