GithubHelp home page GithubHelp logo

hallo_rails's People

Contributors

elliotlaster avatar ncri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hallo_rails's Issues

Error after HalloRails.init()

Hello,

I'm getting an error after HalloRails.ini();

TypeError: jQuery(...).data(...) is undefined @ http://localhost:3000/assets/application.js:28262

It happens in the line cleanup = ...

   getContents: function() {
        var cleanup, contentClone, plugin;
        contentClone = this.element.clone();
        for (plugin in this.options.plugins) {
          cleanup = jQuery(this.element).data('IKS-' + plugin).cleanupContentClone;
          if (!jQuery.isFunction(cleanup)) {
            continue;
          }
          jQuery(this.element)[plugin]('cleanupContentClone', contentClone);
        }
        return contentClone.html();
      },

HalloRails.init(); is called in $(document).ready, I added all requirements to the application.js and added the requirements to the stylesheets.

All I see is "Click to Edit" when I hover the elemens, but nothing happens.
hallo

I don't understand, whats the problem or what is missing here...

Missing SCSS mixins and notice about dependency of jQuery UI

Hi,

after installing the gem, I received the error message of missing mixins border-radius and opacity.
I fixed this by adding

@mixin border-radius($radius:20px) {
  -webkit-border-radius: $radius;
  -moz-border-radius: $radius;
  border-radius: $radius;
}

@mixin opacity($value) {
  opacity: $value;
}

before @import 'hallo_rails';

Also you could add a notice in your readme, that jQuery UI is used.
Otherwise theres a syntax error 'jquery.Widget is not a function'.

Greets

Questions about your gem

Hi,
Thanks for setting a version of hallo for rails. I was thinking of using the hallo.js version on my rails and found your gem.
I got 2 questions and was wondering if you can help me on it? Thanks. :- )

  1. Any idea why i got this error and how can i fix it?
    "Uncaught TypeError: Cannot read property 'cleanupContentClone' of undefined"

I might have miss out a step while implementing it. :- )

Here is just a basic call in my erb view:

<%= editable @current_user, :name, update_url: "my_own/url/to_update/the/model" %>
<%= form_editable @current_user, :name  %>
<script>
             jQuery(function() {
                     return HalloRails.init();
             });
 </script>
Error Logs:
=============================================================
Uncaught TypeError: Cannot read property 'cleanupContentClone' of undefined halo.js:191
jQuery.widget.getContents halo.js:191
(anonymous function) jquery-ui-1.9.2.custom.dark-hive.js:432
jQuery.widget._create halo.js:61
(anonymous function) jquery-ui-1.9.2.custom.dark-hive.js:432
$.Widget._createWidget jquery-ui-1.9.2.custom.dark-hive.js:597
$.(anonymous function).(anonymous function) jquery-ui-1.9.2.custom.dark-hive.js:396
(anonymous function) jquery-ui-1.9.2.custom.dark-hive.js:541
jQuery.extend.each jquery-7c8529c81142f97fe8e691cad80449a1.js:612
jQuery.fn.jQuery.each jquery-7c8529c81142f97fe8e691cad80449a1.js:242
$.fn.(anonymous function) jquery-ui-1.9.2.custom.dark-hive.js:536
(anonymous function) halo-rails.js:71
jQuery.extend.each jquery-7c8529c81142f97fe8e691cad80449a1.js:612
jQuery.fn.jQuery.each jquery-7c8529c81142f97fe8e691cad80449a1.js:242
attach_editors halo-rails.js:63
init halo-rails.js:18
(anonymous function)
fire jquery-7c8529c81142f97fe8e691cad80449a1.js:974
self.add jquery-7c8529c81142f97fe8e691cad80449a1.js:1017
jQuery.fn.jQuery.ready jquery-7c8529c81142f97fe8e691cad80449a1.js:247
jQuery.fn.jQuery.init jquery-7c8529c81142f97fe8e691cad80449a1.js:175
jQuery jquery-7c8529c81142f97fe8e691cad80449a1.js:45
(anonymous function)
(anonymous function) jquery-7c8529c81142f97fe8e691cad80449a1.js:565
jQuery.extend.globalEval jquery-7c8529c81142f97fe8e691cad80449a1.js:566
(anonymous function) jquery-7c8529c81142f97fe8e691cad80449a1.js:5806
=============================================================
  1. Another question if you could help me on:
    i'm trying to get your gem to fit my current form and how will this works with both model attribute ( title & description)?
    I was wondering if i can submit it when the user click on the submit create button after they are done with the editing just like the demo in this link:

http://createjs.org/demo/hallo/

I tried using bind but i could not figure out how to pass the data.content
up to the ajax jquery script to be send to my rails controller?
I'm a new bie so please bare with me if this is pretty simple to do :- )

jQuery('.description').bind('hallomodified', function(event, data) {
       jQuery('#modified').html("Editables modified");
          console.log("New contents are " + data.content); 
}
<%=  form_for(:article, :html => { :id =>"article-creation-form" }, 
              :url => article_creation_configure_path(@current_user), 
                      :remote => true ) do |f|  %>

      <%= f.text_field :title,
                              :id => 'title',
                              :placeholder => 'Customize your title.' %>

      <%= f.text_area  :descriptions, 
                   :id => 'description', 
                   :rows =>"3",
                   :placeholder => 'Customize your descriptions.' %> 

    <div class="create-article-button-container">
               <%= f.submit t(:create_article), :class => "create-article-button" %> 
               <div id="article-result"></div>
    </div>    
<% end %>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.