Commits

Juha Komulainen committed 3c70418

Moved the todo-example to its own directory.

  • Participants
  • Parent commits 3499482

Comments (0)

Files changed (8)

.idea/dictionaries/komu.xml

     <words>
       <w>angularjs</w>
       <w>ecma</w>
+      <w>googleapis</w>
       <w>todos</w>
       <w>unstyled</w>
     </words>

.idea/jsLibraryMappings.xml

 <?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="JavaScriptLibraryMappings">
-    <file url="file://$PROJECT_DIR$/index.html" libraries="{angular}" />
-  </component>
-</project>
+<project version="4" />
 

.idea/runConfigurations/build.xml

+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="build" type="K2JSConfigurationType" factoryName="Kotlin (JavaScript)" singleton="true">
+    <K2JSConfigurationSettings>
+      <option name="browserFamily" value="SAFARI" />
+      <option name="generatedFilePath" value="$PROJECT_DIR$/js" />
+      <option name="pageToOpenFilePath" value="" />
+      <option name="shouldOpenInBrowserAfterTranslation" value="false" />
+    </K2JSConfigurationSettings>
+    <RunnerSettings RunnerId="K2JSBrowserRunner" />
+    <ConfigurationWrapper RunnerId="K2JSBrowserRunner" />
+    <method />
+  </configuration>
+</component>

index.html

-<!DOCTYPE html>
-<html ng-app>
-<head>
-    <title></title>
-    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
-    <script src="lib/kotlinEcma3.js" type="text/javascript"></script>
-    <script type="text/javascript" src="js/angular-kotlin.js"></script>
-    <link rel="stylesheet" href="todo.css">
-    <!-- <script src="todo.js"></script> -->
-</head>
-<body>
-
-<script type="text/javascript">
-    window.TodoCtrl = Kotlin.modules["angular-kotlin"].todo.TodoCtrl
-</script>
-
-<h2>Todo</h2>
-<div ng-controller="TodoCtrl">
-    <span>{{remaining()}} of {{todos.length}} remaining</span>
-    [ <a href="" ng-click="archive()">archive</a> ]
-    <ul class="unstyled">
-        <li ng-repeat="todo in todos">
-            <label>
-                <input type="checkbox" ng-model="todo.done">
-                <span class="done-{{todo.done}}">{{todo.text}}</span>
-            </label>
-        </li>
-    </ul>
-    <form name="myForm" ng-submit="addTodo()">
-        <input type="text" ng-model="todoText" size="30" placeholder="add new todo here" required />
-        <input class="btn-primary" type="submit" value="add" ng-disabled="isClean() || myForm.$invalid" />
-    </form>
-</div>
-</body>
-</html>

todo.css

-.done-true {
-    text-decoration: line-through;
-    color: grey;
-}

todo.js

-function TodoCtrl($scope) {
-    $scope.todos = [
-        {text:'learn angular', done:true},
-        {text:'build an angular app', done:false}];
-
-    $scope.addTodo = function() {
-        $scope.todos.push({text:$scope.todoText, done:false});
-        $scope.todoText = '';
-    };
-
-    $scope.remaining = function() {
-        var count = 0;
-        angular.forEach($scope.todos, function(todo) {
-            count += todo.done ? 0 : 1;
-        });
-        return count;
-    };
-
-    $scope.archive = function() {
-        var oldTodos = $scope.todos;
-        $scope.todos = [];
-        angular.forEach(oldTodos, function(todo) {
-            if (!todo.done) $scope.todos.push(todo);
-        });
-    };
-}
+<!DOCTYPE html>
+<html ng-app>
+<head>
+    <title>todo</title>
+    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
+    <script src="../lib/kotlinEcma3.js" type="text/javascript"></script>
+    <script type="text/javascript" src="../js/angular-kotlin.js"></script>
+    <link rel="stylesheet" href="todo.css">
+</head>
+<body>
+
+<script type="text/javascript">
+    window.TodoCtrl = Kotlin.modules["angular-kotlin"].todo.TodoCtrl
+</script>
+
+<h2>Todo</h2>
+<div ng-controller="TodoCtrl">
+    <span>{{remaining()}} of {{todos.length}} remaining</span>
+    [ <a href="" ng-click="archive()">archive</a> ]
+    <ul class="unstyled">
+        <li ng-repeat="todo in todos">
+            <label>
+                <input type="checkbox" ng-model="todo.done">
+                <span class="done-{{todo.done}}">{{todo.text}}</span>
+            </label>
+        </li>
+    </ul>
+    <form name="myForm" ng-submit="addTodo()">
+        <input type="text" ng-model="todoText" size="30" placeholder="add new todo here" required />
+        <input class="btn-primary" type="submit" value="add" ng-disabled="isClean() || myForm.$invalid" />
+    </form>
+</div>
+</body>
+</html>
+.done-true {
+    text-decoration: line-through;
+    color: grey;
+}