Permalink
Browse files

Om Sree Ganeshaya Namah:

  • Loading branch information...
parolkar committed Oct 19, 2009
0 parents commit 5f68ed3efd85250a24a52b67ce1c16a8dae6c6ab
@@ -0,0 +1,20 @@
+Copyright (c) 2009 [name of plugin creator]
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 README
@@ -0,0 +1,13 @@
+GeoMereLaal
+===========
+
+Introduction goes here.
+
+
+Example
+=======
+
+Example goes here.
+
+
+Copyright (c) 2009 Abhishek Parolkar, released under the MIT license
@@ -0,0 +1,23 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
+desc 'Test the geo_mere_laal plugin.'
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = true
+end
+
+desc 'Generate documentation for the geo_mere_laal plugin.'
+Rake::RDocTask.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'GeoMereLaal'
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.rdoc_files.include('README')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
@@ -0,0 +1,9 @@
+class GeoMereLaalController < ApplicationController
+
+ def init
+
+ response["Content-type"] = "text/javascript"
+
+ end
+
+end
@@ -0,0 +1,51 @@
+//Author: Abhishek Parolkar ( abhishek@parolkar.com )
+
+
+GeoMereLaal = function(){
+
+ var latitude = new String();
+ var longitude = new String();
+
+ return {
+ lat: function(){
+ return latitude;
+ },
+ lng: function(){
+ return longitude;
+ },
+ isBrowserCompatible: function(){
+ var userAgent = navigator.userAgent.toLowerCase();
+ // Figure out what browser is being used in Jquery Style
+ this.browser = {
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ safari: /webkit/.test( userAgent ),
+ opera: /opera/.test( userAgent ),
+ msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
+ mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
+ };
+
+ if (this.browser.mozilla && navigator.geolocation) {
+ return true;
+ } else {
+ return false;
+ }
+
+ },
+ request: function(){
+ if(this.isBrowserCompatible())
+ {
+ navigator.geolocation.getCurrentPosition(function(position) {
+ latitude = position.coords.latitude;
+ longitude = position.coords.longitude;
+
+ });
+ return true;
+
+ }else{return false;}
+ }
+
+
+
+
+}}();
+
@@ -0,0 +1,2 @@
+
+require "geo_mere_laal"
@@ -0,0 +1 @@
+# Install hook code here
@@ -0,0 +1,8 @@
+
+class GeoMereLaal
+ def self.init
+ " <script id=\"geo_mere_laal_loader\"></script><script>if(typeof GeoMereLaal == 'undefined') document.getElementById(\"geo_mere_laal_loader\").src = \"/geo_mere_laal/init\" ;</script>"
+ end
+end
+
+
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :geo_mere_laal do
+# # Task goes here
+# end
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class GeoMereLaalTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
@@ -0,0 +1,3 @@
+require 'rubygems'
+require 'active_support'
+require 'active_support/test_case'
@@ -0,0 +1 @@
+# Uninstall hook code here

0 comments on commit 5f68ed3

Please sign in to comment.