Javi Jimenez Villar 13 лет назад
Родитель
Сommit
811320468b

+ 8 - 9
GruntFile.coffee

@@ -5,6 +5,7 @@ module.exports = (grunt) ->
     meta:
       file: 'lungo'
       packages: "packages",
+      plugins: "src/plugins",
       # BETA
       endpoint: "example/components",
       version: ".brownie",
@@ -49,15 +50,14 @@ module.exports = (grunt) ->
       icons: [
         'src/stylesheets/lungo.icon**.styl']
 
-      calendar_coffee: [
-        'packages/lungo.calendar/**.coffee']
-      calendar_styl: [
-        'packages/lungo.calendar/**.styl']
+      calendar:
+        coffee: 'src/plugins/calendar/**.coffee'
+        stylus: 'src/plugins/calendar/**.styl'
 
 
     coffee:
       core: files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.debug.js': '<%= source.coffee %>'
-      calendar: files: 'packages/lungo.calendar/package/lungo.calendar.js': '<%= source.calendar_coffee %>'
+      calendar: files: 'packages/lungo.calendar/lungo.calendar.js': '<%= source.calendar.coffee %>'
 
     uglify:
       options: compress: false, banner: "<%= meta.banner %>"
@@ -69,7 +69,7 @@ module.exports = (grunt) ->
       icons:
         options: compress: false
         files: '<%=meta.packages%>/<%=meta.file%>.icon/<%=meta.file%>.icon.css': '<%=source.icons%>'
-      calendar: files: 'packages/lungo.calendar/package/lungo.calendar.css': '<%=source.calendar_styl%>'
+      calendar: files: 'packages/lungo.calendar/lungo.calendar.css': '<%=source.calendar.stylus%>'
 
     copy:
       theme:
@@ -82,8 +82,8 @@ module.exports = (grunt) ->
       stylus:
         files: ['<%= source.stylus %>', '<%= source.theme %>']
         tasks: ["stylus:core", "stylus:theme"]
-      pkgs:
-        files: ['<%= source.calendar_coffee %>','<%= source.calendar_styl %>']
+      calendar:
+        files: ['<%= source.calendar.coffee %>','<%= source.calendar.stylus %>']
         tasks: ["coffee:calendar", "stylus:calendar"]
 
   grunt.loadNpmTasks "grunt-contrib-coffee"
@@ -94,4 +94,3 @@ module.exports = (grunt) ->
   grunt.loadNpmTasks "grunt-contrib-watch"
 
   grunt.registerTask "default", ["coffee", "uglify", "stylus", "copy"]
-  # grunt.registerTask "default", ["coffee:calendar", "stylus:calendar"]

+ 15 - 0
src/plugins/calendar/lungo.calendar.coffee

@@ -0,0 +1,15 @@
+###
+Lungo - HTML5 Cross-Device Framework
+http://lungo.tapquo.com
+Copyright (c) 2011-2013 Tapquo S.L. - Licensed GPLv3, Commercial
+
+@namespace  Lungo.Sugar
+@class      Calendar
+@author     Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
+###
+
+Lungo.Sugar.Calendar = do () ->
+
+  init = -> @
+
+  init: init

+ 58 - 0
src/plugins/calendar/lungo.calendar.styl

@@ -0,0 +1,58 @@
+[data-control=calendar]
+  position: absolute
+  top: 128px
+  left: 20px
+  z-index: 5 !important
+  width: 280px
+  display: block
+  font-size: 17px
+  margin: 0 auto
+
+  & table
+    background: #fff
+
+    & thead, tbody, tr
+      display: block
+      width: inherit
+
+    & thead td
+      font-weight: 700
+      font-size: 11px
+      line-height: 24px
+      border: 0px
+
+    & td
+      width: 40px
+      line-height: 40px
+      text-align: center
+      font-weight: 600
+      position: relative
+      border: solid 1px #eee
+      &:hover
+        background: green
+        border: 0px
+      &.today
+        background: blue
+        color: #fff !important
+        border: 0px
+      &.weekend
+        color: red
+      &.event:after
+        position: absolute
+        content: "·"
+        position: red
+        top: 12px
+        left: 15px
+        font-size: 28px
+        color: red
+      &.disabled
+        color: #ddd
+  & .layout
+    line-height: 40px
+    background: #000
+    text-align: center
+    font-size: 18px
+    color: #fff
+
+  & strong
+    margin: 0 4px