Rune Grønkjærs Blog
Abonnér på mit feed

Curriculum Vitae v1.1

I have written a javascript class that contains information from a CV. It has some helpfull methods to enable the user to print the data into the DOM. A jQuery plugin have been created to combine my CV class and jQuery. I use a template pattern to write the CV data into html.

CV class

CV = function() { };

CV.prototype.fillTemplate = function(jQTemplate) {
  var marker = jQuery('
'); for (var key in this) { this.runThroughInfo(jQTemplate.find('.' + key), this[key], marker); } marker.remove(); }; CV.prototype.runThroughInfo = function(jQTemplate, infoArr, marker) { jQTemplate.after(marker); jQTemplate.remove(); for (var i = 0; i < infoArr.length; i++) { var clone = jQTemplate.clone(); marker.after(clone); for (var key in infoArr[i]) { this.insertInfo(clone.find('.' + key), infoArr[i][key]); } } };

writeCV jQuery Plugin

jQuery.fn.writeCV = function(cv) {
  if (this[0]) {
    this.each(function() {
      cv.fillTemplate(jQuery(this));
    });
  }
  return this;
};

jQuery document Ready

jQuery(function() {
  var externals = jQuery('#RunesCV').find('a').not('[href^="http://rune.gronkjaer.dk"]');
  for (var i = 0; i < externals.length; i++) {
    externals[i].removeAttribute('onclick');
  }
  jQuery('#TranslateCV').click(translateCV);
  jQuery('#CommentCV').click(function() {
    jQuery('#TranslateCV').click(translateCV);

    jQuery('#RunesCV').css('display', 'none');
    jQuery('#CVHtml').remove();
    var runesCVMedKommentarer = jQuery('#RunesCVMedKommentarer').css('display', 'block');
    jQuery('html, body').animate({
      scrollTop: runesCVMedKommentarer.offset().top
    }, 1000);
  });
});

function translateCV() {
  var cvHtml = jQuery('#CVHtml');
  if (!cvHtml[0]) {
    var runesCV = new CV();
    runesCV.address =  [{
                              name: 'Rune Oellgaard Groenkjaer',
                              street: 'Nygårdparken 45',
                              zipCity: '7400 Herning',
                              mobile: '30268797'
                        }];
    runesCV.qualifications = [{ primaryCompetencies: ['Advanced website development',
                                                      'Advanced grafical user interfaces for the web',
                                                      'ASP.NET and javascript',
                                                      'Umbraco CMS',
                                                      'Dynamicweb CMS'],
                                secondaryCompetencies: 'SQL, LINQ, CSS, XHTML, AJAX.NET, Custom ajax, Photoshop, Dynamicweb implementation, Dynamicweb ecommerce'
                             }];
    runesCV.workExperience = [{ place: 'Co3 A/S',
                                job: 'Webdeveloper',
                                period: '2007 - ?'
                             }];
    runesCV.education = [{ place: 'Erhvervsakademi midtjylland',
                           educationName: 'Graduate in Computer Science',
                           period: '2005 – 2007',
                           focus: 'ASP.NET'
                         },
                         { place: 'IT-akademi midtjylland',
                           educationName: 'Multimedia designer',
                           period: '2001 – 2003',
                           focus: 'Usability and design'
                         },
                         { place: 'Vestjyllands handelsskole',
                           educationName: 'higher commercial examination',
                           period: '1997 – 2000',
                           focus: 'Mathematics'}];
    runesCV.languages = [{ language: 'English',
                           level: 'Read, write and speak'
                         },
                         { language: 'German',
                           level: 'basic knowledge'}];
    runesCV.ITKnowledge = [{ general: 'Pretty high qualifications'}];

    jQuery('#RunesCV, #RunesCVMedKommentarer').css('display', 'none');
    var cvTemplate = jQuery('#RunesCVTemplate');
    cvHtml = cvTemplate.writeCV(runesCV);
    cvHtml.attr('id', 'CVHtml').css('display', 'block');
    cvTemplate.after(cvHtml);
    jQuery('html, body').animate({
      scrollTop: cvHtml.offset().top
    }, 1000);
  }       
}

Don't understand my CV?

Try it with comments:

Or give up and translate my CV by running the above scripts:


Dansk version