Contextual bookmarks bar - google-chrome-extension

I'm wondering if there is a good contextual bookmarks bar out there - e.g. When I'm on google.com, I see different bookmarks than when I navigate to nytimes.com.
Just trying to get a sense before building my own - I had no luck googling for solutions.

To help you started, you can refer from this documentation:
Use the chrome.bookmarks API to create, organize, and otherwise
manipulate bookmarks. Also see Override Pages, which you can use
to create a custom Bookmark Manager page.
You can follow the whole process in the documentation.
Examples are also provided, see sample snippet below.
The following code creates a folder with the title "Extension
bookmarks". The first argument to create() specifies properties for
the new folder. The second argument defines a function to be executed
after the folder is created.
chrome.bookmarks.create({'parentId': bookmarkBar.id,
'title': 'Extension bookmarks'},
function(newFolder) {
console.log("added folder: " + newFolder.title);
});
The next snippet creates a bookmark pointing to the developer
documentation for extensions. Since nothing bad will happen if
creating the bookmark fails, this code doesn't bother to define a
callback function.
chrome.bookmarks.create({'parentId': extensionsFolderId,
'title': 'Extensions doc',
'url': 'http://code.google.com/chrome/extensions'});
You can refer from these basic samples and other samples for reference.

Related

Grav - Parse URL

I want to define a new template called "product".
This template calls an external service and retrieves the information about that specific product. That is easily done with a custom plugin that access the product information. Information on how to do that has been found here.
However, I would like that the URL of the page would be something like:
/product/<id>/<seo-friendly-description>
So I can retrieve in the Twig template both <id> and <seo-friendly-description> which will be used later to retrieve the specific product information.
I have tried to find something that could help in the documentation, without success. Could someone either point me to the right doc section or highlight the basic steps that shall be achieved so I can start solving this issue?
Just in case it helps, I am trying to find something similar to how bottle or other web frameworks work:
#route('/hello/<name>')
def greet(name):
return 'Hello ' + name
I've been building a family recipebook into my own website and I've been working through a similar problem. I haven't quite worked out all the kinks, but my solution is mostly working if you want to checkout my github repo.
In short, you need the plugin to watch what the active route is. If the route matches, you then create the page and populate it using your plugin data.
I haven't quite figured out how to get the active page to highlight in the navigation menu for generated pages, but you might still find this solution helpful.

CouchDB/Sofa: Cannot create new post (from default template) with save button

