Sha256: ab488981f7bbf76c0a71954fdc83f991040d8762260bf5aecda377a0cb896b5c

Contents?: true

Size: 947 Bytes

Versions: 3

Compression:

Stored size: 947 Bytes

Contents

function erb(variable){
  var something = document.getElementById("vueonrails-" + variable).getAttribute("data-" + variable)
  console.log(something)
  return something
}

function isView(pageClassString){
  if(pageClassString == "###") return
  if(pageClassString != "") pageClassString = pageClassString.replace(/#/g , " ");
  return document.getElementsByClassName(pageClassString).length == 1
}

function puts(obj){
  console.log({obj})
}

function p(obj){
  console.log({obj})
}

function addClass(identifier, className){
  document.getElementById(identifier).classList.addClass(className)
}

function toggleClass(identifier, className){
  document.getElementById(identifier).classList.toggle(className)
}

function table(obj){
  console.table(obj)
}

function titleize(str){
  return str.replace(/\b\S/g, function(t) { return t.toUpperCase() });
}

function isArray(obj){
  return Object.prototype.toString.call(obj) === '[object Array]' ;
}

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
vueonrails-0.1.0 vendor/assets/javascripts/vueonrails.js
vuejs-1.1.0.beta9 vendor/assets/javascripts/vue-on-rails.js
vuejs-1.1.0.beta8 vendor/assets/javascripts/vue-on-rails.js