Plugin Directory

Changeset 3299976


Ignore:
Timestamp:
05/24/2025 05:56:58 PM (10 months ago)
Author:
Avram
Message:

tagging version 0.2

Location:
maia-multipurpose-ai-assistant
Files:
5 edited
7 copied

Legend:

Unmodified
Added
Removed
  • maia-multipurpose-ai-assistant/tags/0.2/assets/css/maia.css

    r3299779 r3299976  
    1818  z-index: 99999999;
    1919  font-family: sans-serif;
     20}
     21
     22#maia-chat-bubble pre {
     23  border: 1px #666 solid;
     24  max-width: 100%;
     25  padding: 5px;
     26  background: rgba(0,0,0,.07);
     27}
     28
     29#maia-chat-bubble pre code {
     30  white-space: pre-wrap;
     31  word-break: break-word;
     32  background-color: transparent;
    2033}
    2134
  • maia-multipurpose-ai-assistant/tags/0.2/assets/js/admin.js

    r3299787 r3299976  
    1212      PuterUser = user;
    1313    });
     14  }
    1415
    15   }
     16  jQuery(document).on('mouseover', '#maia-chat-bubble pre', function() {
     17    if (jQuery(this).find('.maia-copy-btn').length === 0) {
     18      const $btn = jQuery('<button class="maia-copy-btn" style="position:absolute;top:5px;right:5px;z-index:1;">'+MaiaData.translations.copy+'</button>');
     19      jQuery(this).css('position', 'relative').append($btn);
     20
     21      $btn.on('click', function(e) {
     22        e.stopPropagation();
     23        const codeText = jQuery(this).siblings('code').text();
     24
     25        if (navigator.clipboard && navigator.clipboard.writeText) {
     26          navigator.clipboard.writeText(codeText).then(() => {
     27            jQuery(this).text(MaiaData.translations.copied);
     28            setTimeout(() => jQuery(this).text(MaiaData.translations.copy), 1200);
     29          }).catch(() => {
     30            alert(MaiaData.translations.copy_failed);
     31          });
     32        } else {
     33          // Fallback for unsupported browsers
     34          const tempTextarea = jQuery('<textarea>').val(codeText).css({
     35            position: 'absolute',
     36            left: '-9999px'
     37          });
     38          jQuery('body').append(tempTextarea);
     39          tempTextarea.select();
     40          try {
     41            document.execCommand('copy');
     42            jQuery(this).text(MaiaData.translations.copied);
     43            setTimeout(() => jQuery(this).text(MaiaData.translations.copy), 1200);
     44          } catch (err) {
     45            alert(MaiaData.translations.copy_failed);
     46          }
     47          tempTextarea.remove();
     48        }
     49      });
     50    }
     51  });
     52
     53  jQuery(document).on('mouseout', '#maia-chat-bubble pre', function(e) {
     54    if (!jQuery(e.relatedTarget).hasClass('maia-copy-btn')) {
     55      jQuery(this).find('.maia-copy-btn').remove();
     56    }
     57  });
     58
    1659});
    1760
  • maia-multipurpose-ai-assistant/tags/0.2/maia-multipurpose-ai-assistant.php

    r3299779 r3299976  
    55 * Description: A free WordPress plugin that provides a multipurpose AI assistant for content creation and website management. Powered by Puter.com free AI.
    66 * Author: Nemanja Avramović
    7  * Version: 0.1
     7 * Version: 0.2
    88 * Author URI: https://avramovic.info
    99 * License: MIT
     
    249249        'signout'        => __('Sign out (%s)', 'maia-multipurpose-ai-assistant'),
    250250        'rename_message' => __('Enter new title for discussion', 'maia-multipurpose-ai-assistant'),
     251        'copy'           => __('Copy', 'maia-multipurpose-ai-assistant'),
     252        'copied'         => __('Copied!', 'maia-multipurpose-ai-assistant'),
     253        'copy_failed'    => __('Failed to copy text.', 'maia-multipurpose-ai-assistant'),
    251254      ]
    252255    ]);
  • maia-multipurpose-ai-assistant/tags/0.2/readme.txt

    r3299968 r3299976  
    66Requires PHP: 7.4
    77License: MIT
    8 Stable tag: 0.1
    9 Version: 0.1
     8Stable tag: 0.2
     9Version: 0.2
    1010Donate link: https://paypal.me/avramator
    1111
     
    6363== Changelog ==
    6464
     65**0.2**
     66- improved code rendering in chat
     67- added button to code snippets to copy to clipboard
     68
    6569**0.1**
    6670- initial release
  • maia-multipurpose-ai-assistant/trunk/assets/css/maia.css

    r3299779 r3299976  
    1818  z-index: 99999999;
    1919  font-family: sans-serif;
     20}
     21
     22#maia-chat-bubble pre {
     23  border: 1px #666 solid;
     24  max-width: 100%;
     25  padding: 5px;
     26  background: rgba(0,0,0,.07);
     27}
     28
     29#maia-chat-bubble pre code {
     30  white-space: pre-wrap;
     31  word-break: break-word;
     32  background-color: transparent;
    2033}
    2134
  • maia-multipurpose-ai-assistant/trunk/assets/js/admin.js

    r3299787 r3299976  
    1212      PuterUser = user;
    1313    });
     14  }
    1415
    15   }
     16  jQuery(document).on('mouseover', '#maia-chat-bubble pre', function() {
     17    if (jQuery(this).find('.maia-copy-btn').length === 0) {
     18      const $btn = jQuery('<button class="maia-copy-btn" style="position:absolute;top:5px;right:5px;z-index:1;">'+MaiaData.translations.copy+'</button>');
     19      jQuery(this).css('position', 'relative').append($btn);
     20
     21      $btn.on('click', function(e) {
     22        e.stopPropagation();
     23        const codeText = jQuery(this).siblings('code').text();
     24
     25        if (navigator.clipboard && navigator.clipboard.writeText) {
     26          navigator.clipboard.writeText(codeText).then(() => {
     27            jQuery(this).text(MaiaData.translations.copied);
     28            setTimeout(() => jQuery(this).text(MaiaData.translations.copy), 1200);
     29          }).catch(() => {
     30            alert(MaiaData.translations.copy_failed);
     31          });
     32        } else {
     33          // Fallback for unsupported browsers
     34          const tempTextarea = jQuery('<textarea>').val(codeText).css({
     35            position: 'absolute',
     36            left: '-9999px'
     37          });
     38          jQuery('body').append(tempTextarea);
     39          tempTextarea.select();
     40          try {
     41            document.execCommand('copy');
     42            jQuery(this).text(MaiaData.translations.copied);
     43            setTimeout(() => jQuery(this).text(MaiaData.translations.copy), 1200);
     44          } catch (err) {
     45            alert(MaiaData.translations.copy_failed);
     46          }
     47          tempTextarea.remove();
     48        }
     49      });
     50    }
     51  });
     52
     53  jQuery(document).on('mouseout', '#maia-chat-bubble pre', function(e) {
     54    if (!jQuery(e.relatedTarget).hasClass('maia-copy-btn')) {
     55      jQuery(this).find('.maia-copy-btn').remove();
     56    }
     57  });
     58
    1659});
    1760
  • maia-multipurpose-ai-assistant/trunk/maia-multipurpose-ai-assistant.php

    r3299779 r3299976  
    55 * Description: A free WordPress plugin that provides a multipurpose AI assistant for content creation and website management. Powered by Puter.com free AI.
    66 * Author: Nemanja Avramović
    7  * Version: 0.1
     7 * Version: 0.2
    88 * Author URI: https://avramovic.info
    99 * License: MIT
     
    249249        'signout'        => __('Sign out (%s)', 'maia-multipurpose-ai-assistant'),
    250250        'rename_message' => __('Enter new title for discussion', 'maia-multipurpose-ai-assistant'),
     251        'copy'           => __('Copy', 'maia-multipurpose-ai-assistant'),
     252        'copied'         => __('Copied!', 'maia-multipurpose-ai-assistant'),
     253        'copy_failed'    => __('Failed to copy text.', 'maia-multipurpose-ai-assistant'),
    251254      ]
    252255    ]);
  • maia-multipurpose-ai-assistant/trunk/readme.txt

    r3299968 r3299976  
    66Requires PHP: 7.4
    77License: MIT
    8 Stable tag: 0.1
    9 Version: 0.1
     8Stable tag: 0.2
     9Version: 0.2
    1010Donate link: https://paypal.me/avramator
    1111
     
    6363== Changelog ==
    6464
     65**0.2**
     66- improved code rendering in chat
     67- added button to code snippets to copy to clipboard
     68
    6569**0.1**
    6670- initial release
Note: See TracChangeset for help on using the changeset viewer.