jqgrid_utils 1.26.3 → 1.26.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.
@@ -1556,7 +1556,7 @@ async subgrid(_id, id, url, col_model, caption='' )
1556
1556
  @param {int} - size of the picture
1557
1557
  @param {bolen} - image path should be a link
1558
1558
  @example
1559
- col_model = await jqu.add_image(col_model, 'image', 60, false);
1559
+ col_model = await jqu.add_image(col_model, image_field, 60, false);
1560
1560
  */
1561
1561
  async add_image(col_model, edit_field, size, link=false)
1562
1562
  {
@@ -1567,22 +1567,23 @@ async add_image(col_model, edit_field, size, link=false)
1567
1567
  for (let i = 0; i < col_model.length; i++)
1568
1568
  {
1569
1569
  if (col_model[i]['name'] === edit_field)
1570
- {
1570
+ {
1571
1571
  col_model[i]['picture'] = true;
1572
1572
  col_model[i]['width'] = size;
1573
1573
  col_model[i]['height'] = size;
1574
1574
  col_model[i]['formatter'] = function(cell_val)
1575
1575
  {
1576
- const cell_val2 = cell_val.toLowerCase();
1576
+ const cell_val2 = cell_val.toLowerCase();
1577
+
1577
1578
  if(cell_val2.startsWith('https://', 0) || cell_val2.startsWith('http://', 0) )
1578
1579
  {
1579
- if(cell_val2.endsWith(".png") ||
1580
- cell_val2.endsWith(".jpg") ||
1581
- cell_val2.endsWith(".jpeg") ||
1582
- cell_val2.endsWith(".gif") ||
1583
- cell_val2.endsWith(".svg") ||
1584
- cell_val2.endsWith(".svgz") ||
1585
- cell_val2.endsWith(".webp"))
1580
+ if(cell_val2.includes(".png") ||
1581
+ cell_val2.includes(".jpg") ||
1582
+ cell_val2.includes(".jpeg") ||
1583
+ cell_val2.includes(".gif") ||
1584
+ cell_val2.includes(".svg") ||
1585
+ cell_val2.includes(".svgz") ||
1586
+ cell_val2.includes(".webp"))
1586
1587
  {
1587
1588
  if(link)
1588
1589
  {
package/jqgrid_utils.js CHANGED
@@ -1555,7 +1555,7 @@ async subgrid(_id, id, url, col_model, caption='' )
1555
1555
  @param {int} - size of the picture
1556
1556
  @param {bolen} - image path should be a link
1557
1557
  @example
1558
- col_model = await jqu.add_image(col_model, 'image', 60, false);
1558
+ col_model = await jqu.add_image(col_model, image_field, 60, false);
1559
1559
  */
1560
1560
  async add_image(col_model, edit_field, size, link=false)
1561
1561
  {
@@ -1566,22 +1566,23 @@ async add_image(col_model, edit_field, size, link=false)
1566
1566
  for (let i = 0; i < col_model.length; i++)
1567
1567
  {
1568
1568
  if (col_model[i]['name'] === edit_field)
1569
- {
1569
+ {
1570
1570
  col_model[i]['picture'] = true;
1571
1571
  col_model[i]['width'] = size;
1572
1572
  col_model[i]['height'] = size;
1573
1573
  col_model[i]['formatter'] = function(cell_val)
1574
1574
  {
1575
- const cell_val2 = cell_val.toLowerCase();
1575
+ const cell_val2 = cell_val.toLowerCase();
1576
+
1576
1577
  if(cell_val2.startsWith('https://', 0) || cell_val2.startsWith('http://', 0) )
1577
1578
  {
1578
- if(cell_val2.endsWith(".png") ||
1579
- cell_val2.endsWith(".jpg") ||
1580
- cell_val2.endsWith(".jpeg") ||
1581
- cell_val2.endsWith(".gif") ||
1582
- cell_val2.endsWith(".svg") ||
1583
- cell_val2.endsWith(".svgz") ||
1584
- cell_val2.endsWith(".webp"))
1579
+ if(cell_val2.includes(".png") ||
1580
+ cell_val2.includes(".jpg") ||
1581
+ cell_val2.includes(".jpeg") ||
1582
+ cell_val2.includes(".gif") ||
1583
+ cell_val2.includes(".svg") ||
1584
+ cell_val2.includes(".svgz") ||
1585
+ cell_val2.includes(".webp"))
1585
1586
  {
1586
1587
  if(link)
1587
1588
  {
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  {
30
30
  "test": "echo \"Error: no test specified\" && exit 1"
31
31
  },
32
- "version": "1.26.3"
32
+ "version": "1.26.4"
33
33
  }