agile_rails 0.0.0.2 → 0.0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18dcbd28e6f1f0d840016fadd4a0ffc75da43233dac60f772b67d36de0a9f534
4
- data.tar.gz: 19c2c9e047772cf7e26ad2073093803f9dd090cde50090931041ba94dfcd5a54
3
+ metadata.gz: 004d896158c15a3bd616b5a24becafb32262ff1ceb23a97930dbe3168ddaaf76
4
+ data.tar.gz: e1844cf07c5bdac2bf48fb60bebcb4c197e5ac3813e7a64284234133c06d3ca6
5
5
  SHA512:
6
- metadata.gz: 3db8f8adb6b0e7c495cc43c2fe08e6f699ac69efda6371ff24cf9afe769b890637f4f962b3352501ab2d5fcdcaba147e6400411c27865af480df3582abb26a8c
7
- data.tar.gz: 7824f2db93018f2f72f8247e76af3b3c83172be2a9a0b2ff9985199cc7ae219746af44cee0425261f263ae05dc3f4e5f8bc0ddc0e85a7795ed982c7e5a72d29e
6
+ metadata.gz: 495f5368cac1d2d03d774e9dc07d81cc95977fb2f489e3cf3c7515d312455141423459b540175623a2b3bb12bc319f3738b32c35ed78dcaeb7ea08408da445f6
7
+ data.tar.gz: f6a159a3018b33fbf3a97501cb8d45f303fc90aea61038ad0d62c126ad523966eab5501b72f7e3bddf07221af8ea4fa0823155eeb549ebcc1951c71107c24664
data/README.md CHANGED
@@ -249,7 +249,7 @@ agile_rails_html_editor gem.
249
249
 
250
250
  Installation
251
251
  ------------
252
- Go and [jumpstart](https://github.com/agile-rails/startup/README.md)
252
+ Go and [jumpstart](https://github.com/agile-rails/startup)
253
253
  Intranet portal application with AgileRails in just few minutes.
254
254
 
255
255
  Compatibility
@@ -348,6 +348,10 @@ process_json_result = function(json) {
348
348
  case 'parenturl':
349
349
  parent.location.href = value;
350
350
  break;
351
+ case 'iframeurl':
352
+ let [iframe, url] = value.split(";");
353
+ document.getElementById(iframe).src = url
354
+ break;
351
355
  case 'alert':
352
356
  alert(value);
353
357
  break;
@@ -532,6 +536,7 @@ function handleIframeFocus(){
532
536
 
533
537
  var active_iframe = null;
534
538
  */
539
+ let timeoutId = null;
535
540
 
536
541
  /*******************************************************************
537
542
  * Events start here
@@ -1008,7 +1013,33 @@ $(document).ready( function() {
1008
1013
  }
1009
1014
  });
1010
1015
 
1011
- /*******************************************************************
1016
+ /*******************************************************************
1017
+ * Help text is displayed as title when mouse hovered over label.
1018
+ * This was not wery obvious so, help icon was added to label
1019
+ * and help text is also displayed if user clicks on label text.
1020
+ *******************************************************************/
1021
+ $('.ar-form-label').on('click', function(e) {
1022
+ let titleText = $(this).attr('title');
1023
+ if (!titleText || titleText == ' ' ) return;
1024
+
1025
+ $('#popup')
1026
+ .text(titleText)
1027
+ .css({
1028
+ left: e.pageX + 10 + 'px',
1029
+ top: e.pageY + 10 + 'px',
1030
+ display: 'block'
1031
+ });
1032
+ $('#popup').addClass('tooltip');
1033
+
1034
+ if (timeoutId) clearTimeout(timeoutId);
1035
+ timeoutId = setTimeout(function () {
1036
+ $('#popup').css({display: 'none'});
1037
+ $('#popup').removeClass('tooltip');
1038
+ timeoutId = null;
1039
+ }, 3000);
1040
+ });
1041
+
1042
+ /*******************************************************************
1012
1043
  * It is not possible to attach any data to submit button except the text
1013
1044
  * that is written on a button and it is therefore very hard to distinguish
1014
1045
  * which button was pressed when more than one button is present on a form.
@@ -1380,10 +1411,8 @@ $(document).ready( function() {
1380
1411
  $('.filter-popup').hide();
1381
1412
  return;
1382
1413
  }
1383
- // retrieve name of current field and set it in popup
1384
- let header = $(this).closest('.th');
1385
- let field_name = header.attr("data-name");
1386
- $('.filter-popup').attr('data-name', field_name);
1414
+ let field_name = $(this).attr("data-filter")
1415
+ $('.filter-popup').attr('data-filter', field_name);
1387
1416
  // change popup position and show
1388
1417
  $('.filter-popup').css({'top': e.pageY + 5, 'left': e.pageX, 'position': 'absolute'});
1389
1418
  $('.filter-popup').show();
@@ -1397,7 +1426,7 @@ $(document).ready( function() {
1397
1426
  let url = $(this).data('url');
1398
1427
  let operator = $(this).data('operator');
1399
1428
  let parent = $(this).closest('.filter-popup');
1400
- let field_name = parent.data("name");
1429
+ let field_name = parent.data("filter");
1401
1430
 
1402
1431
  url = url + '&filter_field=' + field_name + '&filter_oper=' + operator;
1403
1432
  simple_ajax_call(url);
@@ -1420,26 +1449,49 @@ $(document).ready( function() {
1420
1449
  });
1421
1450
 
1422
1451
  /*******************************************************************
1423
- * Iframe lost focus. Save data
1452
+ * On firefox number input field does not get focus, when up-down arrows are clicked. Ensure focus.
1424
1453
  *******************************************************************/
1454
+ $('#kaminari-jump #topage').on('input', function(e) {
1455
+ const field = $('#kaminari-jump #topage');
1456
+ if (document.activeElement !== field) {
1457
+ console.log(field);
1458
+ field.focus();
1459
+ }
1460
+ });
1461
+
1462
+ /*******************************************************************
1463
+ * Loosing focus in kaminari page input field will trigger jump to the page
1464
+ *******************************************************************/
1465
+ $('#kaminari-jump #topage').on('focusout', function(e) {
1466
+ const field = $('#kaminari-jump #topage');
1467
+ const val = Number(field.val())
1468
+ const max = Number(field.attr('max'))
1469
+
1470
+ if (val > max) field.val(max);
1471
+ document.getElementById('kaminari-jump').submit();
1472
+ });
1473
+
1474
+ /*******************************************************************
1475
+ * Iframe lost focus. Save data
1476
+ ******************************************************************
1425
1477
  $('.iframe_embedded').on('focusout', function(e) {
1426
1478
  console.log('focus out');
1427
1479
  });
1428
1480
 
1429
1481
  /*******************************************************************
1430
1482
  * Iframe lost focus. Save data
1431
- *******************************************************************/
1483
+ ******************************************************************
1432
1484
  $('.iframe_embedded').on('focus', function(e) {
1433
1485
  console.log('focus');
1434
1486
  });
1435
1487
 
1436
1488
  /*******************************************************************
1437
1489
  * Iframe lost focus. Save data
1438
- *******************************************************************/
1490
+ ******************************************************************
1439
1491
  $('.iframe_embedded').on('blur', function(e) {
1440
1492
  console.log('blur');
1441
1493
  });
1442
-
1494
+ */
1443
1495
  });
1444
1496
 
1445
1497
  /*******************************************************************