Sha256: 90899c5edca016b9f29074579c76f800a13b54fe0d9a5a0ae916a16821842e9b

Contents?: true

Size: 1.99 KB

Versions: 8

Compression:

Stored size: 1.99 KB

Contents

module JQueryCheats
  require 'railtie' if defined?(Rails)
  require 'engine' if defined?(Rails)
  module HoverImage
    #class used to do a quick Hover image
    
    #class << self
      
    def mouseoverimage(initimage,hoverimage)
      cheats_image_tag =""
      cheats_image_tag = "<img src=\"#{initimage}\" alt=\"image\" onmouseover=\"$(this).attr('src','#{hoverimage}')\" onmouseout=\"$(this).attr('src','#{initimage}')\">"
      return cheats_image_tag.html_safe
    end
    
    def submitimage(imagepath,alt="Image Tag")
         button_tag = "<a href=\"#\" onclick=\"$('form').submit(); return false;\">
          <img src=\"#{imagepath}\" alt=\"#{alt}\"></a>".html_safe
          button_tag += "<script type=\"text/javascript\">
          $(document).ready(function(){
          $('html').keypress(function(e){
            if(e.which == 13){
             $('form').submit();
              return false;
              }
             });
             });</script>".html_safe
         return button_tag
    end
    
    def simplemolink(imagepath,link)
      hover_arry = imagepath.split('.')
      extension = hover_arry.pop
      newpath = hover_arry.join
      newlink = "<a href=\"#{link}\">#{self.mouseoverimage(imagepath,newpath+"-hover."+extension)}</a>".html_safe
      return newlink
    end
    
    def barchart(name,xmlurl)
      #create a new barchar div tag, class of jqplot is used to simplify jquery binding
      html = "<div id=\"#{name}\" class=\"barchart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
      #we will have to relly on XML to get the rest of the data...
    end
    
    def piechart(name,xmlurl)
      #create a new barchar div tag, class of jqplot is used to simplify jquery binding
      html = "<div id=\"#{name}\" class=\"piechart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
      #we will have to relly on XML to get the rest of the data...
    end
    
    def initialize
     
    end
    
    #end#end self
    
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jquery_cheats-5.1.3 lib/jquery_cheats/jquery_cheats.rb
jquery_cheats-5.1.2 lib/jquery_cheats/jquery_cheats.rb
jquery_cheats-5.1.1 lib/jquery_cheats/jquery_cheats.rb
jquery_cheats-5.1.0 lib/jquery_cheats/jquery_cheats.rb
jquery_cheats-3.0.0 lib/jquery_cheats.rb
jquery_cheats-2.3.0 lib/jquery_cheats.rb
jquery_cheats-2.2.1 lib/jquery_cheats.rb
jquery_cheats-2.2.0 lib/jquery_cheats.rb