Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • C0Rrupt replied on the discussion topic New Icons Moved to Wrong Folder Location
    For what it's worth, the filedrop function used in hypeGallery must be a different method because it saves new icons in the "...<owner_guid>/icons" folder.  I've spent a lot of time comparing the two... view reply
  • C0Rrupt replied on the discussion topic Clone datepicker and dropzone
    For the sake of others, here is how I implemented your recommendation: /** plugin/start**/ elgg_register_event_handler('init','system','plugin_init'); function plugin_init() {... view reply
  • C0Rrupt added a new discussion topic New Icons Moved to Wrong Folder Location in the group Beginning Developers
    I recently upgraded to elgg 2.3.4 accompanied by an upgrade from elgg_dropzone to hypeDropzone 5.0.1.  In previous versions, image icons were saved to the folder "data/<site_guid>/<owner_guid>/icons" when I use...
    • Maybe not an issue with hypeDropzone alone. It looks like Elgg itself creates these extra folders. While trying to understand what your problem is I noticed that these extra folders seem to appear on uploading files with the bundled Files plugin (and not only on image uploads but with all kinds of files). I suspect it is connected with the new file upload API introduced in Elgg 2.3. Maybe the upload process does not clean up completely after the work is done.

    • For what it's worth, the filedrop function used in hypeGallery must be a different method because it saves new icons in the "...<owner_guid>/icons" folder.  I've spent a lot of time comparing the two plugins to discern what's different, but it exhausted my skill set.  Passing 'action' => 'action/gallery/upload/filedrop' to the input/dropzone view allows hypeGallery to control the upload and to put the icons where they should be.

  • C0Rrupt replied on the discussion topic Clone datepicker and dropzone
    Thanks.  Great detail.  I'll try it out. view reply
  • C0Rrupt replied on the discussion topic Clone datepicker and dropzone
    That sounds ... sophisticated.  Even though it may not be the best strategy, could you help me deal with it by cloning instead?  That, or perhaps show me how to render everything server side and use ajax API to load the view and... view reply
  • C0Rrupt added a new discussion topic Clone datepicker and dropzone in the group Beginning Developers
    I have a single form to allow a user to add a series of events.  Each event can include dates, pictures and files.  When a user clicks a button, a jQuery function clones the code for a new event and inserts it below existing events....
    • // start.php
      elgg_register_plugin_hook_handler('init', 'system', function() {
         elgg_register_ajax_view('partials/form_elements');
      });
      

       

      // views/default/partials/form_elements.php
      echo elgg_view_field([
         '#type' => 'date',
      ]);
      
      echo elgg_view_field([
         '#type' => 'dropzone',
      ]);
      
      // if using third-party input views, make sure the initialize their scripts inline
      // require(['third-party-input']);
      // and not using elgg_require_js(), because currently those are not intialized on
      // ajax requests

       

      // partial/form_elements.js
      define(function(require) {
      
         var $ = require('jquery');
         var Ajax = require('elgg/Ajax');
      
         $(document).on('click', '.trigger-element', function(e) {
             e.preventDefault();
      
             var ajax = new Ajax();
             ajax.view('partials/form_elements').done(function(output) {
                $('.placeholder').append($(output));
             });       
         }); 
      });
    • Thanks.  Great detail.  I'll try it out.

    • For the sake of others, here is how I implemented your recommendation:

      /** plugin/start**/
      
      elgg_register_event_handler('init','system','plugin_init');
      
      function plugin_init() {
      
         elgg_register_ajax_view('partials/testing');  //Register a view to be available for ajax calls
      
         elgg_require_js('js/testing');                //Request that Elgg load an AMD module onto the page
      
      }
      
      /**js/testing.js
      
        * Define function to fire when link is clicked
      
      **/
      
      
      define(function(require) {
      
      
         var $ = require('jquery');
      
         var Ajax = require('elgg/Ajax');
      
      
         $(document).on('click', '.trigger-element-testing', function(e) {
      
             e.preventDefault();
      
      
             var ajax = new Ajax();
      
         // Define variables to pass
      
             var field_type = $(this).data("element");                        // Extract field_type from <a ... data_element="<field_type>"</a>
      
             var entity     = $(this).attr("guid");                           // Extract entity guid from <a ... guid="<entity_guid>"</a>
      
             var cid        = "c"+Math.floor((Math.random()*200)+1);          // Create a random ID value
      
         
      
             ajax.view('partials/testing',{
      
              data: {                                                       // Pass variables to view
      
            element: field_type,
      
            guid: entity,
      
            cid: cid
      
              },
      
             }).done(function(output) {
      
                $('.placeholder').append($(output));                           // Insert the ajax view after <div class="placeholder"></div>
      
             });       
      
         }); 
      
      });
      
      /** site/start
        * 
      **/
      elgg_register_event_handler('init','system','site_init');
      
      function site_init() {
           $js_framework     = elgg_get_simplecache_url('js' , 'site/framework');
           elgg_require_js($js_framework);
      }
      
      /**js/site/framework.php**/
      
      $(document).ready(function(){
      
      $("a.collapser-testing").on("click", function(e) {
      
      e.preventDefault();
      
      $("<div>Collapser clicked</div>").dialog();
      
      });
      
      });
      
      /**partials/testing.php**/
      $element = elgg_extract('element', $vars);
      $guid    = elgg_extract('guid', $vars);
      $cid     = elgg_extract('cid', $vars);
      echo "<a class='collapser-testing' tabindex='-1'>Collapser</a><br>";
      /**display.testing.php**/
      
      echo '<a href="#" class="elgg-button-submit-element trigger-element-testing" rel="nofollow" data-element="date" guid="45467">+</a>
      
      Here:
      
      <div class="placeholder"><div>
      
      ';
      

       

  • C0Rrupt replied on the discussion topic Adding datepicker with jquery
    I'm sorry.  I wish the example would have made my solution apparent, but It didn't.  Honestly, I have tried: I've read the example code, read the elgg documentation on AMD and did research on implementing the AMD... view reply
  • C0Rrupt replied on the discussion topic Adding datepicker with jquery
    Thanks Ismayil.  I'm not sure how to use datepicker AMD module to initiate the fields.  I've looked over the documentation, but I'm sure I'm not seeing the most direct path to making this happen.  How would I change... view reply