'use strict';

/**
 * @ngdoc function
 * @name helmeditor2App.controller:PrototypeCtrl
 * @description
 * # PrototypeCtrl
 * Controller of the helmeditor2App
 */
angular.module('helmeditor2App')
  .controller('PrototypeCtrl', ['$scope', '$http', 'webservice', function ($scope, $http, webservice) {
    this.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Karma'
    ];

  	/* Variables related to the prototype code in HTML */
  	$scope.polyTypes = [
      { value: 'PEPTIDE', label:'PEPTIDE' },
      { value: 'RNA', label:'RNA/DNA' }
  	];
  	$scope.polymerType = $scope.polyTypes[0];
  	$scope.result = '';
  	$scope.imageUrl = '';

  	/* Event processing prototype - invoke factory function to get HELM notation */   
  	$scope.getHelmNotation = function (polymerType, inputSequence) {
      if (!angular.isDefined(inputSequence)) {
        window.alert('Invalid input');
        return;
      }
      webservice.getHelmNotation(polymerType.value, inputSequence)
        .success(function (response) {
          $scope.result = response.HELMNotation;
        })
        .error(function (response) {
          $scope.result = 'Invalid sequence';
          console.log(response);
        });
    };  

  	/* Event processing prototype - invoke factory function to get HELM image */ 
  	$scope.getHelmImage = function (inputSequence) {
      if (!angular.isDefined(inputSequence)) {
        window.alert('Invalid input');
        return;
    	}
      $scope.imageUrl = webservice.getHelmImage(inputSequence);
      $http.get($scope.imageUrl)
        .error(function (response) {
          window.alert(response);
        });
    };
  }]);

@@ -927,54 +927,431 @@
     
-webservice.getHelmNotation(polymerType.value, 
+if (polymerType.value === 'PEPTIDE') %7B%0A        webservice.getHelmNotationPeptide(inputSequence)%0A          .success(function (response) %7B%0A            $scope.result = response.HELMNotation;%0A          %7D)%0A          .error(function (response) %7B%0A            $scope.result = 'Invalid sequence';%0A            console.log(response);%0A          %7D);%0A      %7D else if (polymerType.value === 'RNA') %7B%0A        webservice.getHelmNotationRna(
 inpu
@@ -1353,32 +1353,34 @@
 (inputSequence)%0A
+  
         .success
@@ -1394,32 +1394,34 @@
 on (response) %7B%0A
+  
           $scope
@@ -1453,35 +1453,39 @@
 tation;%0A        
+  
 %7D)%0A
+  
         .error(f
@@ -1497,32 +1497,34 @@
 on (response) %7B%0A
+  
           $scope
@@ -1555,32 +1555,34 @@
 nce';%0A          
+  
 console.log(resp
@@ -1592,28 +1592,38 @@
 e);%0A        
+  
 %7D);%0A
+      %7D%0A
     %7D;  %0A%0A  
@@ -1862,16 +1862,16 @@
 %0A    %09%7D%0A
-
       $s
@@ -1909,16 +1909,19 @@
 elmImage
+Url
 (inputSe

Update prototype.js