Taiwan
|
本帖最後由 ken 於 2012-2-1 13:24 編輯
post after...
Intelligent analysis of youtube url address.
Applicable to www.youtube.com and youtu.be
I only translate three languages.
as Simplified Chinese, Traditional Chinese and English.
Step.1
Add this...
Step.2
Modify file /static/js/editor.js Line:1017
Add
- //Youtube Code by Ken
- case 'youtube' :
- selection = null ;
- var haveSel = selection == null || selection == false || in_array(trim(selection), ['', 'null', 'undefined', 'false' ]) ? 0 : 1;
- if(params == 1 && haveSel) {
- return insertText((opentag + selection + closetag), strlen(opentag), strlen(closetag), true, sel);
- }
- var promptlang = custombbcodes[tag]['prompt'].split("\t");
- for(var i = 1; i <= params; i++) {
- if(i != params || !haveSel) {
- str += lng['youtube_url'] + '<br /><br/><input type="text" id="' + ctrlid + '_param_' + i + '" style="width: 98%" value="" class="px" />' + (i < params ? '<br />' : '');
- }
- }
- break;
Copy the Code or download attachment and overwrite.
Step.3
Modify file /language/??/lang_js.js Line: 293
Add
- //Youtube Code by Ken
- 'youtube_url' : 'Please input youtube video url address.<br/><font color=red>include http:// </font><br/>',
- 'youtube_url_1' : 'Url address must include http://',
- 'youtube_url_2' : 'Url address is not youtube provide, Please re-paste again, Thanks',
- 'youtube_url_3' : 'Youtube url address format error!',
Copy the Code or download attachment and overwrite.
Step.4
Save as youtube.gif upload to u /static/image/
Step.5
Add this...
Step.6
In Details...
Replacement content:
- <iframe width="640" height="360" src="http://www.youtube.com/embed/{1}?hd=1&wmode=transparent" frameborder="0" allowfullscreen wmode="Opaque"></iframe>
Copy the Code and given the appropriate permissions.
All done! now you can input youtube url address in editor!
attachment is modify in Rev.332
hope any one can help translate it. |
This post contains more resources
You have to Login for download or view attachment(s). No Account? Register
x
|