Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

social.js 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. 'use strict';
  2. $(document).ready(function() {
  3. // Edit information
  4. $('#edit-info').hide();
  5. $('#edit-cancel').on('click', function() {
  6. var c = $('#edit-btn').find("i");
  7. c.removeClass('icofont-close');
  8. c.addClass('icofont-edit');
  9. $('#view-info').show();
  10. $('#edit-info').hide();
  11. });
  12. $('#edit-save').on('click', function() {
  13. var c = $('#edit-btn').find("i");
  14. c.removeClass('icofont-close');
  15. c.addClass('icofont-edit');
  16. $('#view-info').show();
  17. $('#edit-info').hide();
  18. });
  19. $('#edit-btn').on('click', function() {
  20. var b = $(this).find("i");
  21. var edit_class = b.attr('class');
  22. if (edit_class == 'icofont icofont-edit') {
  23. b.removeClass('icofont-edit');
  24. b.addClass('icofont-close');
  25. $('#view-info').hide();
  26. $('#edit-info').show();
  27. } else {
  28. b.removeClass('icofont-close');
  29. b.addClass('icofont-edit');
  30. $('#view-info').show();
  31. $('#edit-info').hide();
  32. }
  33. });
  34. // Edit contact
  35. $('#edit-contact-info').hide();
  36. $('#contact-save').on('click', function() {
  37. var c = $('#edit-Contact').find("i");
  38. c.removeClass('icofont-close');
  39. c.addClass('icofont-edit');
  40. $('#contact-info').show();
  41. $('#edit-contact-info').hide();
  42. });
  43. $('#contact-cancel').on('click', function() {
  44. var c = $('#edit-Contact').find("i");
  45. c.removeClass('icofont-close');
  46. c.addClass('icofont-edit');
  47. $('#contact-info').show();
  48. $('#edit-contact-info').hide();
  49. });
  50. $('#edit-Contact').on('click', function() {
  51. var b = $(this).find("i");
  52. var edit_class = b.attr('class');
  53. if (edit_class == 'icofont icofont-edit') {
  54. b.removeClass('icofont-edit');
  55. b.addClass('icofont-close');
  56. $('#contact-info').hide();
  57. $('#edit-contact-info').show();
  58. } else {
  59. b.removeClass('icofont-close');
  60. b.addClass('icofont-edit');
  61. $('#contact-info').show();
  62. $('#edit-contact-info').hide();
  63. }
  64. });
  65. // Edit work
  66. $('#edit-contact-work').hide();
  67. $('#work-save').on('click', function() {
  68. var c = $('#edit-work').find("i");
  69. c.removeClass('icofont-close');
  70. c.addClass('icofont-edit');
  71. $('#work-info').show();
  72. $('#edit-contact-work').hide();
  73. });
  74. $('#work-cancel').on('click', function() {
  75. var c = $('#edit-work').find("i");
  76. c.removeClass('icofont-close');
  77. c.addClass('icofont-edit');
  78. $('#work-info').show();
  79. $('#edit-contact-work').hide();
  80. });
  81. $('#edit-work').on('click', function() {
  82. var b = $(this).find("i");
  83. var edit_class = b.attr('class');
  84. if (edit_class == 'icofont icofont-edit') {
  85. b.removeClass('icofont-edit');
  86. b.addClass('icofont-close');
  87. $('#work-info').hide();
  88. $('#edit-contact-work').show();
  89. } else {
  90. b.removeClass('icofont-close');
  91. b.addClass('icofont-edit');
  92. $('#work-info').show();
  93. $('#edit-contact-work').hide();
  94. }
  95. });
  96. $('#post-new').hide();
  97. $('#post-message').keyup(function() {
  98. if (($(this).val() != "")) {
  99. $('#post-new').show();
  100. } else
  101. $('#post-new').hide();
  102. });
  103. // Minimum setup
  104. $('#datetimepicker1').datetimepicker({
  105. icons: {
  106. time: "icofont icofont-clock-time",
  107. date: "icofont icofont-ui-calendar",
  108. up: "icofont icofont-rounded-up",
  109. down: "icofont icofont-rounded-down",
  110. next: "icofont icofont-rounded-right",
  111. previous: "icofont icofont-rounded-left"
  112. }
  113. });
  114. // Using Locales
  115. $('#datetimepicker2').datetimepicker({
  116. locale: 'ru',
  117. icons: {
  118. time: "icofont icofont-clock-time",
  119. date: "icofont icofont-ui-calendar",
  120. up: "icofont icofont-rounded-up",
  121. down: "icofont icofont-rounded-down",
  122. next: "icofont icofont-rounded-right",
  123. previous: "icofont icofont-rounded-left"
  124. }
  125. });
  126. // Custom Formats
  127. $('#datetimepicker3').datetimepicker({
  128. format: 'LT',
  129. icons: {
  130. time: "icofont icofont-clock-time",
  131. date: "icofont icofont-ui-calendar",
  132. up: "icofont icofont-rounded-up",
  133. down: "icofont icofont-rounded-down",
  134. next: "icofont icofont-rounded-right",
  135. previous: "icofont icofont-rounded-left"
  136. }
  137. });
  138. // No Icon (input field only)
  139. $('#datetimepicker4').datetimepicker({
  140. icons: {
  141. time: "icofont icofont-clock-time",
  142. date: "icofont icofont-ui-calendar",
  143. up: "icofont icofont-rounded-up",
  144. down: "icofont icofont-rounded-down",
  145. next: "icofont icofont-rounded-right",
  146. previous: "icofont icofont-rounded-left"
  147. }
  148. });
  149. // Enabled/Disabled Dates
  150. $('#datetimepicker5').datetimepicker({
  151. defaultDate: "11/1/2013",
  152. disabledDates: [
  153. moment("12/25/2013"),
  154. new Date(2013, 11 - 1, 21),
  155. "11/22/2013 00:53"
  156. ],
  157. icons: {
  158. time: "icofont icofont-clock-time",
  159. date: "icofont icofont-ui-calendar",
  160. up: "icofont icofont-rounded-up",
  161. down: "icofont icofont-rounded-down",
  162. next: "icofont icofont-rounded-right",
  163. previous: "icofont icofont-rounded-left"
  164. }
  165. });
  166. // Linked Pickers
  167. $('#datetimepicker6').datetimepicker({
  168. icons: {
  169. time: "icofont icofont-clock-time",
  170. date: "icofont icofont-ui-calendar",
  171. up: "icofont icofont-rounded-up",
  172. down: "icofont icofont-rounded-down",
  173. next: "icofont icofont-rounded-right",
  174. previous: "icofont icofont-rounded-left"
  175. }
  176. });
  177. $('#datetimepicker7').datetimepicker({
  178. useCurrent: false, //Important! See issue #1075
  179. icons: {
  180. time: "icofont icofont-clock-time",
  181. date: "icofont icofont-ui-calendar",
  182. up: "icofont icofont-rounded-up",
  183. down: "icofont icofont-rounded-down",
  184. next: "icofont icofont-rounded-right",
  185. previous: "icofont icofont-rounded-left"
  186. }
  187. });
  188. $("#datetimepicker6").on("dp.change", function(e) {
  189. $('#datetimepicker7').data("DateTimePicker").minDate(e.date);
  190. });
  191. $("#datetimepicker7").on("dp.change", function(e) {
  192. $('#datetimepicker6').data("DateTimePicker").maxDate(e.date);
  193. });
  194. // Custom icons
  195. $('#datetimepicker8').datetimepicker({
  196. icons: {
  197. time: "icofont icofont-clock-time",
  198. date: "icofont icofont-ui-calendar",
  199. up: "icofont icofont-rounded-up",
  200. down: "icofont icofont-rounded-down"
  201. }
  202. });
  203. // View Mode
  204. $('#datetimepicker9').datetimepicker({
  205. viewMode: 'years',
  206. icons: {
  207. time: "icofont icofont-clock-time",
  208. date: "icofont icofont-ui-calendar",
  209. up: "icofont icofont-rounded-up",
  210. down: "icofont icofont-rounded-down",
  211. next: "icofont icofont-rounded-right",
  212. previous: "icofont icofont-rounded-left"
  213. }
  214. });
  215. // Min View Mode
  216. $('#datetimepicker10').datetimepicker({
  217. viewMode: 'years',
  218. format: 'MM/YYYY',
  219. icons: {
  220. time: "icofont icofont-clock-time",
  221. date: "icofont icofont-ui-calendar",
  222. up: "icofont icofont-rounded-up",
  223. down: "icofont icofont-rounded-down",
  224. next: "icofont icofont-rounded-right",
  225. previous: "icofont icofont-rounded-left"
  226. }
  227. });
  228. // Disabled Days of the Week
  229. $('#datetimepicker11').datetimepicker({
  230. daysOfWeekDisabled: [0, 6],
  231. icons: {
  232. time: "icofont icofont-clock-time",
  233. date: "icofont icofont-ui-calendar",
  234. up: "icofont icofont-rounded-up",
  235. down: "icofont icofont-rounded-down",
  236. next: "icofont icofont-rounded-right",
  237. previous: "icofont icofont-rounded-left"
  238. }
  239. });
  240. $('input[name="daterange"]').daterangepicker();
  241. $(function() {
  242. $('input[name="birthdate"]').daterangepicker({
  243. singleDatePicker: true,
  244. showDropdowns: true
  245. },
  246. function(start, end, label) {
  247. var years = moment().diff(start, 'years');
  248. alert("You are " + years + " years old.");
  249. });
  250. $('input[name="datefilter"]').daterangepicker({
  251. autoUpdateInput: false,
  252. locale: {
  253. cancelLabel: 'Clear'
  254. }
  255. });
  256. $('input[name="datefilter"]').on('apply.daterangepicker', function(ev, picker) {
  257. $(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
  258. });
  259. $('input[name="datefilter"]').on('cancel.daterangepicker', function(ev, picker) {
  260. $(this).val('');
  261. });
  262. var start = moment().subtract(29, 'days');
  263. var end = moment();
  264. function cb(start, end) {
  265. $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  266. }
  267. $('#reportrange').daterangepicker({
  268. startDate: start,
  269. endDate: end,
  270. "drops": "up",
  271. ranges: {
  272. 'Today': [moment(), moment()],
  273. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  274. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  275. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  276. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  277. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  278. }
  279. }, cb);
  280. cb(start, end);
  281. $('.input-daterange input').each(function() {
  282. $(this).datepicker();
  283. });
  284. $('#sandbox-container .input-daterange').datepicker({
  285. todayHighlight: true
  286. });
  287. $('.input-group-date-custom').datepicker({
  288. todayBtn: true,
  289. clearBtn: true,
  290. keyboardNavigation: false,
  291. forceParse: false,
  292. todayHighlight: true,
  293. defaultViewDate: {
  294. year: '2017',
  295. month: '01',
  296. day: '01'
  297. }
  298. });
  299. $('.multiple-select').datepicker({
  300. todayBtn: true,
  301. clearBtn: true,
  302. multidate: true,
  303. keyboardNavigation: false,
  304. forceParse: false,
  305. todayHighlight: true,
  306. defaultViewDate: {
  307. year: '2017',
  308. month: '01',
  309. day: '01'
  310. }
  311. });
  312. $('#config-demo').daterangepicker({
  313. "singleDatePicker": true,
  314. "showDropdowns": true,
  315. "timePicker": true,
  316. "timePicker24Hour": true,
  317. "timePickerSeconds": true,
  318. "showCustomRangeLabel": false,
  319. "alwaysShowCalendars": true,
  320. "startDate": "11/30/2016",
  321. "endDate": "12/06/2016",
  322. "drops": "up"
  323. }, function(start, end, label) {
  324. console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
  325. });
  326. });
  327. // Date-dropper js start
  328. $("#dropper-default").dateDropper({
  329. dropWidth: 200,
  330. dropPrimaryColor: "#1abc9c",
  331. dropBorder: "1px solid #1abc9c"
  332. }),
  333. // Date-dropper js end
  334. // Mini-color js start
  335. $('.demo').each(function() {
  336. //
  337. // Dear reader, it's actually very easy to initialize MiniColors. For example:
  338. //
  339. // $(selector).minicolors();
  340. //
  341. // The way I've done it below is just for the demo, so don't get confused
  342. // by it. Also, data- attributes aren't supported at this time...they're
  343. // only used for this demo.
  344. //
  345. $(this).minicolors({
  346. control: $(this).attr('data-control') || 'hue',
  347. defaultValue: $(this).attr('data-defaultValue') || '',
  348. format: $(this).attr('data-format') || 'hex',
  349. keywords: $(this).attr('data-keywords') || '',
  350. inline: $(this).attr('data-inline') === 'true',
  351. letterCase: $(this).attr('data-letterCase') || 'lowercase',
  352. opacity: $(this).attr('data-opacity'),
  353. position: $(this).attr('data-position') || 'bottom left',
  354. swatches: $(this).attr('data-swatches') ? $(this).attr('data-swatches').split('|') : [],
  355. change: function(value, opacity) {
  356. if (!value) return;
  357. if (opacity) value += ', ' + opacity;
  358. if (typeof console === 'object') {
  359. console.log(value);
  360. }
  361. },
  362. theme: 'bootstrap'
  363. });
  364. });
  365. // Mini-color js ends
  366. });