Created
April 3, 2010 08:55
-
-
Save anonymous/354283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//selectedHistory | |
//author: jazztao | |
jetpack.future.import("slideBar"); | |
var _doc; | |
//左邊的SlideBar | |
jetpack.slideBar.append( | |
{ | |
icon: "https://jetpack.mozillalabs.com/images/jetpack.png", | |
html: "<html><body>Hello!底下是你選取過的字串</body></html>", | |
onReady: function(slider) { _doc = slider.contentDocument; } | |
}); | |
var myStringArray = new Array(); | |
//當選取的時候 | |
jetpack.future.import("selection"); | |
jetpack.selection.onSelection(function(){ | |
var newSelection = jetpack.selection.text; | |
//顯示選取的字串 | |
jetpack.notifications.show(newSelection); | |
//將字串生成物件,丟進array裡。 | |
//jetpack.selection.html = "<b>" + jetpack.selection.html +"</b>"; | |
//myStringArray[myStringArray.length] = "<ul><b>" + newSelection + "</b></ul>"; | |
$("body", _doc).append( "<ul>" + newSelection + "</ul>"); | |
jetpack.notifications.show(myStringArray.toString()); | |
//jetpack.notifications.show("Success Add the world"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment