Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style type="text/css">
- .wunderlist-item
- {
- width: calc(50% - 16px);
- display: inline-block;
- margin: 0 8px;
- padding: 4px 0;
- min-height: 48px;
- font-family: "Helvetica", "Arial", sans-serif;
- font-size: 14px;
- font-weight: 400;
- line-height: 20px;
- color: #616161;
- border-bottom: 1px solid #cccccc;
- }
- .wunderlist-item img
- {
- margin-right: 12px;
- position: relative;
- top: 10px;
- }
- @media only screen and (max-width: 839px)
- {
- .wunderlist-item
- {
- width: calc(100% - 16px);
- }
- }
- </style>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
- <script type="text/javascript">
- var wunderlistApp = angular.module("wunderlistApp", []);
- wunderlistApp.controller("wunderlistCtrl", function($scope, $http) {
- // get "list" parameter value
- name= "list";
- name = name.replace(/[\[\]]/g, "\\$&");
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)");
- var results = regex.exec(document.location.href);
- if (!results) return null;
- if (!results[2]) return '';
- listId = decodeURIComponent(results[2].replace(/\+/g, " "));
- // grab data
- $scope.wunderlistInterval = null;
- $scope.wunderlistRefresh = function()
- {
- $http({
- method: 'GET',
- url: "PATH_TO_WUNDERLIST.PHP/?list=" + listId,
- timeout: 2000
- }).then(function(response) {
- $scope.wunderlistTasks = response.data.data.tasks;
- });
- $scope.wunderlistInterval = setTimeout($scope.wunderlistRefresh, 3000);
- }
- $scope.wunderlistRefresh();
- });
- </script>
- <section ng-app="wunderlistApp" ng-controller="wunderlistCtrl">
- <div class="wunderlist-item" ng-repeat="task in wunderlistTasks">
- <img src="PATH_TO_ICON_32x32" width="32">
- {{task.title}} <small ng-if="task.due_date != ''">{{task.due_date}}</small>
- </div>
- </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement