Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
pulse00 committed Nov 27, 2010
0 parents commit 03fa592
Show file tree
Hide file tree
Showing 233 changed files with 47,808 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.rdoc
@@ -0,0 +1,3 @@
= google_docs_plugin

Description goes here
10 changes: 10 additions & 0 deletions app/views/hooks/_view_issues_form_details_bottom.rhtml
@@ -0,0 +1,10 @@
<a href="#" rel="<%= User.current.googledocs_preference(:account_email) %>" style="display:none" id="gdocs_email">

<%= stylesheet_link_tag "/plugin_assets/redmine_google_docs_plugin/stylesheets/modalbox-lib.css"%>
<%= javascript_include_tag("http://www.google.com/jsapi").sub('.js', '')%>
<%= javascript_tag "google.load('gdata', '2.x');"%>
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js"%>
<%= javascript_include_tag "/plugin_assets/redmine_google_docs_plugin/javascripts/modalbox-lib.js"%>
<%= javascript_include_tag "/plugin_assets/redmine_google_docs_plugin/javascripts/googledocs.js" %>

7 changes: 7 additions & 0 deletions app/views/shared/_view_my_account_gdocs.html.erb
@@ -0,0 +1,7 @@
<h3><%=l(:google_docs)%></h3>
<div class="box tabular">
<p>
<%= label :googledocs, :account_email %>
<%= text_field :googledocs, :account_email, :value => account_email %>
</p>
</div>
Binary file added assets/javascripts/.DS_Store
Binary file not shown.
78 changes: 78 additions & 0 deletions assets/javascripts/googledocs.js
@@ -0,0 +1,78 @@
function handleFeed(response) {

var entries = response.feed.entry;

if (!entries.length) {

alert('no documents found');
return;
}

var html = [];

for (var i = 0, entry; entry = entries[i]; i++) {
var title = entry.title.$t;

$('docs').insert('<li rel="' + entry.link[0].href + '">' + title + '</li>')
}

console.log(response);

}


function handleError(e) {



}

document.observe('dom:loaded', function() {

var email = $('gdocs_email').readAttribute('rel');

if (email.length == 0)
return;


$('issue_custom_field_values_1').observe('click', function() {


try {
Modalbox.show('<div><ul id="docs"></ul></div>', {
doNotMove: true,
title: 'Search your Google Docs',
overlayDuration: 0.0,
slideDownDuration: 0.0,
slideUpDuration: 0.0,
resizeDuration: 0.0,
overlayOpacity: 0.01,
autoFocusing: false,
afterLoad: function(){


var scope = 'https://docs.google.com/feeds/';
start = new Date().getTime();
if (google.accounts.user.checkLogin(scope)) {
var service = new google.gdata.client.GoogleService('writely', 'DocList-App-v2.0');
service.getFeed(scope + 'documents/private/full/', handleFeed, handleError);
} else {
var token = google.accounts.user.login(scope); // can ignore returned token
}

console.log('test');

}

});
} catch (e) {

console.log(e);

}

});



});

0 comments on commit 03fa592

Please sign in to comment.