I am currently learning CouchDB and using the O'Reilly book as a guide to get started. I've been following it pretty thoroughly, however, upon working with Sofa, the book requires me to inspect what happens when we hit 'Save' on our edit template. The book says that I should see a success response (uses Firebug the button triggers the Put request), however, instead I get a "
{"error":"not_found","reason":"missing shows function new.html on design doc _design/sofa"}"
Now I only started reading this week and I know the answer might be obvious, but if someone could at least point me in the right direction (where in Sofa to add, fix a bug, patch) that would be great.
My initial guess is that I need to add a "new" shows function, but I just wanted some advice before I delve into this wild goose chase.
sorry if this is a noob question.
{"couchdb":"Welcome","uuid":"4d9b6082e16607a33dcbfdffb57503b5","version":"1.6.1","vendor":{"version":"1.6.1","name":"The Apache Software Foundation"}}
Downloaded the newest version of Sofa from (https://github.com/jchris/sofa)
How to resolve the issue
The issue is that the page is being accessed from:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit
Access it instead from:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/
(Your database name may differ from 'myblogdb'). Note the trailing backslash.
Explanation of why a show function called "new" is not necessary:
Take the following query to a show function:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/This-is-a-second-post
This will call the function in edit.js and pass in the document with an _id of This-is-a-second-post, if such a document exists. If the document doesn't exists, as in the case of
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/new.html
Then edit.js sets up the data object passed to Mustache.to_html to have the correct fields for a new post.
Why it breaks in your case
When the edit show function is accessed via
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit
The relatives paths to the scripts no longer work.
Then the script defined in edit.html is no longer correct.
As a result, the submit handler
$("form#new-post").submit(function() { ...
is no longer called. If it were called it would return false at the end, which prevents new.html from being POSTed.
Since it is not called, new.html ends up being POSTed, and that redirects the browser to
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/new.html
which points to a non-existent show function, resulting in the error message you are seeing.

Open/Edit Triggers Only Work for Creator in New Google Sheets

It seems that if I create an open or edit trigger in the new Google Sheets, it only runs it for the user who created the trigger. I do NOT experience this issue in the old Google sheets. Here are the steps I am following:
Create a Google Spreadsheet (the new version).
Create a new script function, such as one that creates a custom menu.
Manually create a trigger so that this function is executed when the spreadsheet is opened. (I think the issue still occurs with the functions that have auto-triggers, like onOpen() and onEdit().
Now open the spreadsheet as the same user. Notice that the custom menu will show up properly.
Open the spreadsheet as a different user who has edit access to the spreadsheet. In the old Google Sheets, this new user would see the custom menu. However, the function does not seem to even attempt execution in the new Google Sheets, even if I use the exact same code.
Here is some example code, just to confirm I'm not doing anything wrong on the scripting side:
function createMenu() {
var menuItems = [
{name: "Test Menu Item", functionName: "test"}
];
SpreadsheetApp.getActive().addMenu("Test Menu", menuItems);
}
function test(){
}
NOTE: I've tried this with other pieces of code, too, so I'm almost positive it's not an issue with syntax or anything like that. When I run it MANUALLY as the second user, it creates the menu just fine. The issue is that the Open trigger isn't working properly in the new sheets.
I've reproduced this in two different Google Account domains (or whatever those organization things are called). I've also reproduced it on multiple spreadsheets. Let me know if you need any more details.
EDIT: Google confirmed that it is an issue with changing the client-side UI from an open/edit trigger. Please star the issue if you would like it to get fixed or would like to receive updates on it:
https://code.google.com/p/google-apps-script-issues/issues/detail?id=4021&thanks=4021&ts=1400503046
Google confirmed that it is an issue with changing the client-side UI from an open/edit trigger. Please star the issue if you would like it to get fixed or would like to receive updates on it: https://code.google.com/p/google-apps-script-issues/issues/detail?id=4021&thanks=4021&ts=1400503046

Open Graph object with no title doesn't show a link

I'm am successfully posting Open Graph stories without object titles, per the instructions here:
Objects without titles
However, the text in my post is not being linked to my object URL. Even in the instructions there are inconsistencies - e.g. "Alberto Tretti took a photo with Dev Sandbox" - photo is usually linked but in the last example on the page it's not - see attached screenshots. How can I make sure there is a link to my object URL?
I know this post is almost a year old, but it was the first google result in my search so I think it deserves an answer. A warning before I begin, I haven't used self hosted objects or objects without titles so this may be wrong but this seems to apply to the rest of the Facebook sharing that I've done. With that said…
In both of the examples you posted there is a link to the object. In the first it is the word "photo" in "Alberto Tretti took a photo with Dev Sandbox." in the second it is the "object title' in the object section underneath it.
By my understanding unless in the open graph story you modify the share text so that it doesn't include the default share text it will always include a link to the object. If you want there to be a link in the text of the post you can modify the "One to One - Without Object Title" post in the story you are using to use some other part of your object, like the description or a custom property.

How Do You Create a Page that Selects and Clones part of a Document Library in Sharepoint 2007?

I am trying to set up a MySite allowing individuals to create and modify multiple projects, each which will contain a partial copy of a master Document Library. I have already created the Library and uploaded the documents, and I have a page on which I have been experimenting with how to do this.
I need to be able to display a list of the documents in the document library, allow the user to select which ones they want, and then when they click on a button, I need to initialize the database with some information about that prjoect, some information about each of the files, and the documents need to be copied to a new location, so that the user can pull them up and edit and save the changes that are specific to the one project. Also we will need to be able to be able to add/remove them through a similar interface after the project has already been created, if possible.
And, unfortunately, anything at all that uses code has been restricted; so, we can't use anything that will require anything to be installed in the GAC, and I can't even use any server-side scripts within the ASPX file. It seems like almost everything I find when I search for "Sharepoint 2007 clone Master Document Library" or the like involves using code.
I have been playing around with things in SharePoint designer for creating the UI, and I figured out how to get a list of the documents to show, although I'm having a hard time duplicating it. It created a <WebPartPages:DataFormWebPart> with a <SharePoint:SPDataSource> in it. However, when I've tried to pull over things like a Data View CheckBoxList to the document list, either it just won't let me drop it (this includes anywhere on the form, not just in the document list), or, as expected actually, it doesn't actually bind to each line of the list. It's not entirely clear to me what to do to create this.
I do get (more or less) that you can bind the controls via the .xslt in the form, but I'm figuring it's got to be simpler than writing them by hand since the designer looks so much like the Visual Studio designer. I am having a very hard time figuring out what exactly to do to get any of the controls to work, though; most of them have the same issue as the CheckBoxList and won't even drop on the form. I'm assuming there's a panel of some type, or some other thing, that I need to add to the form first, but this is so different from what I'm used to that I'm having a hard time even getting my bearings.
So, can someone point me in the right direction here? I'm going to need to be able to create the projects, select the documents, copy them over with some other information into a new project, including creating some items in the database. I have been developing software for a long time, on many different platforms with many different languages, although lately it's mainly been WinForms, with a fair bit of .aspx stuff (but nothing too fancy), and it's never been this hard. I figure there's just something I'm not getting about the model here; like, how do you tell the form you want to use x/y/z control connected to particular datasource? How do you tell sharepoint to create a new location for the files? How can you submit the selected files once you have them to Sharepoint and tell them where to copy to?
Any help would be so appreciated I have been tearing my hair out for days. :)
You might have had a change with SharePoint 2010, as there is a javascript/jQuery programming model, but without that you don't have a realistic of coding what you will need. You may get lucky and be able to call the SharePoint web services using jQuery, but it is going to be a lot of work to get around a "no code" requirement.
Okay, well, I was finally able to get this mostly working, although there are still some issues with displaying the data once I get it back; I will try to update this question once I have a better answer for that.
There's a cool library called SPServices which combines with JQuery to give an interface to the web services for SharePoint 2007. It seems to more or less provide an interface to anything that you need to do to use the web services without a lot of extra work on your part.
For example, to query a document library, I set up a function something like this in a helper class (based upon the examples from the SPServices documentation).
ServiceClass.prototype.getSpecialDocLib = function (onComplete) {
var sc = this;
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Special Document Library",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function (xData, Status) {
var outTable = new DocTable();
$(xData.responseXML).find("[nodeName='z:row']").each(function () {
var i;
var outRow = new DocTableRow();
for (i = 0; i < this.attributes.length; ++i) {
outRow.addField(this.attributes[i].localName, this.attributes[i].value);
};
outTable.addRow(outRow);
});
sc.onDocumentListComplete(xData, Status);
if (onComplete != null)
onComplete(resultTable);
}
});
};
For copying a document library from one place to another, I believe you can use Lists.AddList to create it, (not specifically documented in SPServices but is based upon this Web Service call) either from scratch or a template, and I believe you can use the SPServices Copy.CopyIntoItemsLocal method.
Anyway, I seem to be making progress with this so far; I will update and accept this answer once I have a little more experience and time to make sure everything works, but so far I seem to be making progress toward the "no code" goal.

Resources