##// END OF EJS Templates
remove weird unicode space in the new copyright header...
MinRK -
Show More
@@ -1,74 +1,74 b''
1 1 =============================
2 2 The IPython licensing terms
3 3 =============================
4 4
5 5 IPython is licensed under the terms of the Modified BSD License (also known as
6 6 New or Revised or 3-Clause BSD), as follows:
7 7
8 8 - Copyright (c) 2008-2014, IPython Development Team
9 9 - Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 10 - Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 11 - Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 12
13 13 All rights reserved.
14 14
15 15 Redistribution and use in source and binary forms, with or without
16 16 modification, are permitted provided that the following conditions are met:
17 17
18 18 Redistributions of source code must retain the above copyright notice, this
19 19 list of conditions and the following disclaimer.
20 20
21 21 Redistributions in binary form must reproduce the above copyright notice, this
22 22 list of conditions and the following disclaimer in the documentation and/or
23 23 other materials provided with the distribution.
24 24
25 25 Neither the name of the IPython Development Team nor the names of its
26 26 contributors may be used to endorse or promote products derived from this
27 27 software without specific prior written permission.
28 28
29 29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30 30 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 31 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 32 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
33 33 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 34 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 35 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37 37 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 39
40 40 About the IPython Development Team
41 41 ----------------------------------
42 42
43 43 Fernando Perez began IPython in 2001 based on code from Janko Hauser
44 44 <jhauser@zscout.de> and Nathaniel Gray <n8gray@caltech.edu>. Fernando is still
45 45 the project lead.
46 46
47 47 The IPython Development Team is the set of all contributors to the IPython
48 48 project. This includes all of the IPython subprojects. A full list with
49 49 details is kept in the documentation directory, in the file
50 50 ``about/credits.txt``.
51 51
52 52 The core team that coordinates development on GitHub can be found here:
53 53 https://github.com/ipython/.
54 54
55 55 Our Copyright Policy
56 56 --------------------
57 57
58 58 IPython uses a shared copyright model. Each contributor maintains copyright
59 59 over their contributions to IPython. But, it is important to note that these
60 60 contributions are typically only changes to the repositories. Thus, the IPython
61 61 source code, in its entirety is not the copyright of any single person or
62 62 institution. Instead, it is the collective copyright of the entire IPython
63 63 Development Team. If individual contributors want to maintain a record of what
64 64 changes/contributions they have specific copyright on, they should indicate
65 65 their copyright in the commit message of the change, when they commit the
66 66 change to one of the IPython repositories.
67 67
68 68 With this in mind, the following banner should be used in any source code file
69 69 to indicate the copyright and license terms:
70 70
71 71 ::
72 72
73 # Copyright (c) IPython Development Team.
74 # Distributed under the terms of the Modified BSD License.
73 # Copyright (c) IPython Development Team.
74 # Distributed under the terms of the Modified BSD License.
@@ -1,171 +1,171 b''
1 // Copyright (c) IPython Development Team.
2 // Distributed under the terms of the Modified BSD License.
1 // Copyright (c) IPython Development Team.
2 // Distributed under the terms of the Modified BSD License.
3 3
4 4 //============================================================================
5 5 // QuickHelp button
6 6 //============================================================================
7 7
8 8 var IPython = (function (IPython) {
9 9 "use strict";
10 10
11 11 var platform = IPython.utils.platform;
12 12
13 13 var QuickHelp = function (selector) {
14 14 };
15 15
16 16 var cmd_ctrl = 'Ctrl-';
17 17 var platform_specific;
18 18
19 19 if (platform === 'MacOS') {
20 20 // Mac OS X specific
21 21 cmd_ctrl = 'Cmd-';
22 22 platform_specific = [
23 23 { shortcut: "Cmd-Up", help:"go to cell start" },
24 24 { shortcut: "Cmd-Down", help:"go to cell end" },
25 25 { shortcut: "Opt-Left", help:"go one word left" },
26 26 { shortcut: "Opt-Right", help:"go one word right" },
27 27 { shortcut: "Opt-Backspace", help:"del word before" },
28 28 { shortcut: "Opt-Delete", help:"del word after" },
29 29 ];
30 30 } else {
31 31 // PC specific
32 32 platform_specific = [
33 33 { shortcut: "Ctrl-Home", help:"go to cell start" },
34 34 { shortcut: "Ctrl-Up", help:"go to cell start" },
35 35 { shortcut: "Ctrl-End", help:"go to cell end" },
36 36 { shortcut: "Ctrl-Down", help:"go to cell end" },
37 37 { shortcut: "Ctrl-Left", help:"go one word left" },
38 38 { shortcut: "Ctrl-Right", help:"go one word right" },
39 39 { shortcut: "Ctrl-Backspace", help:"del word before" },
40 40 { shortcut: "Ctrl-Delete", help:"del word after" },
41 41 ];
42 42 }
43 43
44 44 var cm_shortcuts = [
45 45 { shortcut:"Tab", help:"code completion or indent" },
46 46 { shortcut:"Shift-Tab", help:"tooltip" },
47 47 { shortcut: cmd_ctrl + "]", help:"indent" },
48 48 { shortcut: cmd_ctrl + "[", help:"dedent" },
49 49 { shortcut: cmd_ctrl + "a", help:"select all" },
50 50 { shortcut: cmd_ctrl + "z", help:"undo" },
51 51 { shortcut: cmd_ctrl + "Shift-z", help:"redo" },
52 52 { shortcut: cmd_ctrl + "y", help:"redo" },
53 53 ].concat( platform_specific );
54 54
55 55
56 56
57 57
58 58
59 59
60 60 QuickHelp.prototype.show_keyboard_shortcuts = function () {
61 61 // toggles display of keyboard shortcut dialog
62 62 var that = this;
63 63 if ( this.force_rebuild ) {
64 64 this.shortcut_dialog.remove();
65 65 delete(this.shortcut_dialog);
66 66 this.force_rebuild = false;
67 67 }
68 68 if ( this.shortcut_dialog ){
69 69 // if dialog is already shown, close it
70 70 $(this.shortcut_dialog).modal("toggle");
71 71 return;
72 72 }
73 73 var command_shortcuts = IPython.keyboard_manager.command_shortcuts.help();
74 74 var edit_shortcuts = IPython.keyboard_manager.edit_shortcuts.help();
75 75 var help, shortcut;
76 76 var i, half, n;
77 77 var element = $('<div/>');
78 78
79 79 // The documentation
80 80 var doc = $('<div/>').addClass('alert');
81 81 doc.append(
82 82 $('<button/>').addClass('close').attr('data-dismiss','alert').html('&times;')
83 83 ).append(
84 84 'The IPython Notebook has two different keyboard input modes. <b>Edit mode</b> '+
85 85 'allows you to type code/text into a cell and is indicated by a green cell '+
86 86 'border. <b>Command mode</b> binds the keyboard to notebook level actions '+
87 87 'and is indicated by a grey cell border.'
88 88 );
89 89 element.append(doc);
90 90
91 91 // Command mode
92 92 var cmd_div = this.build_command_help();
93 93 element.append(cmd_div);
94 94
95 95 // Edit mode
96 96 var edit_div = this.build_edit_help(cm_shortcuts);
97 97 element.append(edit_div);
98 98
99 99 this.shortcut_dialog = IPython.dialog.modal({
100 100 title : "Keyboard shortcuts",
101 101 body : element,
102 102 destroy : false,
103 103 buttons : {
104 104 Close : {}
105 105 }
106 106 });
107 107 this.shortcut_dialog.addClass("modal_stretch");
108 108
109 109 $([IPython.events]).on('rebuild.QuickHelp', function() { that.force_rebuild = true;});
110 110 };
111 111
112 112 QuickHelp.prototype.build_command_help = function () {
113 113 var command_shortcuts = IPython.keyboard_manager.command_shortcuts.help();
114 114 return build_div('<h4>Command Mode (press <code>Esc</code> to enable)</h4>', command_shortcuts);
115 115 };
116 116
117 117 var special_case = { pageup: "PageUp", pagedown: "Page Down", 'minus': '-' };
118 118 var prettify = function (s) {
119 119 s = s.replace(/-$/, 'minus'); // catch shortcuts using '-' key
120 120 var keys = s.split('-');
121 121 var k, i;
122 122 for (i in keys) {
123 123 k = keys[i];
124 124 if ( k.length == 1 ) {
125 125 keys[i] = "<code><strong>" + k + "</strong></code>";
126 126 continue; // leave individual keys lower-cased
127 127 }
128 128 keys[i] = ( special_case[k] ? special_case[k] : k.charAt(0).toUpperCase() + k.slice(1) );
129 129 keys[i] = "<code><strong>" + keys[i] + "</strong></code>";
130 130 }
131 131 return keys.join('-');
132 132
133 133
134 134 };
135 135
136 136 QuickHelp.prototype.build_edit_help = function (cm_shortcuts) {
137 137 var edit_shortcuts = IPython.keyboard_manager.edit_shortcuts.help();
138 138 jQuery.extend(cm_shortcuts, edit_shortcuts);
139 139 return build_div('<h4>Edit Mode (press <code>Enter</code> to enable)</h4>', cm_shortcuts);
140 140 };
141 141
142 142 var build_one = function (s) {
143 143 var help = s.help;
144 144 var shortcut = prettify(s.shortcut);
145 145 return $('<div>').addClass('quickhelp').
146 146 append($('<span/>').addClass('shortcut_key').append($(shortcut))).
147 147 append($('<span/>').addClass('shortcut_descr').text(' : ' + help));
148 148
149 149 };
150 150
151 151 var build_div = function (title, shortcuts) {
152 152 var i, half, n;
153 153 var div = $('<div/>').append($(title));
154 154 var sub_div = $('<div/>').addClass('hbox');
155 155 var col1 = $('<div/>').addClass('box-flex1');
156 156 var col2 = $('<div/>').addClass('box-flex1');
157 157 n = shortcuts.length;
158 158 half = ~~(n/2); // Truncate :)
159 159 for (i=0; i<half; i++) { col1.append( build_one(shortcuts[i]) ); }
160 160 for (i=half; i<n; i++) { col2.append( build_one(shortcuts[i]) ); }
161 161 sub_div.append(col1).append(col2);
162 162 div.append(sub_div);
163 163 return div;
164 164 };
165 165
166 166 // Set module variables
167 167 IPython.QuickHelp = QuickHelp;
168 168
169 169 return IPython;
170 170
171 171 }(IPython));
General Comments 0
You need to be logged in to leave comments. Login now